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 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 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 interface org.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 interface org.opt4j.core.IndividualSetListener
    • getParetoOptimalIndividuals

      public List<DSEIndividual> getParetoOptimalIndividuals()
      Careful: This can 20 minutes to calculate if you have over 1000 candidates in the PopulationTracker.
      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).