public class RandomSearch extends AbstractAlgorithm implements Configurable
Initialization
instance is used
to generate random solutions, which are evaluated and all non-dominated
solutions retained. The result is the set of all non-dominated solutions.initialized, numberOfEvaluations, problem, terminated
Constructor and Description |
---|
RandomSearch(Problem problem)
Constructs a new random search procedure with default settings.
|
RandomSearch(Problem problem,
int sampleSize,
Initialization generator,
NondominatedPopulation archive)
Constructs a new random search procedure for the given problem.
|
Modifier and Type | Method and Description |
---|---|
NondominatedPopulation |
getResult()
Returns the current best-known result.
|
int |
getSampleSize()
Returns the number of solutions sampled each iteration.
|
protected void |
initialize()
Performs any initialization that is required by this algorithm.
|
protected void |
iterate()
Performs one iteration of the algorithm.
|
void |
setSampleSize(int sampleSize)
Sets the number of solutions sampled each iteration.
|
assertNotInitialized, evaluate, evaluateAll, evaluateAll, getNumberOfEvaluations, getProblem, isInitialized, isTerminated, loadState, saveState, step, terminate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyConfiguration, getConfiguration
checkTypeSafety, getState, setState, writeTypeSafety
public RandomSearch(Problem problem)
problem
- the problem being solvedpublic RandomSearch(Problem problem, int sampleSize, Initialization generator, NondominatedPopulation archive)
problem
- the problem being solvedsampleSize
- the number of solutions sampled each iterationgenerator
- the initialization routine used to generate random solutionsarchive
- the archive of non-dominated solutionspublic int getSampleSize()
public void setSampleSize(int sampleSize)
sampleSize
- the sample sizepublic NondominatedPopulation getResult()
Algorithm
protected void initialize()
AbstractAlgorithm
AbstractAlgorithm.step()
. Implementations should always invoke
super.initialize()
to ensure the algorithm is initialized
correctly.initialize
in class AbstractAlgorithm
protected void iterate()
AbstractAlgorithm
iterate
in class AbstractAlgorithm
Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.