[Tutor] Method for 'scheduling' object actions
Bob Gailer
bgailer at alum.rpi.edu
Mon Oct 4 19:03:57 CEST 2004
At 07:09 AM 10/4/2004, gyrof wrote:
>Hi,
>I am designing an application in which several objects need to perform
>certain actions according to the 'time' on a simulated clock. This clock
>has no relationship with the actual system or wall clock time, but will
>proceed from time=0 to time=end_time in some defined increments. Along the
>way, objects need to be triggered to call certain of their methods when
>the time reaches a certain point.
>
>For instance,
>'time' action
>------ ------
> 0 object A.start method is called
> 0 object B.start method is called
> 5 object A.grow method is called
> 6 object B.grow method is called
> 10 object B.pass_info_to_A method is called
> 10 object A.slow_growth method is called
> 12 object A.die method is called
> 20 object B.end method is called
>
>I would like to come up with some sort of flexible and extensible
>scheduler scheme in which these types of actions can take place. I have
>read a bit about SimPy, which is a discrete event simulator, but this
>seems overly complex to me and I'm not even sure if it's appropriate.
Take a look at the sched module.
Bob Gailer
bgailer at alum.rpi.edu
303 442 2625 home
720 938 2625 cell
More information about the Tutor
mailing list