Class PopulationTracker
java.lang.Object
de.uka.ipd.sdq.dsexplore.opt4j.archive.PopulationTracker
- All Implemented Interfaces:
org.opt4j.core.IndividualSetListener
Stores all individuals ever added to the tracked population
This is an
IndividualSetListener
that listens on the
Population
instance from the Opt4J Task
.
Additionally, a set Pareto-optimal candidates is maintained that can be retrieved
by getParetoOptimalIndividuals()
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addIndividualsManually
(DSEIndividual individual) Has to be an evaluated individual.Returns the individual for the given phenotype or null if none can be found.Careful: This can 20 minutes to calculate if you have over 1000 candidates in thePopulationTracker
.void
individualAdded
(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual) void
individualRemoved
(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual) int
size()
-
Constructor Details
-
PopulationTracker
@Inject public PopulationTracker(org.opt4j.core.optimizer.Population population)
-
-
Method Details
-
individualAdded
public void individualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual) - Specified by:
individualAdded
in interfaceorg.opt4j.core.IndividualSetListener
-
getIndividuals
-
individualRemoved
public void individualRemoved(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual) - Specified by:
individualRemoved
in interfaceorg.opt4j.core.IndividualSetListener
-
getParetoOptimalIndividuals
Careful: This can 20 minutes to calculate if you have over 1000 candidates in thePopulationTracker
.- Returns:
-
getIndividualForPhenotype
Returns the individual for the given phenotype or null if none can be found.- Parameters:
pheno
-- Returns:
- the individual or null
-
size
public int size() -
addIndividualsManually
Has to be an evaluated individual.- Parameters:
individual
-- Throws:
RuntimeException
- if the individual is null or not yet evaluated (i.e. individual.isEvaluated returns false).
-