swarm-support
[Top][All Lists]
Advanced

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

schedules


From: Doug Donalson;
Subject: schedules
Date: Sat, 22 Mar 1997 13:51:29 -0800 (PST)

Roger,

   I am running into an error trying to remove an event from
an autodrop/concurrent group schedule.  You wrote:

Yes.  One of the fixes in Swarm 1.0.0 was to make sure that removing
actions from a schedule worked correctly.  Remember that a schedule is
just a map, and an action is a member of the Map indexed by the (timeval_t)
key value.  But either a schedule or an action group also supports the
behavior of a Set consisting of all its actions.  So for any action
contained in a schedule, you can now remove it using the standard Set
remove: message:

- remove: aMember;

So you can remove the action from a schedule using:

removedAction = [aSchedule remove: anAction];

Note that the action must already belong to the schedule for this to work
correctly.  remove: from a schedule automatically takes care of removing
the action either from the schedule itself or from a concurrent group
contained at a single time value of the schedule.  If an action belongs
to a concurrent group of a schedule, you should it remove it from the 
schedule,
not from the concurrent group directly.

The removed action could actually be kept around and reinserted into the
schedule at some other time, but there are not yet any guarantees about
alternate ways of scheduling an action (anything besides a standard
createAction message) working in all circumstances.  So for now, you
should just drop any actions you remove, and schedule new ones whenever
you need them.  So also code the statement:

[removedAction drop];

I coded this as: [[eventSchedule remove: eventId] drop];

where eventId is the id returned from create action.

This is what I get in response:

*** event raised for error: SourceMessage
*** function: _i_ConcurrentSchedule_c__remove_(), file: Schedule.m, line: 619
> A concurrent schedule requires either that a subclass override the method
> that removes an action, or that all actions be removed from the group by
> an explicit operation using the key of an action in the schedule.
*** execution terminating due to error
IOT trap (core dumped)

What am I doing wrong??

Cheers,

   Doug Donalson
***************************************************************************
* Doug Donalson                          * Office: (805) 893-2962         *
* Ecology, Evolution, and Marine Biology * Home:   (805) 961-4447         *
* UC Santa Barbara                       * email address@hidden
* Santa Barbara Ca. 93106                *                                *
***************************************************************************
*                                                                         *
*   The most exciting phrase to hear in science, the one that             *
*   hearlds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************





reply via email to

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