MASON-INTEREST-L Archives

October 2004

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Rob Alexander <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 5 Oct 2004 13:55:47 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Tony Bigbee wrote:
> Is there a recommended way to dynamically remove specific Steppable
> objects from the schedule?

I've been doing:

entity.setStoppable( schedule.scheduleRepeating(entity) );

...which then allows me to do.....

        if( this.stoppable != null )
{
      this.stoppable.stop();
}

(you'll need to define stoppable and setStoppable() in your entity class)

I had a quick look at the Mason scheduler code, but couldn't figure out
whether this truly takes the entity off the schedule (and, hence,
whether its any more efficient than your current approach). I'll have
another look when I have time (if Sean doesn't provide a better answer
in the mean time, of course).


yours,
rob

--
Rob Alexander                   (E-mail: [log in to unmask])
Research Associate, Dept of Computer Science, The University of York,
York, YO10 5DD, UK
Tel: 01904 432792       Fax: 01904 432708

ATOM RSS1 RSS2