swarm-support
[Top][All Lists]
Advanced

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

Re: Displaying before running: failure


From: Roger M. Burkhart
Subject: Re: Displaying before running: failure
Date: Sat, 12 Jul 1997 20:38:18 -0500

Sven Thommasen asks:

> *** --> I am assuming that actions and action groups will get executed in
> the order they are *activated*. Is this correct, Roger ?

Yes, this is the uniform rule we established for all cases in which actions
were scheduled at the same time step.  A swarm sets up the activation
of any schedule to follow the activations of any schedules already active.
Even at subsequent timesteps, this initial activation order is preserved,
so it's not merely whichever schedule gets to a timestep first; they
contine to get ordered in that order of original activation.

(This is a significant internal use of the "Concurrent Group" apparatus
that can be used to control interpretation of otherwise concurrent actions.
The default concurrent group for a swarm is called "ActivationOrder," but if
somebody eventually wants something else, it's possible to override this
default.  The default was designed to give reliably deterministic default
ordering for cases such as display actions, so that they could be counted
on to always come before or after any model actions, according to the order
of their activations.)

What this means is that if you want to schedule some action before anything
else occurs (which I think was Nelson's orginal question), you should put
it as the first thing in a schedule that gets activated before anything
else in its owner swarm.

Note that these rules apply only within a particular swarm.  If a subswarm
is activated in another swarm, that entire subswarm is activated only when
its own turn comes according to its activation order.  If you want something
in that subswarm to go first, then you'd have to make sure the subswarm is
activated in its owner swarm before anything else.

> I then had this brainstorm: leave the display schedules as is, but go into
> the model swarm and agent swarms and make their actions start at t=1 ! And
> ran smack up against what Nelson mentions. The error message is:
> 
> *** event raised for error: InvalidArgument
> *** function: _activity_insertAction(), file: Schedule.m, line: 201
> > Cannot insert action at time greater than or equal to repeat interval
> *** execution terminating
> (core dump)
> 
> So, another question for Roger: why is this limitation there? From a user's
> perspective, it seems pretty arbitrary. If I want to schedule an action to
> start at t=20 with repeat interval 3, why can't I?

It's the interpretation of time value within a repeating schedule.  For a
repeating schedule (one specified with a repeat interval), all the time
values are relative to the start of the interval; that remains true after
a rollover of the interval to a new cyclical starting point.  The interval
itself can start whenever you want; you could schedule an action to start the
repeating cycle at some absolute time in another schedule.  I'd also like
to have a little more direct way to schedule a single action in a swarm
at some eventual time, but right now you've got to have a separate schedule
with an absolute timebase (the default when there's no repeat interval) to
hold such an action.

The repeating schedule only checks whether to roll over into a new cycle
once it has reached the end of currently scheduled actions.  This method
only works if the schedule knows that no actions past that threshhold can
be present.

If you want to schedule an action at a time relative to an activation,
just make sure the repeat interval is large enough to contain it, or
create a schedule with the "RelativeTime" option set but no repeat
interval.  Remember that you can create and activate as many schedules
as you want with absolute, relative, or repeating time bases and merge
them all together in the same swarm.  Don't assume that one schedule
has to do whatever scheduled actions you want to do; create as many
specialized ones as you need and start them all running together.

Glad to see your subsequent success.  Creating the separate schedule
that got activated first is exactly the right approach if you want
to make sure something happens before anything else.

--Roger


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