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 classParetoPlotWidget.SelectionThe selection box for the current two objectives.
-
Field Summary
Fields Modifier and Type Field Description protected org.opt4j.viewer.SynchronizedIndividualSetarchiveprotected JPanelpanelprotected org.opt4j.viewer.SynchronizedIndividualSetpopulationprotected ParetoPlotWidget.Selectionselectionprotected DelayTasktask
-
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 voiddoPaint()Repaints the diagram.JPanelgetPanel()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.voidinit(Viewport viewport)Called once after the widget is added to theViewport.voiditerationComplete(Optimizer optimizer, int iteration)Invoked if theOptimizercompletes an iteration.voidobjectives(Collection<Objective> objectives)Callback method that passes the objectives of the optimization problem.protected voidpaint(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:WidgetCalled once after the widget is added to theViewport.
-
iterationComplete
public void iterationComplete(Optimizer optimizer, int iteration)
Description copied from interface:OptimizerIterationListenerInvoked if theOptimizercompletes an iteration.- Specified by:
iterationCompletein 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:WidgetReturns the panel with the content.
-
objectives
public void objectives(Collection<Objective> objectives)
Description copied from interface:ObjectivesMonitor.ObjectivesListenerCallback method that passes the objectives of the optimization problem.- Specified by:
objectivesin interfaceObjectivesMonitor.ObjectivesListener- Parameters:
objectives- the objectives
-
-