I have a functioning model where I want to force a random agent to change state on a varying interval, modeled as a Poisson arrival process. I have set up a global behavior per the FAQ, by including a block in Build() that looks like this (where a and b are externalized in parameters.xml):
ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();
ScheduleParameters arrival = ScheduleParameters.createPoissonProbabilityRepeating(a, b, 1);
schedule.schedule(arrival , this, "arrivalEvent");
Then I have a context method that looks like this:
public void arrivalEvent() {
// stuff
double tick = RunEnvironment.getInstance().getCurrentSchedule().getTickCount();
System.out.println("New arrival on tick: " + tick);
}
This appears to work, except that it appears from the debug text to use the same value for b on all repeats. Is there a way for each repeat to use a new random draw? Or is there another (better) way to achieve this?