MASON-INTEREST-L Archives

July 2010

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text 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:
Joerg Hoehne <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Wed, 21 Jul 2010 01:56:56 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
On Tue, 20 Jul 2010 09:38:44 -0400, Sean Luke <[log in to unmask]> wrote:

>On Jul 20, 2010, at 3:33 AM, Joerg Hoehne wrote:
>
>> Is there (an intended) different behavior between gui and non gui
>> simulations?
>
>Nope.  They should be absolutely, 100% identical.  So this is
>definitely interesting.  What makes it more interesting is that I
>cannot immediately think of a single thing in MASON proper which could
>possibly cause it.  We go through a lot of hoops to make sure that the
>model code is separate from the GUI code.

I found the bug/feature (but more likely a bug) in the Console.java code:

    void startSimulation()
    {
        removeAllInspectors(true);      // clear inspectors
-->    setRandomNumberGenerator(randomSeed);
        simulation.start();
        updateTime(simulation.state.schedule.getSteps(), 
simulation.state.schedule.time(), -1.0);
        //setTime(simulation.state.schedule.time());
        //setStepsPerSecond(-1.0);  // negative value, guarantees nothing is 
shown



Invoking setRandomNumberGenerator does:

    void setRandomNumberGenerator(final int val)
    {
        doChangeCode(new Runnable()
            {
                public void run()
                {
-->                        simulation.state.setRandom(new 
MersenneTwisterFast(val));
                }
            });


I've checked the id of the MersenneTwisterFast during the simulation and the 
id (hence the object) changed in the GUI version before the first simulation 
step.

Honestly I'd like not to tamper with the code because I do not have a deep 
insight into the logical structure so I'd like to leave it up to you.


Jörg

ATOM RSS1 RSS2