Package org.opt4j.viewer
Class ObjectivesMonitor
- java.lang.Object
-
- org.opt4j.viewer.ObjectivesMonitor
-
- All Implemented Interfaces:
IndividualStateListener
@Singleton public class ObjectivesMonitor extends Object implements IndividualStateListener
TheObjectivesMonitor
informs its listeners about theObjective
s of the optimization problem as soon as it is available.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ObjectivesMonitor.ObjectivesListener
TheObjectivesMonitor.ObjectivesListener
is an interface for classes that need the objectives.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
done
protected Set<ObjectivesMonitor.ObjectivesListener>
listeners
protected List<Objective>
objectives
-
Constructor Summary
Constructors Constructor Description ObjectivesMonitor(IndividualFactory individualFactory, Archive archive)
Constructs theObjectivesMonitor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(ObjectivesMonitor.ObjectivesListener listener)
Adds anObjectivesMonitor.ObjectivesListener
.void
inidividualStateChanged(Individual individual)
Invoked if theIndividual
changes its state.protected void
publishObjectives(Individual individual)
void
removeListener(ObjectivesMonitor.ObjectivesListener listener)
Remove anObjectivesMonitor.ObjectivesListener
.
-
-
-
Field Detail
-
done
protected boolean done
-
listeners
protected Set<ObjectivesMonitor.ObjectivesListener> listeners
-
-
Constructor Detail
-
ObjectivesMonitor
@Inject public ObjectivesMonitor(IndividualFactory individualFactory, Archive archive)
Constructs theObjectivesMonitor
.- Parameters:
individualFactory
-
-
-
Method Detail
-
addListener
public void addListener(ObjectivesMonitor.ObjectivesListener listener)
Adds anObjectivesMonitor.ObjectivesListener
.- Parameters:
listener
- the listener
-
removeListener
public void removeListener(ObjectivesMonitor.ObjectivesListener listener)
Remove anObjectivesMonitor.ObjectivesListener
.- Parameters:
listener
- the listener
-
inidividualStateChanged
public void inidividualStateChanged(Individual individual)
Description copied from interface:IndividualStateListener
Invoked if theIndividual
changes its state.- Specified by:
inidividualStateChanged
in interfaceIndividualStateListener
- Parameters:
individual
- the individual that changes the state
-
publishObjectives
protected void publishObjectives(Individual individual)
-
-