LISTSERV mailing list manager LISTSERV 16.0

Help for MASON-INTEREST-L Archives


MASON-INTEREST-L Archives

MASON-INTEREST-L Archives


MASON-INTEREST-L@LISTSERV.GMU.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

MASON-INTEREST-L Home

MASON-INTEREST-L Home

MASON-INTEREST-L  September 2012

MASON-INTEREST-L September 2012

Subject:

Re: Turning off Mason output?

From:

Sean Luke <[log in to unmask]>

Reply-To:

MASON Multiagent Simulation Toolkit <[log in to unmask]>

Date:

Wed, 26 Sep 2012 16:46:04 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (185 lines)

MASON doesn't pump out enough unique messages to justify logging (unlike, say, ECJ).  Which is just as well since Sun's default logging package is amazingly bad.

Okay, here's what I've posted to SVN.  

1. I made sure that all of the MASON core prints out errors and warnings via System.err so they're easy to redirect.

2. Warnings are almost always preceded with "WARNING" (all caps) to make them easily removable via grep -v.

3. I added a -quiet option to doLoop.  If you say this:

	java sim.app.heatbugs.HeatBugs -quiet

... then it will suppress all doLoop messages.  This generally should make MASON 100% silent unless you did something which necessitated a warning or error (both things you oughta know about).

Sean



On Sep 26, 2012, at 4:03 PM, Richard O. Legendi wrote:

> Hi Sean,
> 
> Cool, thanks for the help and for the info!
> 
> I'm a bit unsure if redirecting the output of the whole Java process is a good idea, all the stack traces and error messages are printed there if anything special happens, so it would make investigating an issue impossible.
> 
> What I think could be useful here is some sort of logging facility. If one can set the logging level it would be easy to turn on and off these kind of messages. There is even a built-in API for that in Java since 1.4 or so, so it wouldn't introduce any new dependencies. Or is it a silly idea?
> 
> Best regards,
> Richard
> 
> --
> Richard O. Legendi
> Software developer
> Intelligent Applications and Web Services
> AITIA International, Inc.
> http://people.inf.elte.hu/legendi/
> 
> On 2012.09.26. 21:47, Sean Luke wrote:
>> So I can certainly add a gizmo which prevents SimState from printing out the startup message and jobs messages.  But it's a bit more challenging to turn off printing for all of MASON, since it includes a lot of utility classes which print out occasional warnings.
>> 
>> However I *can* (and just did) modify the MASON core code so that System.out is never used, only System.err.  This would allow you to redirect all messages to System.err to go straight to /dev/null, like this (using bash):
>> 
>> 	java sim.app.heatbugs.HeatBugs 2> /dev/null
>> 
>> Anything you print with System.out.println() will still show up on-screen.  But System.err.println() will go to /dev/null silently.
>> 
>> Alternatively of course you can just not use doLoop(), which is a convenience function.  The manual, and initial tutorials, show how to do your own loop.
>> 
>> On Sep 26, 2012, at 1:01 PM, Richard O. Legendi wrote:
>> 
>>> Hi Chris,
>>> 
>>> Well, not exactly. I'm searching for some magic option that turns off all output of a Mason simulation (i.e., all the log messages it prints out to the console). I'm running some tests which involves running a few mini-models that dumps the whole output of the console log of the CI system I use for nightly builds.
>>> 
>>> For paramsweep there is a nice tool called MEME that supports several platforms (like Repast J, NetLogo or custom Java simulations) which conveniently replaces all custom solutions you described. You can set up the param tree with a few clicks, there is a (by default in-memory) database to store the results, you can split or aggregate them on the GUI (it is also scriptable), you can have a look instantly on the data through several charts, etc.
>>> 
>>> Take a look: http://mass.aitia.ai/screenshots/73-meme-screenshots?showall=1
>>> 
>>> Anyway, thanks for the note.
>>> 
>>> Best,
>>> Richard
>>> 
>>> --
>>> Richard O. Legendi
>>> Software developer
>>> Intelligent Applications and Web Services
>>> AITIA International, Inc.
>>> http://people.inf.elte.hu/legendi/
>>> 
>>> On 2012.09.26. 18:46, Chris Hollander wrote:
>>>> If I understand what you're asking right, the simulation loop that
>>>> normally gets used is simple enough to rewrite yourself. For the work
>>>> that I do I actually have Scala scripts that automate the simulation
>>>> runs so that I can do multiple experiments and replications and
>>>> collect additional data. They make use of an "Experiment" class I
>>>> wrote.
>>>> 
>>>> Here the code for my experiment class and run loop. It's based on my
>>>> needs though, but there's no reason you couldn't add in debugging
>>>> information to pull information from the actual simulation.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> public void run(MersenneTwisterFast seedGenerator, int[][]
>>>> experiments, int replications, long maxRuntime) {
>>>> 
>>>>         String experimentID;
>>>> 
>>>>         for (int e = 0; e < experiments.length; e++) {
>>>> 
>>>>             // We store the id as a binary number so its easier to
>>>> match up configurations with
>>>>             // MINITAB experiment ordering. All we have to do is
>>>> translate the binary number to
>>>>             // a decimal number and match. This is much less error
>>>> prone than using raw binary.
>>>>             experimentID =
>>>> Functions.padBinary(this.getExperimentID(experiments[e]), 6);
>>>> 
>>>> 
>>>>             // For each replication
>>>>             long seed;
>>>>             long step;
>>>>             long startTime;
>>>>             long stopTime;
>>>> 
>>>>             long maxTime;
>>>> 
>>>>             for (int i = 0; i < replications; i++) {
>>>>                 System.out.print("Processing replication " + (i + 1) +
>>>> " on experiment configuration ");
>>>>                 System.out.println(experimentID);
>>>> 
>>>>                 seed = seedGenerator.nextLong();
>>>>                 Simulation simObject = new Simulation(seed);
>>>>                 simObject.nameThread();
>>>>                 simObject.random = seedGenerator;
>>>> 
>>>>                 //simObject.setSeed(seed);
>>>>                 //simObject.setUserSeed(true);
>>>> 
>>>>                 // Configure specific experimental settings
>>>>                 ics.configureSimulation(simObject, experiments, e);
>>>>                 simObject.outputFileId = experimentID + "_" + i + "_data";
>>>> 
>>>>                 // Adjust max run time to account for the stability tolerance
>>>>                 maxTime = maxRuntime;
>>>> 
>>>>                 // Run the experiment
>>>>                 startTime = System.nanoTime();
>>>> 
>>>>                 simObject.setJob(i);
>>>>                 simObject.start();
>>>> 
>>>>                 while ((step = (long) simObject.schedule.getSteps())
>>>> <= maxTime) {
>>>>                     if (!simObject.schedule.step(simObject)) {
>>>>                         break;
>>>>                     }
>>>>                     if (step % 1000 == 0) {
>>>>                         System.out.println("Time Step (in Experiment):
>>>> " + step);
>>>>                     }
>>>>                 }
>>>> 
>>>>                 simObject.finish();
>>>>                 stopTime = System.nanoTime();
>>>> 
>>>>                 // Calculate the total runtime of the experiment in seconds
>>>>                 double runtime = (double) (stopTime - startTime) / 1000000000.0;
>>>> 
>>>>                 System.out.println("Replication " + (i + 1) + " of
>>>> Experiment " + experimentID + " ended after " + runtime + " seconds");
>>>>             } // end replication loop
>>>>         } // end experiment loop
>>>> 
>>>>     }
>>>> 
>>>> 
>>>> 
>>>> On Wed, Sep 26, 2012 at 8:54 AM, Richard O. Legendi <[log in to unmask]> wrote:
>>>>> Just a minor question: is it possible to turn off Mason's output(*)? It
>>>>> makes it a bit hard to find an issue in tests where a modell is running in
>>>>> the background.
>>>>> 
>>>>> Thanks in advance!
>>>>> 
>>>>> (*) =
>>>>> MASON Version 16.  For further options, try adding ' -help' at end.
>>>>>     Job: 0 Seed: 15
>>>>>     Starting ...
>>>>> 
>>>>> Best,
>>>>> Richard
>>>>> 
>>>>> --
>>>>> Richard O. Legendi
>>>>> Software developer
>>>>> Intelligent Applications and Web Services
>>>>> AITIA International, Inc.
>>>>> http://people.inf.elte.hu/legendi/

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

May 2021
April 2021
March 2021
February 2021
August 2020
July 2020
June 2020
February 2020
August 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
October 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
September 2017
June 2017
May 2017
March 2017
February 2017
January 2017
December 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
February 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
July 2004
May 2004
April 2004
March 2004

ATOM RSS1 RSS2



LISTSERV.GMU.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager