Class RandomSearch

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

    public class RandomSearch
    extends java.lang.Object
    implements org.opt4j.core.optimizer.IterativeOptimizer
    The RandomSearch simply generates random Individuals and evaluates them.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int batchsize  
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomSearch​(org.opt4j.core.optimizer.Population population, org.opt4j.core.IndividualFactory individualFactory, int batchsize)
      Constructs a RandomSearch.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialize()  
      void next()  
      • Methods inherited from class java.lang.Object

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

      • batchsize

        protected final int batchsize
    • Constructor Detail

      • RandomSearch

        @Inject
        public RandomSearch​(org.opt4j.core.optimizer.Population population,
                            org.opt4j.core.IndividualFactory individualFactory,
                            int batchsize)
        Constructs a RandomSearch.
        Parameters:
        population - the population
        individualFactory - the individual creator
        batchsize - the size of the batch for an evaluation
    • Method Detail

      • initialize

        public void initialize()
        Specified by:
        initialize in interface org.opt4j.core.optimizer.IterativeOptimizer
      • 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