On Jul 19, 2012, at 11:43 AM, Chris Hollander wrote:
> For the simulation I am current working on, we need to schedule agents
> to act based on certain probability distributions (in particular,
> exponential)... Now, I know that I can do this manually by repeatedly
> calling scheduleOnce, or make a wrapper agent to execute an action N ~
> Poi(L) times each step, but I was wondering if it might be possible in
> a future release to get a schedule method that takes in a distribution
> (based off the CERN libraries, maybe) and reschedules the associated
> agent based on that.
I think it should be very easy to make a utility Steppable wrapper (like Sequence or TentativeStep) which does this automatically for you, and would be useful too. I do *not* think it should be a method in the Schedule: only prosaic things should go there.
There's a few gotchas. First, this would be the first time that a MASON core class would rely on the distributions package, and I cannot guarantee that CERN's code was right. Second, CERN's code has an unfortunate misfeature: some of the distributions are function calls, and others are classes. This makes it problematic to create a consistent API in which someone could plug in any distribution they saw fit. Maybe by overriding a method, though that's an ugly approach.