Package org.opt4j.viewer
Class ParetoPlotWidget
- java.lang.Object
-
- org.opt4j.viewer.ParetoPlotWidget
-
- All Implemented Interfaces:
OptimizerIterationListener
,ObjectivesMonitor.ObjectivesListener
,Widget
public class ParetoPlotWidget extends Object implements OptimizerIterationListener, Widget, ObjectivesMonitor.ObjectivesListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ParetoPlotWidget.Selection
The selection box for the current two objectives.
-
Field Summary
Fields Modifier and Type Field Description protected org.opt4j.viewer.SynchronizedIndividualSet
archive
protected JPanel
panel
protected org.opt4j.viewer.SynchronizedIndividualSet
population
protected ParetoPlotWidget.Selection
selection
protected DelayTask
task
-
Constructor Summary
Constructors Constructor Description ParetoPlotWidget(Population population, Archive archive, Optimizer optimizer, ObjectivesMonitor objectivesMonitor, AutoZoomButton autoZoomButton)
Constructs aParetoPlotWidget
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doPaint()
Repaints the diagram.JPanel
getPanel()
Returns the panel with the content.protected Set<Point2D.Double>
getPoints(Collection<Individual> indivualCollection, Objective one, Objective two)
Returns the two dimensional representation of the givenIndividualCollection
.void
init(Viewport viewport)
Called once after the widget is added to theViewport
.void
iterationComplete(Optimizer optimizer, int iteration)
Invoked if theOptimizer
completes an iteration.void
objectives(Collection<Objective> objectives)
Callback method that passes the objectives of the optimization problem.protected void
paint(Collection<Individual> archive, Collection<Individual> population)
Repaints the diagram.
-
-
-
Field Detail
-
population
protected final org.opt4j.viewer.SynchronizedIndividualSet population
-
archive
protected final org.opt4j.viewer.SynchronizedIndividualSet archive
-
task
protected final DelayTask task
-
selection
protected final ParetoPlotWidget.Selection selection
-
panel
protected final JPanel panel
-
-
Constructor Detail
-
ParetoPlotWidget
@Inject public ParetoPlotWidget(Population population, Archive archive, Optimizer optimizer, ObjectivesMonitor objectivesMonitor, AutoZoomButton autoZoomButton)
Constructs aParetoPlotWidget
.- Parameters:
population
- the populationarchive
- the archiveoptimizer
- the optimizerobjectivesMonitor
- the objective monitor that determine the objective of the optimization problem
-
-
Method Detail
-
init
public void init(Viewport viewport)
Description copied from interface:Widget
Called once after the widget is added to theViewport
.
-
iterationComplete
public void iterationComplete(Optimizer optimizer, int iteration)
Description copied from interface:OptimizerIterationListener
Invoked if theOptimizer
completes an iteration.- Specified by:
iterationComplete
in interfaceOptimizerIterationListener
- Parameters:
optimizer
- the optimizeriteration
- the completed iteration
-
getPoints
protected Set<Point2D.Double> getPoints(Collection<Individual> indivualCollection, Objective one, Objective two)
Returns the two dimensional representation of the givenIndividualCollection
.- Parameters:
indivualCollection
- the {IndividualCollection- Returns:
- a set of points
-
doPaint
protected void doPaint()
Repaints the diagram.
-
paint
protected void paint(Collection<Individual> archive, Collection<Individual> population)
Repaints the diagram.
-
getPanel
public JPanel getPanel()
Description copied from interface:Widget
Returns the panel with the content.
-
objectives
public void objectives(Collection<Objective> objectives)
Description copied from interface:ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.- Specified by:
objectives
in interfaceObjectivesMonitor.ObjectivesListener
- Parameters:
objectives
- the objectives
-
-