Class ObjectiveBase<TProblem, TSolution, TFitness>
Represents an objective for an algoritm to work towards and is responsible for handling fitness calculations.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public abstract class ObjectiveBase<TProblem, TSolution, TFitness>
Type Parameters
|
TProblem
|
|
TSolution
|
|
TFitness
|
Properties
Infinite
Gets a fitness value that represent the highest possible value.
Declaration
public abstract TFitness Infinite { get; }
Property Value
|
TFitness
|
IsNonContinuous
Gets the non-continous flag, affects using deltas.
Declaration
public abstract bool IsNonContinuous { get; }
Property Value
|
System.Boolean
|
Name
Gets the name of this objective.
Declaration
public abstract string Name { get; }
Property Value
|
System.String
|
Zero
Gets a fitness value that represent zero.
Declaration
public abstract TFitness Zero { get; }
Property Value
|
TFitness
|
Methods
Add(TProblem, TFitness, TFitness)
Adds two fitness value.
Declaration
public abstract TFitness Add(TProblem problem, TFitness fitness1, TFitness fitness2)
Parameters
|
TProblem
problem
|
|
TFitness
fitness1
|
|
TFitness
fitness2
|
Returns
|
TFitness
|
Calculate(TProblem, TSolution)
Calculates the fitness of the given solution.
Declaration
public abstract TFitness Calculate(TProblem problem, TSolution solution)
Parameters
|
TProblem
problem
|
|
TSolution
solution
|
Returns
|
TFitness
|
CompareTo(TProblem, TFitness, TFitness)
Compares fitness1 to fitness2 and returns 1 if fitness1 is better, 0 if equal and -1 if fitness2 is better.
Declaration
public abstract int CompareTo(TProblem problem, TFitness fitness1, TFitness fitness2)
Parameters
|
TProblem
problem
|
|
TFitness
fitness1
|
|
TFitness
fitness2
|
Returns
|
System.Int32
|
IsZero(TProblem, TFitness)
Returns true if the given fitness value is zero.
Declaration
public abstract bool IsZero(TProblem problem, TFitness fitness)
Parameters
|
TProblem
problem
|
|
TFitness
fitness
|
Returns
|
System.Boolean
|
Subtract(TProblem, TFitness, TFitness)
Substracts a fitness value from another.
Declaration
public abstract TFitness Subtract(TProblem problem, TFitness fitness1, TFitness fitness2)
Parameters
|
TProblem
problem
|
|
TFitness
fitness1
|
|
TFitness
fitness2
|
Returns
|
TFitness
|