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 anIndividualSetListenerthat listens on thePopulationinstance 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 booleanaddIndividualsManually(DSEIndividual individual)Has to be an evaluated individual.DSEIndividualgetIndividualForPhenotype(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.voidindividualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)voidindividualRemoved(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)intsize()
-
-
-
Method Detail
-
individualAdded
public void individualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)- Specified by:
individualAddedin 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:
individualRemovedin 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).
-
-