swarm-support
[Top][All Lists]
Advanced

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

Re: [Q] Noddy scheduling question


From: Ken Cline
Subject: Re: [Q] Noddy scheduling question
Date: Tue, 6 Jul 1999 08:07:09 -0400 (EDT)

On Tue, 6 Jul 1999, Gary Polhill wrote:
> 
> I have a schedule with a set of initial actions (to take
> place once, at the beginning of the sim) and a set of
> actions to be repeated on a cycle by cycle basis, and I
> just wanted to check that I haven't missed something
> obvious. I have implemented this using two separate
> schedules, one for the initial action group, and one for
> the main action group.
> 
>   // Initial actions
> 
>   initialSchedule = [Schedule createBegin: self];
>   initialSchedule = [initialSchedule createEnd];
>   [initialSchedule at: 0 createAction: initialActions];
> 
>   // Main (repeated) actions
> 
>   modelSchedule = [Schedule createBegin: self];
>   [modelSchedule setRepeatInterval: 2];
>   modelSchedule = [modelSchedule createEnd];
>   [modelSchedule at: 1 createAction: modelActions];
> 
> Note that the repeat interval for modelSchedule is 2.
> When I set it to 1, I got the error message "cannot insert
> action at time greater than or equal to repeat interval"
> -- which struck me as being an odd constraint. Is there
> something inherently wrong with wanting to start something
> at time 10, say, that will then repeat each time slot?

I think this, somewhat hidden, tidbit from the reference
manual might answer your question:
  "The RepeatInterval option [...] overrides the normal
   default that times are considered absolute, as if the
   RelativeTime option had also been specified at the same
   time. All scheduled times must be less than the specified
   repeat interval, or an error will be raised. ..."

> More to the point, is there a better way to implement a
> schedule with an initial set of actions followed by a
> repeating set of actions than the way I've outlined above?
> One that, perhaps, has a repeat interval of 1?
> 
> Or perhaps there are philosophical/moral objections to
> such schedules?

As the saying goes: "If it works then ..."

I'm not an expert on the swarm scheduling mechanisms, but
I'll make a suggestion:  You could schedule the start of the
repeating schedule on the non-repeating schedule, I think
this is possible now.  As you can guess from my tone, I've
never tried it.  On a previous model, I had a design similar
to yours; however, in that case I wanted the repeating
schedule to start at (absolute) time 0 which makes things
easier.  Also, I believe that schedules will be executed in
the order they are activated, so that might help you
simplify your design.

Hope that helps.

Ken.

> (Noddy, btw, is a sort of English Mickey Mouse.)

You have giant rats in England too?


_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427




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