|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.problem.OptimisationProblemAdapter
public abstract class OptimisationProblemAdapter
This is a convenience class that keeps track of the number of fitness evaluations. This class can
be extend instead of implementing OptimisationProblem
directly.
The contract of returning an instance of InferiorFitness
for
solutions outside the problem search space is implemented by getFitness(Type, boolean)
Field Summary | |
---|---|
protected DataSetBuilder |
dataSetBuilder
|
protected AtomicInteger |
fitnessEvaluations
|
Constructor Summary | |
---|---|
OptimisationProblemAdapter()
|
|
OptimisationProblemAdapter(OptimisationProblemAdapter copy)
|
Method Summary | |
---|---|
void |
accept(ProblemVisitor visitor)
Accept the provided Visitor and
perform the Visitor.visit(Object) method. |
protected abstract Fitness |
calculateFitness(Type solution)
Determine the Fitness of the current Problem instance
based on the provided solution . |
void |
changeEnvironment()
Change the environment. |
ChangeStrategy |
getChangeStrategy()
Get the current problem change strategy. |
abstract OptimisationProblemAdapter |
getClone()
Create a cloned copy of the current object and return it. |
DataSetBuilder |
getDataSetBuilder()
Get the associated DataSetBuilder . |
Fitness |
getFitness(Type solution,
boolean count)
Returns the fitness of a potential solution to this problem. |
int |
getFitnessEvaluations()
Returns the number of times the underlying fitness function has been evaluated. |
void |
setChangeStrategy(ChangeStrategy changeStrategy)
Set the ChangeStrategy for this problem. |
void |
setDataSetBuilder(DataSetBuilder dsb)
Set the DataSetBuilder for this
optimistion problem . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.cilib.problem.OptimisationProblem |
---|
getBehaviouralDomain, getDomain |
Field Detail |
---|
protected AtomicInteger fitnessEvaluations
protected DataSetBuilder dataSetBuilder
Constructor Detail |
---|
public OptimisationProblemAdapter()
public OptimisationProblemAdapter(OptimisationProblemAdapter copy)
Method Detail |
---|
public abstract OptimisationProblemAdapter getClone()
OptimisationProblem
getClone
in interface OptimisationProblem
getClone
in interface Problem
getClone
in interface Cloneable
Object.clone()
protected abstract Fitness calculateFitness(Type solution)
Fitness
of the current Problem
instance
based on the provided solution
.
solution
- The Type
representing the candidate solution.
Fitness
of the solution
in the current Problem.getFitness(Type, boolean)
public final Fitness getFitness(Type solution, boolean count)
OptimisationProblem.getDomain()
. An instance of
InferiorFitness
should be returned if the solution
falls outside the search space of this problem.
getFitness
in interface OptimisationProblem
solution
- The potential solution found by the optimisation algorithm.count
- True if this call should contribute to the fitness evaluation count, see OptimisationProblem.getFitnessEvaluations()
.
public final int getFitnessEvaluations()
getFitnessEvaluations
in interface OptimisationProblem
public DataSetBuilder getDataSetBuilder()
DataSetBuilder
.
getDataSetBuilder
in interface OptimisationProblem
DataSetBuilder
.public void setDataSetBuilder(DataSetBuilder dsb)
DataSetBuilder
for this
optimistion problem
.
setDataSetBuilder
in interface OptimisationProblem
dsb
- The DataSetBuilder
to be set on the current OptimisationProblem
.public void accept(ProblemVisitor visitor)
Visitor
and
perform the Visitor.visit(Object)
method.
accept
in interface OptimisationProblem
visitor
- The visitor which has operations to perform.public void changeEnvironment()
changeEnvironment
in interface Problem
public ChangeStrategy getChangeStrategy()
ChangeStrategy
.public void setChangeStrategy(ChangeStrategy changeStrategy)
ChangeStrategy
for this problem.
changeStrategy
- The ChangeStrategy
to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |