MASON-INTEREST-L Archives

April 2013

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

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

Print Reply
Content-Type:
multipart/alternative; boundary=20cf301cbe0a1942b504da065056
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
Luís de Sousa <[log in to unmask]>
Date:
Wed, 10 Apr 2013 21:02:35 +0200
In-Reply-To:
MIME-Version:
1.0
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (1381 bytes) , text/html (2215 bytes)
Mark and Sean, thanks for the replies.

This solves things at run time, but agents left over from previous runs are
still portrayed in subsequent runs (in the little example I sent you can
try hitting the stop button before it gets to setp 20 and then restart).

I imagine the updateSpatialIndex() method or something else that
permanently destroys the Stoppable objects must be invoked when the run
ends. I tried to do it in the GUIState class but without success. There
doesn't seem to exist any way in the Scheduler class to set something to
run at simulation end either. How else can I do it?

Thank you,

Luís




On 9 April 2013 04:19, Sean Luke <[log in to unmask]> wrote:

> On Apr 8, 2013, at 10:05 PM, Mark Coletti wrote:
>
> > In other words, I think I resolved your problem by adding the following
> to your Sim.start():
> >
> >         schedule.scheduleRepeating(new Steppable()
> >         {
> >             public void step(SimState state)
> >             {
> >                 trailSpace.updateSpatialIndex();
> >             }
> >
> >         });
>
> Quick suggested improvement:
>
>
> >         schedule.scheduleRepeating(new Steppable()
> >         {
> >             public void step(SimState state)
> >             {
> >                 trailSpace.updateSpatialIndex();
> >             }
> >
> >         }, -1, 1);
>
> This will cause updateSpatialIndex() to happen before anything else each
> timestep.
>
> Sean
>


ATOM RSS1 RSS2