swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic scheduling question, again.


From: Geoffrey Schultz
Subject: Dynamic scheduling question, again.
Date: Fri, 6 Feb 1998 15:29:40 -0500 (EST)

Hi,

I previously posted a question about adding an action to a schedule in
response to a pressing a probe button.  I thought that the problem may be
specific to the model that I'm developing, however it seems to be more
general, as with small modification to the mousetrap model the problem can
be reproduced.

If the source for the mousetrap model is modified so that the initial ball
is not scheduled to be thrown in the "buildActions" method but is
thrown in response to a mousepress on a probe that calls a method that
throws the ball in ... the action is never executed.


in the +createBegin method add a probe:

[probeMap addProbe: [probeLibrary getProbeForMessage: "throwFirst"
                 inClass: [self class]]];

create a throwFirst method

-throwFirst{
 timeval_t now;
 now=getCurrentTime();
 [self scheduleTriggerAt: now+20 For: [grid getObjectAtX: gridSize/2
                                      Y: gridSize/2]];
 [stats addOneBall];
 return self;
}


remove the relevant code from the -buildActions method

finally remove the line of code in the MousetrapObserverSwarm.m that will
stop the model when all the balls have landed.


Now, compile, and run...clicking the mousebutton "throwfirst" will show as
an increase in pending actions, but the action will never be executed.


Any insight into this would be greatly appreciated.


Thanks,


Geoff Schultz


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]