swarm-support
[Top][All Lists]
Advanced

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

problem with scheduler


From: Benoit Desrosiers
Subject: problem with scheduler
Date: Thu, 15 May 1997 15:19:46 -0400


Hi, I have a problem with the logic of the schedule.

I want to simulate a system where at time t there is 2 agents in
a grid that attack one of their neighboors. At time t+1, 2 other
 randomly selected agents will do the same thing. This simulation
would run for a given number of iteration (say 100) 

I tought of modifying the mousetrap application to do it by adding to the
mouseTrapModel a method call selectAttaquant. This method would select two
agent in the grid and call 
[-scheduleTriggerAt: (int) n For: (Agent *) trap]
to put an action (attack)  in the mouseTrapModel modelSchedule. Now the tricky 
part
is to put the selectTwoAgent in a Schedule so it would be called at every
iterations. I decided to put it in the mouseTrapObserver in the displayActions
ActionGroup 
[displayActions createActionTo: agentModelSwarm     message: M(selectAttaquant)]

It work for the selectAttaquant (it is called at every iteration) but the 
problem is that the action on the agent (attack) is not executed. 

If I let the original 
[self scheduleTriggerAt: 0 For: [grid getObjectAtX: gridSize/2 Y: gridSize/2]];
in the AgentModelSwarm>>buildActions method, the action from this list are
executed. (I changed the trigger method for the attack method)


What is wrong? It is probably because the selectAttaquant is called not at
the wright moment in the schedule, but I don't understand how the different 
schedule interfer with one another.

If I understand well, the agentModelSwarm>>modelSchedule is execute and
then the displaySchedule is run. 


thanks for your help, I'm a little bit confuse here.

Benoit






                  ==================================
   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]