Package org.opt4j.viewer
Class PopulationWidget
java.lang.Object
org.opt4j.viewer.PopulationWidget
- All Implemented Interfaces:
IndividualSetListener
,IndividualStateListener
,ObjectivesMonitor.ObjectivesListener
,Widget
public class PopulationWidget
extends Object
implements IndividualStateListener, IndividualSetListener, Widget, ObjectivesMonitor.ObjectivesListener
A widget that monitors the
Population
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPopulationWidget
(Population population, Archive archive, IndividualFactory individualFactory, ObjectivesMonitor objectivesMonitor) Constructs aPopulationWidget
. -
Method Summary
Modifier and TypeMethodDescriptiongetPanel()
Returns the panel with the content.protected final JTable
getTable()
void
individualAdded
(IndividualSet collection, Individual individual) Invoked if theIndividual
is added to theIndividualSet
.void
individualRemoved
(IndividualSet collection, Individual individual) Invoked if theIndividual
is removed from theIndividualSet
.void
inidividualStateChanged
(Individual individual) Invoked if theIndividual
changes its state.void
Called once after the widget is added to theViewport
.void
objectives
(Collection<Objective> obj) Callback method that passes the objectives of the optimization problem.protected void
paint()
-
Field Details
-
OFFSET
protected static final int OFFSET- See Also:
-
archive
-
population
protected final org.opt4j.viewer.SynchronizedIndividualList population -
swtIndividuals
-
objectives
-
panel
-
table
-
size
protected int size -
task
-
-
Constructor Details
-
PopulationWidget
@Inject public PopulationWidget(Population population, Archive archive, IndividualFactory individualFactory, ObjectivesMonitor objectivesMonitor) Constructs aPopulationWidget
.- Parameters:
population
- the populationarchive
- the archiveindividualFactory
- the individual creatorobjectivesMonitor
- the objective monitor that determine the objective of the optimization problem
-
-
Method Details
-
getTable
-
init
Description copied from interface:Widget
Called once after the widget is added to theViewport
. -
inidividualStateChanged
Description copied from interface:IndividualStateListener
Invoked if theIndividual
changes its state.- Specified by:
inidividualStateChanged
in interfaceIndividualStateListener
- Parameters:
individual
- the individual that changes the state
-
individualAdded
Description copied from interface:IndividualSetListener
Invoked if theIndividual
is added to theIndividualSet
.- Specified by:
individualAdded
in interfaceIndividualSetListener
- Parameters:
collection
- the observed collectionindividual
- the added individual
-
individualRemoved
Description copied from interface:IndividualSetListener
Invoked if theIndividual
is removed from theIndividualSet
.- Specified by:
individualRemoved
in interfaceIndividualSetListener
- Parameters:
collection
- the observed collectionindividual
- the removed individual
-
paint
protected void paint() -
getPanel
Description copied from interface:Widget
Returns the panel with the content. -
objectives
Description copied from interface:ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.- Specified by:
objectives
in interfaceObjectivesMonitor.ObjectivesListener
- Parameters:
obj
- the objectives
-