From: Nick C. <nic...@gm...> - 2009-04-14 12:59:50
|
Tomas, I think you'll have to schedule manually if the priority is not known until runtime. Note that if shuffle is true then that just means the collection of agents is shuffled before execution, that is, we shuffle the collection and then iterate through them calling the scheduled method. See, http://repast.sourceforge.net/docs/reference/SIM/Working%20with%20the%20scheduler.html for some info on scheduling manually. You'd typically do this in your Context builder. Nick On Apr 13, 2009, at 1:39 PM, Tomáš Kubiš wrote: > Hi, > I would like to ask a question regarding priorites of scheduled > methods. In my context I created agents and want them to run their > step method one after another in the same order over and over. So I > wanted to set their priorities equal to their id in this manner: > Agent with id = 0 has priority 0 > Agent with id = 1 has priority 1 > The problem is that priority paramter in the annotation > @ScheduledMethod has to be initialized with a static constant (static > final). So it follows that it should be a common value for all > instances of my agent class and I cannot find a way how to overcome > this restriction. I want different instances to have different > priorities which correspond to their unique id variable. > Is it sufficient to set the shuffle parameter to false? Are the agents > running their methods concurrently or sequentially in this case? > I am thankful for any suggestions. > Greetings, > Tomas > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest |