An unimodal function for two movements and their fixed total time.
More...
|
double | mDirection |
| A maximal possible difference in duration for both the movements.
|
|
double | mFromX |
| The minimal duration of the first movement.
|
|
double | mToX |
| The maximal duration of the first movement.
|
|
Movement * | mMv1 |
| The first movement to be considered.
|
|
Movement * | mMv2 |
| The second movement to be considered.
|
|
double | mTotalDuration |
| The time needed for both the movements is equal to this fixed value.
|
|
An unimodal function for two movements and their fixed total time.
An unimodal convex function, represented by this class, can be used in the Golden Section search algorithm to find optimal timing of two movements where their total time is fixed.
- See also
- goldenSearch, HeuristicAlgorithms::heuristicLocationChanges
Definition at line 36 of file HeuristicAlgorithms.cpp.
UnimodalFunctionHeuristic::UnimodalFunctionHeuristic |
( |
Movement * |
mv1, |
|
|
Movement * |
mv2, |
|
|
double |
duration |
|
) |
| |
|
inline |
Constructor initializes the member variables.
- Parameters
-
mv1,mv2 | Movements which optimal duration is to be determined. |
duration | The total time, considered to be fixed, needed for both the movements. |
Definition at line 43 of file HeuristicAlgorithms.cpp.
pair<double, double> UnimodalFunctionHeuristic::durations |
( |
const double & |
alpha | ) |
const |
|
inline |
Calculates durations of the movements based on the relative step.
- Parameters
-
alpha | A step, i.e. a value from 0 to 1, used for obtaining the timing of the movements. |
Definition at line 71 of file HeuristicAlgorithms.cpp.
double UnimodalFunctionHeuristic::functionValue |
( |
const double & |
alpha | ) |
const |
|
inline |
Returns a function value, i.e. total energy consumption of both movements.
- Parameters
-
alpha | Variable value corresponding to a relative step. |
Definition at line 87 of file HeuristicAlgorithms.cpp.
double UnimodalFunctionHeuristic::tolerance |
( |
| ) |
const |
|
inline |
As there is no use to solve the timing of movements with too high precision, is enough in the most cases, this method returns a relative tolerance ensuring that Golden Section search is stopped if just enough precise solution is found.
Definition at line 60 of file HeuristicAlgorithms.cpp.
The documentation for this class was generated from the following file: