[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheduling and re-scheduling problems
From: |
William S. Shu |
Subject: |
Re: scheduling and re-scheduling problems |
Date: |
Wed, 01 Sep 1999 16:35:50 +0100 |
"Marcus G. Daniels" wrote:
> >>>>> "WS" == William S Shu <address@hidden> writes:
>
> WS> I implemented the above -- excluding startSchedule, for the time
> WS> being -- and when I call it with: [self scheduleFrom: 10 To: 20
> WS> Behaviour: M(breed)];
>
> FWIW, here's how I'd do it:
Many many thanks Marcus. And also, thanks for the work done in bringing forth
Swarm 2.0
I have implemented your code, more or less wholesale, and created a PeriodSwarm
object for each behaviour I schedule. These can easily proliferate, and so I
try to tidy up, under
stop, as shown in the code below. Unfortunately, I get the following message
when I attempt to drop periodSchedule. It would seem the terminate method did
not quite terminate :-)
(finish).
In effect, how can I ensure resources are returned, when no longer used,
especially self (in this case, self is a PeriodSwarm I created) and all the
objects in it.
In general, who manages activity/schedule objects once they are no longer
needed? If the programmer must do it at any point, could you please indicate
where to get the relevant info
from the docs?
Thanks
William.
--- [gdb output
(gdb) n
*** event raised for error: SourceMessage
*** function: _i_Schedule_c__drop(), file:
/src/swarm-1.4.1/src/activity/CompoundAction.m, line: 215
> cannot drop action plan still referenced by an uncompleted activity
*** execution terminating due to error
warning: cygwin: signal 6
Program exited with code 03000.
(gdb)
---[ code
- (id) stop { // stop bhv (the scheduled activity)
// printf ("Stopping: %lu\n", getCurrentTime ());
[periodActivity terminate];
// release resources
[periodSchedule drop]; // <==== *** error given here ****
[periodActivity drop];
periodSchedule = nil; // ensure no later use
periodActivity = nil;
[self drop]; //drop self
return nil;
// return self;
}
==================================
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.
- Re: scheduling and re-scheduling problems,
William S. Shu <=