MASON-INTEREST-L Archives

July 2010

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:
Wed, 21 Jul 2010 10:01:56 -0400
MIME-version:
1.0 (Apple Message framework v936)
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Subject:
From:
Sean Luke <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
8bit
Parts/Attachments:
text/plain (74 lines)
Ah no, definitely not a bug.  But certainly a misfeature for you.

If you enter the seed into the GUI's seed text field, you'll get the  
same behavior as running non-gui.  But of course you want to specify  
the seed programmatically.  It's not a bug because in a GUI the user  
expects to be able to set that text field, not have it overridden.

For the moment, you can just comment out that line, and the GUI will  
never change the seed.  But I have to mull over a better approach for  
you which doesn't get weird for GUI users.  There's gotta be a way....

Sean

On Jul 21, 2010, at 1:56 AM, Joerg Hoehne wrote:

> 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