C# Class SwarmOps.Problem

Base-class for an optimization problem.
显示文件 Open project: DanWBR/dwsim3 Class Usage Examples

Public Methods

Method Description
BeginOptimizationRun ( ) : void

Called at the beginning of an optimization run.

Continue ( int iterations, double fitness, bool feasible ) : bool

Return whether optimization is allowed to continue.

EndOptimizationRun ( ) : void

Called at the end of an optimization run.

EnforceConstraints ( double &parameters ) : bool

Enforce constraints and evaluate feasiblity.

If you do not wish to enforce constraints you should make this call Feasible().

Feasible ( double parameters ) : bool

Evaluate feasibility (constraint satisfaction).

Fitness ( double parameters ) : double

Compute and return fitness for the given parameters.

Fitness ( double parameters, bool feasible ) : double

Compute and return fitness for the given parameters.

Fitness ( double parameters, double fitnessLimit ) : double

Compute and return fitness for the given parameters. The fitness evaluation is aborted preemptively, if the fitness becomes higher (i.e. worse) than fitnessLimit, and if it is not possible for the fitness to improve.

Fitness ( double parameters, double fitnessLimit, bool oldFeasible, bool newFeasible ) : double

Compute and return fitness for the given parameters. The fitness evaluation is aborted preemptively if feasibility of the new candidate solution is same or better as that of the old candidate solution, and if the fitness becomes higher (i.e. worse) than fitnessLimit and if it is not possible for the fitness to improve.

Gradient ( double x, double &v ) : int

Compute the gradient of the fitness-function.

Problem ( ) : System

Create the object.

Problem ( int maxIterations ) : System

Create the object.

Problem ( int maxIterations, bool requireFeasible ) : System

Create the object.

Method Details

BeginOptimizationRun() public method

Called at the beginning of an optimization run.
public BeginOptimizationRun ( ) : void
return void

Continue() public method

Return whether optimization is allowed to continue.
public Continue ( int iterations, double fitness, bool feasible ) : bool
iterations int Number of iterations performed in optimization run.
fitness double Best fitness found in optimization run.
feasible bool Feasibility of best found candidate solution.
return bool

EndOptimizationRun() public method

Called at the end of an optimization run.
public EndOptimizationRun ( ) : void
return void

EnforceConstraints() public method

Enforce constraints and evaluate feasiblity.
If you do not wish to enforce constraints you should make this call Feasible().
public EnforceConstraints ( double &parameters ) : bool
parameters double Candidate solution.
return bool

Feasible() public method

Evaluate feasibility (constraint satisfaction).
public Feasible ( double parameters ) : bool
parameters double Candidate solution.
return bool

Fitness() public method

Compute and return fitness for the given parameters.
public Fitness ( double parameters ) : double
parameters double Candidate solution.
return double

Fitness() public method

Compute and return fitness for the given parameters.
public Fitness ( double parameters, bool feasible ) : double
parameters double Candidate solution.
feasible bool Feasibility of candidate solution.
return double

Fitness() public method

Compute and return fitness for the given parameters. The fitness evaluation is aborted preemptively, if the fitness becomes higher (i.e. worse) than fitnessLimit, and if it is not possible for the fitness to improve.
public Fitness ( double parameters, double fitnessLimit ) : double
parameters double Candidate solution.
fitnessLimit double Preemptive Fitness Limit.
return double

Fitness() public method

Compute and return fitness for the given parameters. The fitness evaluation is aborted preemptively if feasibility of the new candidate solution is same or better as that of the old candidate solution, and if the fitness becomes higher (i.e. worse) than fitnessLimit and if it is not possible for the fitness to improve.
public Fitness ( double parameters, double fitnessLimit, bool oldFeasible, bool newFeasible ) : double
parameters double Candidate solution.
fitnessLimit double Preemptive Fitness Limit.
oldFeasible bool Feasibility of new candidate solution.
newFeasible bool Feasibility of old candidate solution.
return double

Gradient() public method

Compute the gradient of the fitness-function.
public Gradient ( double x, double &v ) : int
x double Candidate solution.
v double Array for holding the gradient.
return int

Problem() public method

Create the object.
public Problem ( ) : System
return System

Problem() public method

Create the object.
public Problem ( int maxIterations ) : System
maxIterations int Max optimization iterations to perform.
return System

Problem() public method

Create the object.
public Problem ( int maxIterations, bool requireFeasible ) : System
maxIterations int Max optimization iterations to perform.
requireFeasible bool Require solution to be feasible (satisfy constraints.)
return System