MASON-INTEREST-L Archives

October 2004

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 5 Oct 2004 13:55:47 +0100
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Content-Transfer-Encoding:
7bit
Subject:
From:
Rob Alexander <[log in to unmask]>
Content-Type:
text/plain; charset=us-ascii; format=flowed
In-Reply-To:
MIME-Version:
1.0
Comments:
To: MASON Multiagent Simulation Toolkit <[log in to unmask]>
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