Class PopulationTracker
- java.lang.Object
-
- de.uka.ipd.sdq.dsexplore.opt4j.archive.PopulationTracker
-
- All Implemented Interfaces:
org.opt4j.core.IndividualSetListener
public class PopulationTracker extends Object implements org.opt4j.core.IndividualSetListener
Stores all individuals ever added to the tracked population This is anIndividualSetListener
that listens on thePopulation
instance from the Opt4JTask
. Additionally, a set Pareto-optimal candidates is maintained that can be retrieved bygetParetoOptimalIndividuals()
.
-
-
Constructor Summary
Constructors Constructor Description PopulationTracker(org.opt4j.core.optimizer.Population population)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addIndividualsManually(DSEIndividual individual)
Has to be an evaluated individual.DSEIndividual
getIndividualForPhenotype(PCMPhenotype pheno)
Returns the individual for the given phenotype or null if none can be found.List<DSEIndividual>
getIndividuals()
List<DSEIndividual>
getParetoOptimalIndividuals()
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()
-
-
-
Method Detail
-
individualAdded
public void individualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
- Specified by:
individualAdded
in interfaceorg.opt4j.core.IndividualSetListener
-
getIndividuals
public List<DSEIndividual> getIndividuals()
-
individualRemoved
public void individualRemoved(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
- Specified by:
individualRemoved
in interfaceorg.opt4j.core.IndividualSetListener
-
getParetoOptimalIndividuals
public List<DSEIndividual> getParetoOptimalIndividuals()
Careful: This can 20 minutes to calculate if you have over 1000 candidates in thePopulationTracker
.- Returns:
-
getIndividualForPhenotype
public DSEIndividual getIndividualForPhenotype(PCMPhenotype pheno)
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
public boolean addIndividualsManually(DSEIndividual individual)
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).
-
-