Class SimulatedAnnealing

  • All Implemented Interfaces:
    org.opt4j.core.optimizer.IterativeOptimizer

    public class SimulatedAnnealing
    extends java.lang.Object
    implements org.opt4j.core.optimizer.IterativeOptimizer
    The SimulatedAnnealing is a standard implementation of the optimization heuristic. This heuristic optimizes a single objective (multi-objective problems are optimized by the sum of all objectives).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CoolingSchedule coolingSchedule  
      protected org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy  
      protected org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor  
      protected java.util.Random random  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimulatedAnnealing​(org.opt4j.core.optimizer.Population population, org.opt4j.core.optimizer.Archive archive, org.opt4j.core.IndividualFactory individualFactory, org.opt4j.core.optimizer.IndividualCompleter completer, org.opt4j.core.common.random.Rand random, org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor, org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy, CoolingSchedule coolingSchedule, org.opt4j.core.optimizer.Iteration iteration)
      Constructs a new SimulatedAnnealing.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected double f​(org.opt4j.core.Individual individual)
      Calculates the sum of the Objectives of one Individual.
      void initialize()  
      void next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • random

        protected final java.util.Random random
      • neighbor

        protected final org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor
      • copy

        protected final org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy
    • Constructor Detail

      • SimulatedAnnealing

        @Inject
        public SimulatedAnnealing​(org.opt4j.core.optimizer.Population population,
                                  org.opt4j.core.optimizer.Archive archive,
                                  org.opt4j.core.IndividualFactory individualFactory,
                                  org.opt4j.core.optimizer.IndividualCompleter completer,
                                  org.opt4j.core.common.random.Rand random,
                                  org.opt4j.operators.neighbor.Neighbor<org.opt4j.core.Genotype> neighbor,
                                  org.opt4j.operators.copy.Copy<org.opt4j.core.Genotype> copy,
                                  CoolingSchedule coolingSchedule,
                                  org.opt4j.core.optimizer.Iteration iteration)
        Constructs a new SimulatedAnnealing.
        Parameters:
        population - the population
        individualFactory - the individual factory
        completer - the completer
        random - the random number generator
        neighbor - the neighbor operator
        copy - the copy operator
        iteration - the iteration counter
        coolingSchedule - the cooling schedule
    • Method Detail

      • initialize

        public void initialize()
                        throws org.opt4j.core.optimizer.TerminationException
        Specified by:
        initialize in interface org.opt4j.core.optimizer.IterativeOptimizer
        Throws:
        org.opt4j.core.optimizer.TerminationException
      • next

        public void next()
                  throws org.opt4j.core.optimizer.TerminationException
        Specified by:
        next in interface org.opt4j.core.optimizer.IterativeOptimizer
        Throws:
        org.opt4j.core.optimizer.TerminationException
      • f

        protected double f​(org.opt4j.core.Individual individual)
        Calculates the sum of the Objectives of one Individual.
        Parameters:
        individual - the individual
        Returns:
        the sum of the objective values