Class PSOCollector
java.lang.Object
org.moeaframework.analysis.collector.PSOCollector
- All Implemented Interfaces:
Collector
Collects the population from an
AbstractPSOAlgorithm
.-
Constructor Summary
ConstructorDescriptionConstructs an unattached collector for recording the population from anAbstractPSOAlgorithm
.PSOCollector
(AbstractPSOAlgorithm algorithm) Constructs a collector for recording the population from the specifiedAbstractPSOAlgorithm
. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint()
.void
collect
(Observation observation) Collects the requested information from the object, storing the data to the specified observation.Returns the attach point describing where this collector is attached.getLeaders
(Observation observation) Reads the list of leaders from the observation.getLocalBestParticles
(Observation observation) Reads the list of local-best particles from the observation.getParticles
(Observation observation) Reads the list of particles from the observation.
-
Constructor Details
-
PSOCollector
public PSOCollector()Constructs an unattached collector for recording the population from anAbstractPSOAlgorithm
. -
PSOCollector
Constructs a collector for recording the population from the specifiedAbstractPSOAlgorithm
.- Parameters:
algorithm
- the algorithm this collector records data from
-
-
Method Details
-
getAttachPoint
Description copied from interface:Collector
Returns the attach point describing where this collector is attached. The matched object should be unique.- Specified by:
getAttachPoint
in interfaceCollector
- Returns:
- the attach point describing where this collector is attached
-
attach
Description copied from interface:Collector
Returns a new instance of this collector which has been attached to the specified object as identified by the attach point returned throughCollector.getAttachPoint()
. -
collect
Description copied from interface:Collector
Collects the requested information from the object, storing the data to the specified observation. This method must only be invoked after this collector has been attached to an appropriate object. -
getParticles
Reads the list of particles from the observation.- Parameters:
observation
- the observation- Returns:
- the list of particles
-
getLocalBestParticles
Reads the list of local-best particles from the observation.- Parameters:
observation
- the observation- Returns:
- the list of local-best particles
-
getLeaders
Reads the list of leaders from the observation.- Parameters:
observation
- the observation- Returns:
- the list of leaders
-