MASON-INTEREST-L Archives

August 2013

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced 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:
Aуdar Aliev <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 15 Aug 2013 14:32:35 +1200
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (1113 bytes) , text/html (1630 bytes)
Thanks Sean, I've just came up with this and wanted to update my post.
What I did is I specified a Stoppable stopme variable within agent. And
assigned schedule.scheduleRepeating(agent) to it. This way it works.

Best,

Aydar


On Thu, Aug 15, 2013 at 2:24 PM, Sean Luke <[log in to unmask]> wrote:

> On Aug 14, 2013, at 7:55 PM, Aуdar Aliev wrote:
>
> > The problem is that I need to remove an agent from the schedule (I
> presume that after removing it from the schedule garbage collector will get
> to it) when his internal condition becomes true. For example, when agent
> stepped more than 50 times. How do I do that?
>
> When you schedule an agent repeating, the scheduleRepeating() method
> returns a Stoppable object.  Store that Stoppable somewhere (perhaps in the
> agent itself), and call it when the condition has become true.  The agent
> will then not be rescheduled any more.  You don't need to implement the
> Stoppable interface.
>
> You can also do this if you have scheduled an agent once but may wish to
> prevent his upcoming step() from ever occurring: this is done by using
> TentativeStep (see the manual).
>
> Sean
>


ATOM RSS1 RSS2