swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] Interrupting a Schedule in Swarm


From: Mervin Chan
Subject: [Swarm-Support] Interrupting a Schedule in Swarm
Date: Thu, 30 Sep 2004 12:11:18 +0800

 

 

 

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!

 

 

 

 

 

 

 

 

 

 

 


reply via email to

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