LISTSERV mailing list manager LISTSERV 16.0

Help for ECJ-INTEREST-L Archives


ECJ-INTEREST-L Archives

ECJ-INTEREST-L Archives


ECJ-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

ECJ-INTEREST-L Home

ECJ-INTEREST-L Home

ECJ-INTEREST-L  March 2004

ECJ-INTEREST-L March 2004

Subject:

Re: Question about Threads and Statistics

From:

Liviu Panait <[log in to unmask]>

Reply-To:

ECJ Evolutionary Computation Toolkit <[log in to unmask]>

Date:

Fri, 26 Mar 2004 09:59:53 -0500

Content-Type:

TEXT/PLAIN

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (97 lines)

Alex,

If I understand correctly, you want to have some graphic interface that
displays the best-so-far individual while ECJ runs.  From what you
describe, I understand you try to create this in the postEvaluation
function.

Personally, I this is how I would approach this issue (and probably your
approach is very close as well): I would instantiate the graphics thread
in the statistics' setup function, such a way that it is created only once
per run.  The graphics should deepClone() the best-so-far individual, as
it is possibly to be destroyed soon by the breeding operations in the next
generation.  In the postEvaluation() method, I would tell the graphics
thread to update the information on the best-so-far, and I would wait for
it to deepClone() the best-so-far individual.

Is it possible that you do not wait for it to copy, and the evolution goes
further and the individual is modified while you try to display it? That
may cause some problems....

Also, if you want to block the statistics thread, you can extend the
statistics class and override the postEvaluation statistics.  It could
look like this:

public void postEvaluationStatistics(final EvolutionState state)
{
    // call the super's method to do the actual statistics
    super.postEvaluationStatistics(state);

    // tell the graphics interface to start displaying the new individual.
    // if you extend SimpleStatistics, you have the best_of_run vector
    // available.
    displayIndividual( best_of_run[0].deepClone() );

    // at this point I do not think you actually need to wait for
    // anything, because you deepClone()-d the information you needed for
    // the other thread.  But anyway, if you want to stop the
    // statistics thread for some time, this is the place.
}

Hope this works.

Regards,

Liviu.

On Fri, 26 Mar 2004, Alexandre Sauve wrote:

> Hi,
>
> Well I am trying to do something a little interesting.  I want to
> display a graphic with a demonstration of my latest GP tree built.  The
> demonstration is to visualize how the GP is learning through iterations,
> but I am having some trouble creating my dialog in the postEvaluation
> section of the statistics... Below is the stack trace that I receive...
>
> AWT blocker activation interrupted:
> java.lang.InterruptedException
>     at java.lang.Object.wait(Native Method)
>     at java.lang.Object.wait(Unknown Source)
>     at sun.awt.AWTAutoShutdown.activateBlockerThread(Unknown Source)
>     at sun.awt.AWTAutoShutdown.setToolkitBusy(Unknown Source)
>     at sun.awt.AWTAutoShutdown.notifyToolkitThreadBusy(Unknown Source)
>     at sun.awt.windows.WToolkit.<init>(Unknown Source)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
>     at java.lang.reflect.Constructor.newInstance(Unknown Source)
>     at java.lang.Class.newInstance0(Unknown Source)
>     at java.lang.Class.newInstance(Unknown Source)
>     at java.awt.Toolkit$2.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.awt.Toolkit.getDefaultToolkit(Unknown Source)
>     at java.awt.Window.getToolkit(Unknown Source)
>     at java.awt.Window.init(Unknown Source)
>     at java.awt.Window.<init>(Unknown Source)
>     at java.awt.Frame.<init>(Unknown Source)
>     at java.awt.Frame.<init>(Unknown Source)
>     at javax.swing.SwingUtilities$1.<init>(Unknown Source)
>     at javax.swing.SwingUtilities.getSharedOwnerFrame(Unknown Source)
>     at javax.swing.JDialog.<init>(Unknown Source)
>     at javax.swing.JDialog.<init>(Unknown Source)
>     at javax.swing.JDialog.<init>(Unknown Source)
>     at ant.gui.AntDialog.<init>(AntDialog.java:90)
>     at ant.gui.GPGuiRunner.run(GPGuiRunner.java:14)
>
> the GPGuiRunner is simply a wrapper thread class.  I thought that it
> would be less affected if running within its own thread, but it seems
> that the thread that is responsible for the statistics output cannot be
> blocked (always immediately results in a InterruptException)... I have
> tried to find out why this is so, but so far to little avail... I need
> to know how to do this ASAP unfortunately, as the assignment is due
> early next week... Thanks... And by the way great tool you have developed!!!
>
> ALex
>

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

September 2019
August 2019
June 2019
April 2019
March 2019
January 2019
December 2018
November 2018
October 2018
July 2018
May 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 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
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 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
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
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 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
July 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
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004

ATOM RSS1 RSS2



LISTSERV.GMU.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager