org.opt4j.viewer
Class ParetoPlotWidget

java.lang.Object
  extended by org.opt4j.viewer.ParetoPlotWidget
All Implemented Interfaces:
org.opt4j.core.optimizer.OptimizerIterationListener, ObjectivesMonitor.ObjectivesListener, Widget

public class ParetoPlotWidget
extends java.lang.Object
implements org.opt4j.core.optimizer.OptimizerIterationListener, Widget, ObjectivesMonitor.ObjectivesListener

The ParetoPlotWidget is a widget that displays the Population and Archive in two dimensional plot.


Nested Class Summary
protected  class ParetoPlotWidget.Selection
          The selection box for the current two objectives.
 
Field Summary
protected  org.opt4j.viewer.SynchronizedIndividualSet archive
           
protected  javax.swing.JPanel panel
           
protected  ptolemy.plot.Plot plot
           
protected  org.opt4j.viewer.SynchronizedIndividualSet population
           
protected  ParetoPlotWidget.Selection selection
           
protected  org.opt4j.core.config.visualization.DelayTask task
           
 
Constructor Summary
ParetoPlotWidget(org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive, AutoZoomButton autoZoomButton)
          Constructs a ParetoPlotWidget.
 
Method Summary
protected  void doPaint()
          Repaints the diagram.
 javax.swing.JPanel getPanel()
          Returns the panel with the content.
protected  java.util.Set<java.awt.geom.Point2D.Double> getPoints(java.util.Collection<org.opt4j.core.Individual> indivualCollection, org.opt4j.core.Objective one, org.opt4j.core.Objective two)
          Returns the two dimensional representation of the given IndividualCollection.
 void init(Viewport viewport)
          Called once after the widget is added to the Viewport.
 void iterationComplete(int iteration)
           
 void objectives(java.util.Collection<org.opt4j.core.Objective> objectives)
          Callback method that passes the objectives of the optimization problem.
protected  void paint(java.util.Collection<org.opt4j.core.Individual> archive, java.util.Collection<org.opt4j.core.Individual> population)
          Repaints the diagram.
 void registerAtObjectivesMonitor(ObjectivesMonitor objectivesMonitor)
          Register at the ObjectivesMonitor.
 void registerAtOptimizer(org.opt4j.core.optimizer.Optimizer optimizer)
          Register at the Optimizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

population

protected final org.opt4j.viewer.SynchronizedIndividualSet population

archive

protected final org.opt4j.viewer.SynchronizedIndividualSet archive

task

protected final org.opt4j.core.config.visualization.DelayTask task

plot

protected final ptolemy.plot.Plot plot

selection

protected final ParetoPlotWidget.Selection selection

panel

protected final javax.swing.JPanel panel
Constructor Detail

ParetoPlotWidget

@Inject
public ParetoPlotWidget(org.opt4j.core.optimizer.Population population,
                               org.opt4j.core.optimizer.Archive archive,
                               AutoZoomButton autoZoomButton)
Constructs a ParetoPlotWidget.

Parameters:
population - the population
archive - the archive
autoZoomButton - the button to reset zooming
Method Detail

registerAtOptimizer

@Inject(optional=true)
public void registerAtOptimizer(org.opt4j.core.optimizer.Optimizer optimizer)
Register at the Optimizer.

Parameters:
optimizer - the optimizer

registerAtObjectivesMonitor

@Inject(optional=true)
public void registerAtObjectivesMonitor(ObjectivesMonitor objectivesMonitor)
Register at the ObjectivesMonitor.

Parameters:
objectivesMonitor - the objectives monitor

init

public void init(Viewport viewport)
Description copied from interface: Widget
Called once after the widget is added to the Viewport.

Specified by:
init in interface Widget
Parameters:
viewport - the base viewport

iterationComplete

public void iterationComplete(int iteration)
Specified by:
iterationComplete in interface org.opt4j.core.optimizer.OptimizerIterationListener

getPoints

protected java.util.Set<java.awt.geom.Point2D.Double> getPoints(java.util.Collection<org.opt4j.core.Individual> indivualCollection,
                                                                org.opt4j.core.Objective one,
                                                                org.opt4j.core.Objective two)
Returns the two dimensional representation of the given IndividualCollection.

Parameters:
indivualCollection - the {IndividualCollection
Returns:
a set of points

doPaint

protected void doPaint()
Repaints the diagram.


paint

protected void paint(java.util.Collection<org.opt4j.core.Individual> archive,
                     java.util.Collection<org.opt4j.core.Individual> population)
Repaints the diagram.


getPanel

public javax.swing.JPanel getPanel()
Description copied from interface: Widget
Returns the panel with the content.

Specified by:
getPanel in interface Widget
Returns:
the panel with the content

objectives

public void objectives(java.util.Collection<org.opt4j.core.Objective> objectives)
Description copied from interface: ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.

Specified by:
objectives in interface ObjectivesMonitor.ObjectivesListener
Parameters:
objectives - the objectives