Class FixedEvaluationsStrategy
java.lang.Object
org.uma.evolver.metaoptimizationproblem.evaluationbudgetstrategy.FixedEvaluationsStrategy
- All Implemented Interfaces:
EvaluationBudgetStrategy
Implementation of EvaluationBudgetStrategy that uses fixed evaluation counts for each problem.
The number of evaluations is specified explicitly for each problem in the constructor.
- Author:
- Antonio J. Nebro
-
Constructor Summary
ConstructorsConstructorDescriptionFixedEvaluationsStrategy(List<Integer> evaluations) Creates a new FixedEvaluationsStrategy with the specified evaluation counts. -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable view of the evaluation counts.intgetEvaluations(int problemIndex) Retrieves the number of evaluations to be performed for a specific problem.voidvalidate(int numberOfProblems) Validates the configuration of the evaluation budget strategy against the number of problems.
-
Constructor Details
-
FixedEvaluationsStrategy
Creates a new FixedEvaluationsStrategy with the specified evaluation counts.- Parameters:
evaluations- a list containing the number of evaluations for each problem- Throws:
NullPointerException- if evaluations is nullIllegalArgumentException- if evaluations is empty
-
-
Method Details
-
getEvaluations
public int getEvaluations(int problemIndex) Description copied from interface:EvaluationBudgetStrategyRetrieves the number of evaluations to be performed for a specific problem. The implementation should handle the logic for determining the evaluation count, which could be fixed, random, or based on some other criterion.- Specified by:
getEvaluationsin interfaceEvaluationBudgetStrategy- Parameters:
problemIndex- the zero-based index of the problem in the problem list- Returns:
- the number of evaluations to perform for the specified problem
-
validate
public void validate(int numberOfProblems) Description copied from interface:EvaluationBudgetStrategyValidates the configuration of the evaluation budget strategy against the number of problems. Implementations should throw anIllegalArgumentExceptionif the configuration is invalid for the given number of problems.- Specified by:
validatein interfaceEvaluationBudgetStrategy- Parameters:
numberOfProblems- the total number of problems to be evaluated
-
getEvaluations
-