[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dropping or cleaning a schedule
From: |
Rob Kewley |
Subject: |
Re: Dropping or cleaning a schedule |
Date: |
Thu, 26 Jun 1997 16:40:28 -0300 |
I am still having some trouble with a dynamic schedule in my model. I
can work around it, but something inside me wants to understand how
schedules and activities work and why I get this error. If my model's
dynamic schedule reaches its end and has no more activities left on it,
I cannot reactivate that schedule for another iteration after adding the
initial activities to it. This only works if I stop the schedule while
I still have activities on it. Why is this? Here is the text of the
error message I got.
Phish:~/swarm/battle$ battle
*** event raised for error: InvalidOperation
*** function: _i_Zone_c__freeIVarsComponent_(), file: Zone.m, line: 245
> object being freed by freeIVarsComponent: (0x82d3648: ActionChanged_c)
> was not allocated by allocIVarsComponent: or copyIVarsComponent:
*** execution terminating due to error
IOT trap/Abort (core dumped)
Something happens when a schedule reaches its last action (note: this is
not a repeating schedule) that will not allow me to reactivate it. I
tried to trace this error through the swarm source code but became
hopelessly confused.
Roger M. Burkhart wrote:
>
> Rob -- glad to hear you found what was causing your crash before; it does
> make sense that cleaning up a schedule could cause a still-unterminated
> activity to crash, and by terminating the activity first you were able
> to get the cleanup to work. There's no user accessible way to find out
> what activities are currently processing a schedule (the same schedule
> could potentially be traversed by many different activities in many
> different places) but we may at least be able to generate some better
> messages when a schedule is cleaned out from underneath a remaining
> activity.
>
> On your question about terminating within a model swarm:
>
> > This solves my problem. However, I would ideally like to control the
> > termination of the schedule activity from a message invoked in the
> > observer swarm. However, the message:
> > [getCurrentScheduleActivity() terminate];
> > will not work because the observer swarm messages are activated by an
> > activity executing a display schedule in the observer swarm. Is there a
> > way for a schedule object to reveal the activities controlling it. I
> > could then send a terminate to those activities from the observer
> > swarm. Also, I seem to have trouble reactivating a schedule in the
> > modelswarm from the observer swarm. Is there a way to do this? Or do I
> > have to always do it from the model swarm.
>
> When you activate a schedule inside a swarm ([aSchedule activateIn: aSwarm])
> the return value from activateIn: is the activity that was created. If
> you save this object id value someplace you should be able to send
> terminate to that activity later on. You can't get the activity directly
> from the schedule, but as long you save the activity that was created you
> can still send messages to it.
>
> On reactivating a schedule inside the model swarm, you should be able to
> activate the schedule from pretty much any place so long as you have the id
> of the swarm you want to activate it within. I've done it even from a main
> program when the observer swarm wasn't running either. So I'm not
> sure why there would be a problem; you might try just executing a scheduled
> action in the observer swarm that just activates a simple schedule in the
> model swarm that maybe prints some debug messages. Make sure when you
> schedule in the model swarm it's at a time that is at least as great as the
> current time.
> --
> Roger Burkhart
>
> ==================================
> 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.
> ==================================
==================================
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.
==================================