Package org.opt4j.optimizer.rs
Class RandomSearch
- java.lang.Object
-
- org.opt4j.core.optimizer.AbstractOptimizer
-
- org.opt4j.optimizer.rs.RandomSearch
-
- All Implemented Interfaces:
Optimizer
public class RandomSearch extends AbstractOptimizer
TheRandomSearch
simply generates randomIndividual
s and evaluates them.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
batchsize
-
Fields inherited from class org.opt4j.core.optimizer.AbstractOptimizer
archive, completer, control, iteration, iterationListeners, optimizing, population, stateListeners
-
-
Constructor Summary
Constructors Constructor Description RandomSearch(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Iteration iteration, int batchsize)
Constructs aRandomSearch
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
optimize()
Starts the optimization process.-
Methods inherited from class org.opt4j.core.optimizer.AbstractOptimizer
addOptimizerIterationListener, addOptimizerStateListener, getIteration, injectListeners, isRunning, nextIteration, removeOptimizerIterationListener, removeOptimizerStateListener, startOptimization, stopOptimization
-
-
-
-
Constructor Detail
-
RandomSearch
@Inject public RandomSearch(Population population, Archive archive, IndividualFactory individualFactory, IndividualCompleter completer, Control control, Iteration iteration, int batchsize)
Constructs aRandomSearch
.- Parameters:
population
- the populationarchive
- the archiveindividualFactory
- the individual creatorcompleter
- the completercontrol
- the controliteration
- the iteration counterbatchsize
- the size of the batch for an evaluation
-
-
Method Detail
-
optimize
public void optimize() throws StopException, TerminationException
Description copied from interface:Optimizer
Starts the optimization process.- Throws:
StopException
- if the optimization is stoppedTerminationException
- if the optimization is terminated
-
-