Quantcast

Agent Scheduling

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Agent Scheduling

Elham Foruzan

Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.

------------------------------------------------------------

Elham Foruzan

PhD Student

Department of Electrical and Computer Engineering

University of Nebraska-Lincoln

214.4 B Scott Engineering 



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

srcnick
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

Elham Foruzan
Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------

Elham Foruzan

PhD Student

Department of Electrical and Computer Engineering

University of Nebraska-Lincoln

214.4 B Scott Engineering 



On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

srcnick
Elham,

This error can occur if the context id set in the ContextBuilder (i.e., context.setId("smartGrids)) doesn’t match the id in the scenario folder context.xml file (e.g. <context id=“jzombies”).


Nick

On Oct 24, 2016, at 11:11 AM, Elham Foruzan <[hidden email]> wrote:

Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

Elham Foruzan
Nick,

I really appreciate your help. That was one of my problems, thanks for addressing that. Mine was started with capital S instead of small s in the context.xml. However, I have another problem as well. The other error says that: 

caused by: java.lang.RuntimeException: Projection ' space' not found.
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createLayout(AbstractCartesianDisplayCreator.java:57)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:62)

I did define the space in context.xml and in the SmartGridBuilder. Then I can't understand the error. Also, I looked up online and I saw that some people address it to the model score. But I can't find the model score in my repast 2.3.1.


Thank you very much for your go to the point answers. 































------------------------------------------------------------

Elham Foruzan

PhD Student

Department of Electrical and Computer Engineering

University of Nebraska-Lincoln

214.4 B Scott Engineering 



On Tue, Oct 25, 2016 at 8:03 AM, Nick Collier <[hidden email]> wrote:
Elham,

This error can occur if the context id set in the ContextBuilder (i.e., context.setId("smartGrids)) doesn’t match the id in the scenario folder context.xml file (e.g. <context id=“jzombies”).


Nick

On Oct 24, 2016, at 11:11 AM, Elham Foruzan <[hidden email]> wrote:

Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest





------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

Elham Foruzan
In reply to this post by Elham Foruzan
Nick,



I really appreciate your support and help.  as you said, I used the schedulemethod for calling preStep, Step, and postStep and put them inside the agent classes( put them in all agents with setting priorities). this is fine, but I looked up the repast emails for a better solution. 

Can I have this structure in the separate class? if yes, should this class extends the BasicAction? Also, if I am initializing my agents at the SmartGridBuilder class (as it can be seen in my attached SmartGrid Builder), how can I use the existing allAgent ArrayList  in a new class to iterate through them? Because in the new class I don't have any access to the allAgent ArrayList that I created in the SmartGrid Builder. Should the allAgent Arraylist be static???? I am a little confused. 


Schedule class extends BasicAuction{

for(i=0; i< allAgent.size; i++){

agentarraylist[i]. preStep()
}

for(i=0; i<allAgent.size; i++){

agentarraylist[i]. Step()
}

for(i=0; i< allAgent.size; i++){

agentarraylist[i]. postStep()
}



}


Thank you very much. 



------------------------------------------------------------

Elham Foruzan

PhD Student

Department of Electrical and Computer Engineering

University of Nebraska-Lincoln

214.4 B Scott Engineering 



On Mon, Oct 24, 2016 at 10:11 AM, Elham Foruzan <[hidden email]> wrote:
Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------

Elham Foruzan

PhD Student

Department of Electrical and Computer Engineering

University of Nebraska-Lincoln

214.4 B Scott Engineering 



On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

srcnick
If you want to use an explicit action to execute your behavior, you’ll need to implement IAction:

public class Behavior implements IAction {

public void execute() {
// iterate over the agents calling preStep etc. in here.
}
}

When you create this action in your ContextBuilder, you can pass the agentarraylist in this action’s constructor so you have a reference to it. You could also use a Java 8 lambda as the action as well. I think I explained that recently so search the list for it if you are interested.

Nick

On Oct 25, 2016, at 3:54 PM, Elham Foruzan <[hidden email]> wrote:

Nick,



I really appreciate your support and help.  as you said, I used the schedulemethod for calling preStep, Step, and postStep and put them inside the agent classes( put them in all agents with setting priorities). this is fine, but I looked up the repast emails for a better solution. 

Can I have this structure in the separate class? if yes, should this class extends the BasicAction? Also, if I am initializing my agents at the SmartGridBuilder class (as it can be seen in my attached SmartGrid Builder), how can I use the existing allAgent ArrayList  in a new class to iterate through them? Because in the new class I don't have any access to the allAgent ArrayList that I created in the SmartGrid Builder. Should the allAgent Arraylist be static???? I am a little confused. 


Schedule class extends BasicAuction{

for(i=0; i< allAgent.size; i++){

agentarraylist[i]. preStep()
}

for(i=0; i<allAgent.size; i++){

agentarraylist[i]. Step()
}

for(i=0; i< allAgent.size; i++){

agentarraylist[i]. postStep()
}



}


Thank you very much. 



------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 10:11 AM, Elham Foruzan <[hidden email]> wrote:
Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest





------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

srcnick
In reply to this post by Elham Foruzan
The score file was from an older version of Simphony. Did you create a projection called “space” in the ContextBuilder?

Nick

On Oct 25, 2016, at 3:52 PM, Elham Foruzan <[hidden email]> wrote:

Nick,

I really appreciate your help. That was one of my problems, thanks for addressing that. Mine was started with capital S instead of small s in the context.xml. However, I have another problem as well. The other error says that: 

caused by: java.lang.RuntimeException: Projection ' space' not found.
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createLayout(AbstractCartesianDisplayCreator.java:57)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:62)

I did define the space in context.xml and in the SmartGridBuilder. Then I can't understand the error. Also, I looked up online and I saw that some people address it to the model score. But I can't find the model score in my repast 2.3.1.


Thank you very much for your go to the point answers. 































------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Tue, Oct 25, 2016 at 8:03 AM, Nick Collier <[hidden email]> wrote:
Elham,

This error can occur if the context id set in the ContextBuilder (i.e., context.setId("smartGrids)) doesn’t match the id in the scenario folder context.xml file (e.g. <context id=“jzombies”).


Nick

On Oct 24, 2016, at 11:11 AM, Elham Foruzan <[hidden email]> wrote:

Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest






------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

elham.foruzan@huskers.unl.edu

Yes, I did. Please look at my contextBuilder.


package smartGrids;

import repast.simphony.engine.schedule.ScheduledMethod;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;

import repast.simphony.context.Context;
import repast.simphony.context.DefaultContext;
import repast.simphony.context.space.continuous.ContinuousSpaceFactory;
import repast.simphony.context.space.continuous.ContinuousSpaceFactoryFinder;
import repast.simphony.context.space.graph.NetworkBuilder;
import repast.simphony.context.space.grid.GridFactory;
import repast.simphony.context.space.grid.GridFactoryFinder;
import repast.simphony.dataLoader.ContextBuilder;
import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.essentials.RepastEssentials;
import repast.simphony.parameter.Parameters;
import repast.simphony.space.continuous.ContinuousSpace;
import repast.simphony.space.continuous.NdPoint;
import repast.simphony.space.continuous.RandomCartesianAdder;
import repast.simphony.space.grid.Grid;
import repast.simphony.space.grid.GridBuilderParameters;
import repast.simphony.space.grid.SimpleGridAdder;
import repast.simphony.space.grid.WrapAroundBorders;

public class smartGridsBuilder implements ContextBuilder<Object> {
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
GridFactory gridFactory = GridFactoryFinder.createGridFactory(null);
Grid<Object> grid = gridFactory.createGrid("grid",context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), true, 100, 100));
 
 
  ContinuousSpaceFactory spaceFactory = ContinuousSpaceFactoryFinder
.createContinuousSpaceFactory(null);
ContinuousSpace<Object> space = spaceFactory.createContinuousSpace(
"space", context, new RandomCartesianAdder<Object>(),
new repast.simphony.space.continuous.WrapAroundBorders(), 100,
100);
 
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
 Parameters params = RunEnvironment.getInstance().getParameters();
 double SolarVari = (Double) params.getValue("solar_vari");
 double WindVari = (Double) params.getValue("wind_vari");
 double LoadVari = (Double) params.getValue("load_vari");
 double DieselMaximum  = (Double) params.getValue("diesel_Max");
 double DieselRamp  = (Double) params.getValue("diesel_Ramp");
 double DieselcostA  = (Double) params.getValue("diesel_A");
 double DieselcostB  = (Double) params.getValue("diesel_B");
 double storagDecay = (Double) params.getValue("storage_Decaye");
 double storagCapacity = (Double) params.getValue("storage_Capacity");
 double storagvariation = (Double) params.getValue("storage_vari");
   
 SolarPowers.setGeneration(SolarVari);
 WindPowers.setGeneration(WindVari);
 Consumers.setConsumption(LoadVari);
 Diesels.setGeneration(DieselMaximum,DieselRamp );
 Diesels.setExpenses( DieselcostA ,DieselcostB );
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
allAgents.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addBuyers((Collection<? extends Agent>)storage);//adds all the storage units to the list of buyers
ac.addBuyer(mainGrid);
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)storage);//adds all the storage units to the list of buyers
ac.addSeller(mainGrid);
context.add(ac);
context.add(mainGrid);
//for (Object obj: context) {
//System.out.println(allAgents.get(i));
System.out.println(UtilityFunction.getGlobal('t'));
System.out.println(UtilityFunction.getGlobal('E'));
//System.out.println(UtilityFunction.getGlobal('D'));
//}
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
  //Proces
}




From: Nicholson Collier <[hidden email]>
Sent: Wednesday, October 26, 2016 7:37:15 AM
To: Elham Foruzan
Cc: [hidden email]
Subject: Re: [Repast-interest] Agent Scheduling
 
The score file was from an older version of Simphony. Did you create a projection called “space” in the ContextBuilder?

Nick

On Oct 25, 2016, at 3:52 PM, Elham Foruzan <[hidden email]> wrote:

Nick,

I really appreciate your help. That was one of my problems, thanks for addressing that. Mine was started with capital S instead of small s in the context.xml. However, I have another problem as well. The other error says that: 

caused by: java.lang.RuntimeException: Projection ' space' not found.
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createLayout(AbstractCartesianDisplayCreator.java:57)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:62)

I did define the space in context.xml and in the SmartGridBuilder. Then I can't understand the error. Also, I looked up online and I saw that some people address it to the model score. But I can't find the model score in my repast 2.3.1.


Thank you very much for your go to the point answers. 































------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Tue, Oct 25, 2016 at 8:03 AM, Nick Collier <[hidden email]> wrote:
Elham,

This error can occur if the context id set in the ContextBuilder (i.e., context.setId("smartGrids)) doesn’t match the id in the scenario folder context.xml file (e.g. <context id=“jzombies”).


Nick

On Oct 24, 2016, at 11:11 AM, Elham Foruzan <[hidden email]> wrote:

Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest






------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Agent Scheduling

srcnick
Hmm. That seems correct. There is a “space” in the context.xml too, right? Do you see more than one context in the scenario tree? If so, make sure the display is added to the correct one there.

Nick

On Oct 27, 2016, at 3:07 PM, [hidden email] wrote:

Yes, I did. Please look at my contextBuilder.

package smartGrids;

import repast.simphony.engine.schedule.ScheduledMethod;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;

import repast.simphony.context.Context;
import repast.simphony.context.DefaultContext;
import repast.simphony.context.space.continuous.ContinuousSpaceFactory;
import repast.simphony.context.space.continuous.ContinuousSpaceFactoryFinder;
import repast.simphony.context.space.graph.NetworkBuilder;
import repast.simphony.context.space.grid.GridFactory;
import repast.simphony.context.space.grid.GridFactoryFinder;
import repast.simphony.dataLoader.ContextBuilder;
import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.essentials.RepastEssentials;
import repast.simphony.parameter.Parameters;
import repast.simphony.space.continuous.ContinuousSpace;
import repast.simphony.space.continuous.NdPoint;
import repast.simphony.space.continuous.RandomCartesianAdder;
import repast.simphony.space.grid.Grid;
import repast.simphony.space.grid.GridBuilderParameters;
import repast.simphony.space.grid.SimpleGridAdder;
import repast.simphony.space.grid.WrapAroundBorders;

public class smartGridsBuilder implements ContextBuilder<Object> {
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
GridFactory gridFactory = GridFactoryFinder.createGridFactory(null);
Grid<Object> grid = gridFactory.createGrid("grid",context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), true, 100, 100));
 
 
  ContinuousSpaceFactory spaceFactory = ContinuousSpaceFactoryFinder
.createContinuousSpaceFactory(null);
ContinuousSpace<Object> space = spaceFactory.createContinuousSpace(
"space", context, new RandomCartesianAdder<Object>(),
new repast.simphony.space.continuous.WrapAroundBorders(), 100,
100);
 
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
 Parameters params = RunEnvironment.getInstance().getParameters();
 double SolarVari = (Double) params.getValue("solar_vari");
 double WindVari = (Double) params.getValue("wind_vari");
 double LoadVari = (Double) params.getValue("load_vari");
 double DieselMaximum  = (Double) params.getValue("diesel_Max");
 double DieselRamp  = (Double) params.getValue("diesel_Ramp");
 double DieselcostA  = (Double) params.getValue("diesel_A");
 double DieselcostB  = (Double) params.getValue("diesel_B");
 double storagDecay = (Double) params.getValue("storage_Decaye");
 double storagCapacity = (Double) params.getValue("storage_Capacity");
 double storagvariation = (Double) params.getValue("storage_vari");
   
 SolarPowers.setGeneration(SolarVari);
 WindPowers.setGeneration(WindVari);
 Consumers.setConsumption(LoadVari);
 Diesels.setGeneration(DieselMaximum,DieselRamp );
 Diesels.setExpenses( DieselcostA ,DieselcostB );
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
allAgents.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addBuyers((Collection<? extends Agent>)storage);//adds all the storage units to the list of buyers
ac.addBuyer(mainGrid);
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)storage);//adds all the storage units to the list of buyers
ac.addSeller(mainGrid);
context.add(ac);
context.add(mainGrid);
//for (Object obj: context) {
//System.out.println(allAgents.get(i));
System.out.println(UtilityFunction.getGlobal('t'));
System.out.println(UtilityFunction.getGlobal('E'));
//System.out.println(UtilityFunction.getGlobal('D'));
//}
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
  //Proces
}




From: Nicholson Collier <[hidden email]>
Sent: Wednesday, October 26, 2016 7:37:15 AM
To: Elham Foruzan
Cc: [hidden email]
Subject: Re: [Repast-interest] Agent Scheduling
 
The score file was from an older version of Simphony. Did you create a projection called “space” in the ContextBuilder?

Nick

On Oct 25, 2016, at 3:52 PM, Elham Foruzan <[hidden email]> wrote:

Nick,

I really appreciate your help. That was one of my problems, thanks for addressing that. Mine was started with capital S instead of small s in the context.xml. However, I have another problem as well. The other error says that: 

caused by: java.lang.RuntimeException: Projection ' space' not found.
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createLayout(AbstractCartesianDisplayCreator.java:57)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:62)

I did define the space in context.xml and in the SmartGridBuilder. Then I can't understand the error. Also, I looked up online and I saw that some people address it to the model score. But I can't find the model score in my repast 2.3.1.


Thank you very much for your go to the point answers. 































------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Tue, Oct 25, 2016 at 8:03 AM, Nick Collier <[hidden email]> wrote:
Elham,

This error can occur if the context id set in the ContextBuilder (i.e., context.setId("smartGrids)) doesn’t match the id in the scenario folder context.xml file (e.g. <context id=“jzombies”).


Nick

On Oct 24, 2016, at 11:11 AM, Elham Foruzan <[hidden email]> wrote:

Nick,

Thank you very much for your responses and help. I solved the scheduling problem with the @ScheduledMethod. And my program can run without showing anything on the plots. 
Also, I can't figure out how to solve the second problem which changed to "  Error while creating displays repast.simphony.visualization.engine.DisplayCreationException: Error while creating display."

And the error cause is:

Caused by: java.lang.NullPointerException
at repast.simphony.visualization.DefaultDisplayData.addProjection(DefaultDisplayData.java:60)
at repast.simphony.visualization.engine.AbstractCartesianDisplayCreator.createDisplayData(AbstractCartesianDisplayCreator.java:29)
at repast.simphony.visualization.engine.DisplayCreatorOGL2D.createDisplay(DisplayCreatorOGL2D.java:56)

Here I attached my contextBuilder 



public class smartGridsBuilder implements ContextBuilder<Object> {
ArrayList<Agent> generators=new ArrayList<Agent>();
ArrayList<Agent> consumers = new ArrayList<Agent>();
ArrayList<Agent> solar = new ArrayList<Agent>();
ArrayList<Agent> wind = new ArrayList<Agent>();
ArrayList<Agent> storage = new ArrayList<Agent>();
ArrayList<Agent> allAgents = new ArrayList<Agent>();
ArrayList<Agent> Diesel = new ArrayList<Agent>();
@Override
public Context build ( Context < Object > context ) {
context.setId("smartGrids");
 
 ContinuousSpaceFactory spaceFactory =
 ContinuousSpaceFactoryFinder . createContinuousSpaceFactory ( null );
 
 ContinuousSpace <Object> space =spaceFactory.createContinuousSpace (" space ", context ,
 new RandomCartesianAdder <Object>(),
 new repast.simphony.space.continuous.WrapAroundBorders(),100 ,100);
 
 GridFactory gridFactory = GridFactoryFinder.createGridFactory ( null );
 
 
 Grid<Object> grid =gridFactory.createGrid("grid", context,
new GridBuilderParameters<Object>(new WrapAroundBorders(),
new SimpleGridAdder<Object>(), false, 100, 100));
 
MainGrid mainGrid = new MainGrid(space,grid,.01,1.0);
allAgents.add(mainGrid);
   
int solarCount = (Integer) params.getValue("solar_Count");
for (int i = 0; i < solarCount; i++) {
solar.add(new SolarPowers(space, grid, "Solar "+(i+1)));
generators.add(solar.get(i));
allAgents.add(solar.get(i));
context.add(solar.get(i));
}
  
   
int windCount = (Integer) params.getValue("wind_Count");
for (int i = 0; i < windCount; i++) {
wind.add(new WindPowers(space, grid,"Wind "+(i+1)));
context.add(wind.get(i));
generators.add(wind.get(i));
allAgents.add(wind.get(i));
}
int storageCount = (Integer) params.getValue("storage_Count");
for (int i = 0; i < storageCount; i++) {
storage.add(new GridStorages(space, grid,"Storage "+(i+1),storagCapacity, storagvariation,storagDecay));
allAgents.add(storage.get(i));
context.add(storage.get(i));
}
int dieselCount = (Integer) params.getValue("diesel_Count");
for (int i = 0; i < dieselCount; i++) {
Diesel.add(new Diesels(space, grid,"Diesel"+(i+1),DieselMaximum));
context.add(Diesel.get(i));
generators.add(Diesel.get(i));
}
int consumerCount = (Integer) params.getValue("consumer_Count");
for (int i = 0; i < consumerCount; i++) {
consumers.add(new Consumers(space, grid,"Consumer "+(i+1)));
context.add(consumers.get(i));
allAgents.add(consumers.get(i));
}
            System.out.println("hello Hello");
            
            AuctionMaster ac = new AuctionMaster();
ac.addBuyers((Collection<? extends Agent>)consumers);//adds all the consumers to the list of buyers
ac.addSellers((Collection<? extends Agent>)generators);//adds all the consumers to the list of buyers
context.add(ac);
System.out.println("hello Hello");
for(Object obj: context){
NdPoint pt=space.getLocation(obj);
grid.moveTo(obj, (int)pt.getX(),(int)pt.getY());
System.out.println((int)pt.getX());
}
 if (RunEnvironment.getInstance().isBatch()) {
RunEnvironment.getInstance().endAt(UtilityFunction.getGlobal('E'));
}
 return context ;
 }
}

------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 


On Mon, Oct 24, 2016 at 8:33 AM, Nick Collier <[hidden email]> wrote:
Elham,

If its enough just to execute that bid, auction, trade loop every tick, then create an action or method that executes that loop and schedule that every tick. You could also use the @ScheduledMethod annotation to schedule the loop. If you say more about what objects are involved in the auction and the trading then and how you run those from the objects in your model, I can offer other suggestions.

Re. the error, it sounds like you haven’t set up a project correctly — that is, you aren’t giving it enough dimension. Without the stack trace though its hard to say for sure.

Nick


On Oct 21, 2016, at 11:39 PM, Elham Foruzan <[hidden email]> wrote:


Hello,

I just started working with repast.I need to implement an auction inside the repast. In my implementation, The agent should first submit their bid, then auction runs and then the trades will  happen. I did it very easily in a for loop in JAVA, but I am very confused with the scheduling method in repast. Would you please help me: How should I schedule this three work for each tick in which one be done after the other one. 
Also, I tried to run the program in scenario tree. Even though I set my builder in data loader, it still gives me an error that "too few dimensions specified."
Thank you very much.
------------------------------------------------------------
Elham Foruzan
PhD Student
Department of Electrical and Computer Engineering
University of Nebraska-Lincoln
214.4 B Scott Engineering 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...