swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Interrupting a Schedule in Swarm


From: Paul Johnson
Subject: Re: [Swarm-Support] Interrupting a Schedule in Swarm
Date: Thu, 30 Sep 2004 13:26:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

Dynamic Scheduling!

http://lark.cc.ku.edu/~pauljohn/Swarm/MySwarmCode/Dancer/Dancer-1.0-Swarm2.1.140.tar.gz

This app is objective C, about ballet dancing. The dancers schedule themselves to take steps that last a certain number of steps (each dancer's number of timesteps per move can be different), and when the dance step is finished, a dancer plans a new step. When they plan the new step, they canvas the situation and avoid collissions with other dancers.

It seems to me that you could use a paradigm like that. Let agents schedule themselves. In each actor's step method, they check for an emergency, and if they do, they take some action or not, and then reshedule themselve to step a certian number of timesteps in the future.

pj

Mervin Chan wrote:
Hi everyone,

I have a problem with Java Swarm. I understand that in Swarm, I define firstly an action, and thereafter, insert it into a schedule, like so:

FCall SomeAction{

}

.

.

modelSchedule = new ScheduleImpl(this, 5);

modelSchedule.at$createFAction(0, SomeAction ());

As such, the action will be repeated every 3 time-steps in my simulation.

My problem/Question is this:

Is there a way to “interrupt” the action that I have inserted in the schedule. For instance, I have a FACTORY that does a “produce” action every 4 timesteps. I want to create an “emergency” action that will interrupt the factory’s schedule (at random), to make the factory service “interrupt” before continuing its normal schedule, like so:

Time 1: Factory Produce (Every 4 time steps)

Time 2: Factory Do nothing

Time 3: Factory Do nothing

Time 4: Factory Do nothing

Time 5: Factory Produce

Time 4:  ß------ Emergency. Factory services interrupt (takes 2 timestamps)

Time 5: Servicing interrupt

Time 6: Factory Do nothing (Back to normal Schedule)

Time 7: Factory Produce

I understand that actions have to be predefined in the schedule, and it cannot be dynamically changed /interrupted when the simulation starts? Is it true? Thanks!


------------------------------------------------------------------------

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700


reply via email to

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