ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Implements linesearch techniques to perform a globalized step of an SCPmethod for solving NLPs. More...
#include <scp_step_linesearch.hpp>
Public Member Functions | |
SCPstepLinesearch () | |
Default constructor. | |
SCPstepLinesearch (UserInteraction *_userInteraction) | |
SCPstepLinesearch (const SCPstepLinesearch &rhs) | |
Copy constructor (deep copy). | |
virtual | ~SCPstepLinesearch () |
Destructor. | |
SCPstepLinesearch & | operator= (const SCPstepLinesearch &rhs) |
Assignment operator (deep copy). | |
virtual SCPstep * | clone () const |
virtual returnValue | performStep (OCPiterate &iter, BandedCP &cp, SCPevaluation *eval) |
returnValue | addOptionsList () |
Adds an additional OptionsList to internal array. | |
returnValue | set (OptionsName name, int value) |
Sets value of an existing option item of integer type to a given value. | |
returnValue | set (OptionsName name, double value) |
Sets value of an existing option item of double type to a given value. | |
returnValue | set (uint idx, OptionsName name, int value) |
Sets value of an existing option item of integer type within the option list of given index to a given value. | |
returnValue | set (uint idx, OptionsName name, double value) |
Sets value of an existing option item of double type within the option list of given index to a given value. | |
returnValue | setOptions (const Options &arg) |
Assigns a given Options object to this object. | |
returnValue | setOptions (uint idx, const Options &arg) |
Assigns the option list with given index of a given Options object to option list with given index of this object. | |
Options | getOptions (uint idx) const |
Returns an Options object containing exactly the option list with given index. | |
returnValue | getAll (LogName _name, MatrixVariablesGrid &values) const |
Gets all numerical values at all time instants of the item with given name. | |
returnValue | getFirst (LogName _name, Matrix &firstValue) const |
Gets numerical value at first time instant of the item with given name. | |
returnValue | getFirst (LogName _name, VariablesGrid &firstValue) const |
Gets numerical value at first time instant of the item with given name (converts internally used Matrix into VariablesGrid). | |
returnValue | getLast (LogName _name, Matrix &lastValue) const |
Gets numerical value at last time instant of the item with given name. | |
returnValue | getLast (LogName _name, VariablesGrid &lastValue) const |
Gets numerical value at last time instant of the item with given name (converts internally used Matrix into VariablesGrid). | |
returnValue | get (OptionsName name, int &value) const |
Returns value of an existing option item of integer type. | |
returnValue | get (OptionsName name, double &value) const |
Returns value of an existing option item of double type. | |
returnValue | get (uint idx, OptionsName name, int &value) const |
Returns value of an existing option item of integer type within the option list of given index. | |
returnValue | get (uint idx, OptionsName name, double &value) const |
Returns value of an existing option item of double type within the option list of given index. | |
returnValue | addOption (OptionsName name, int value) |
Add an option item with a given integer default value to the all option lists. | |
returnValue | addOption (OptionsName name, double value) |
Add an option item with a given double default value to the all option lists. | |
returnValue | addOption (uint idx, OptionsName name, int value) |
Add an option item with a given integer default value to option list with given index. | |
returnValue | addOption (uint idx, OptionsName name, double value) |
Add an option item with a given double default value to option list with given index. | |
BooleanType | haveOptionsChanged () const |
Determines whether options of at least one option list have been modified. | |
BooleanType | haveOptionsChanged (uint idx) const |
Determines whether options of option list with given index have been modified. | |
returnValue | setAll (LogName _name, const MatrixVariablesGrid &values) |
Sets all numerical values at all time instants of all items with given name within all records. | |
returnValue | setLast (LogName _name, int lastValue, double time=-INFTY) |
Sets numerical value at last time instant of all items with given name within all records. | |
returnValue | setLast (LogName _name, double lastValue, double time=-INFTY) |
Sets numerical value at last time instant of all items with given name within all records. | |
returnValue | setLast (LogName _name, const Vector &lastValue, double time=-INFTY) |
Sets numerical value at last time instant of all items with given name within all records. | |
returnValue | setLast (LogName _name, const Matrix &lastValue, double time=-INFTY) |
Sets numerical value at last time instant of all items with given name within all records. | |
returnValue | setLast (LogName _name, const VariablesGrid &lastValue, double time=-INFTY) |
Sets numerical value at last time instant of all items with given name within all records. | |
int | addLogRecord (LogRecord &_record) |
Adds a record to the log collection. | |
returnValue | printLogRecord (int idx, LogPrintMode _mode=PRINT_ITEM_BY_ITEM) const |
Prints whole record with specified index into internally specified file; all items are printed according to the output format settings. | |
returnValue | plot (PlotFrequency _frequency=PLOT_IN_ANY_CASE) |
Plots all windows of the plot collection, each one into a new figure. | |
returnValue | replot (PlotFrequency _frequency=PLOT_IN_ANY_CASE) |
Plots all windows of the plot collection, each one into the corresponding existing figure, if possible. | |
Protected Member Functions | |
returnValue | performLineSearch (const OCPiterate &iter, BandedCP &cp, SCPevaluation &eval, double &alpha, const double &alphaMin) |
This routine starts a the line search routine and searches a step size parameter alpha which yields a descent in the specified merit function. | |
virtual returnValue | setupOptions () |
virtual returnValue | setupLogging () |
virtual returnValue | applyStep (OCPiterate &iter, BandedCP &cp, double alpha) const |
Protected Attributes | |
SCPmeritFunction * | meritFcn |
UserInteraction * | userInteraction |
Pointer to top-level user interface. | |
BooleanType | useModuleStandalone |
Flag indicating whether algorithmic module is used stand-alone. | |
int | outputLoggingIdx |
Index of log record for algorithmic standard output to be optionally used within derived classes. |
The class SCPstepLinesearch implements linesearch techniques to perform a globalized step of an SCPmethod for solving nonlinear programming problems.
Referenced by clone().
SCPstepLinesearch::SCPstepLinesearch | ( | UserInteraction * | _userInteraction | ) |
SCPstepLinesearch::SCPstepLinesearch | ( | const SCPstepLinesearch & | rhs | ) |
SCPstepLinesearch::~SCPstepLinesearch | ( | ) | [virtual] |
int AlgorithmicBase::addLogRecord | ( | LogRecord & | _record | ) | [inline, inherited] |
[in] | record | Record to be added. |
References Logging::addLogRecord(), and AlgorithmicBase::userInteraction.
Referenced by SCPmethod::setupLogging(), DenseQPsolver::setupLogging(), DynamicDiscretization::setupLogging(), and Integrator::setupLogging().
returnValue AlgorithmicBase::addOption | ( | OptionsName | name, |
int | value | ||
) | [inline, inherited] |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References Options::addOption(), and AlgorithmicBase::userInteraction.
Referenced by BandedCPsolver::setupOptions(), NLPsolver::setupOptions(), DynamicDiscretization::setupOptions(), and Integrator::setupOptions().
returnValue AlgorithmicBase::addOption | ( | OptionsName | name, |
double | value | ||
) | [inline, inherited] |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References Options::addOption(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::addOption | ( | uint | idx, |
OptionsName | name, | ||
int | value | ||
) | [inline, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References Options::addOption(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::addOption | ( | uint | idx, |
OptionsName | name, | ||
double | value | ||
) | [inline, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of new option item. |
[in] | value | Default value of new option. |
References Options::addOption(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::addOptionsList | ( | ) | [inherited] |
References Options::addOptionsList(), and AlgorithmicBase::userInteraction.
Referenced by ShootingMethod::addStage().
returnValue SCPstep::applyStep | ( | OCPiterate & | iter, |
BandedCP & | cp, | ||
double | alpha | ||
) | const [protected, virtual, inherited] |
References OCPiterate::applyStep(), and BandedCP::deltaX.
Referenced by SCPstepFullstep::performStep(), and performStep().
SCPstep * SCPstepLinesearch::clone | ( | ) | const [virtual] |
Implements SCPstep.
References SCPstepLinesearch().
returnValue AlgorithmicBase::get | ( | OptionsName | name, |
int & | value | ||
) | const [inline, inherited] |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References Options::get(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::get | ( | OptionsName | name, |
double & | value | ||
) | const [inline, inherited] |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References Options::get(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::get | ( | uint | idx, |
OptionsName | name, | ||
int & | value | ||
) | const [inline, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References Options::get(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::get | ( | uint | idx, |
OptionsName | name, | ||
double & | value | ||
) | const [inline, inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[out] | value | Value of option. |
References Options::get(), and AlgorithmicBase::userInteraction.
BEGIN_NAMESPACE_ACADO returnValue AlgorithmicBase::getAll | ( | LogName | _name, |
MatrixVariablesGrid & | values | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | values | All numerical values at all time instants of given item. |
References Logging::getAll(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::getFirst | ( | LogName | _name, |
Matrix & | firstValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
References Logging::getFirst(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::getFirst | ( | LogName | _name, |
VariablesGrid & | firstValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | firstValue | Numerical value at first time instant of given item. |
References Logging::getFirst(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::getLast | ( | LogName | _name, |
Matrix & | lastValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
References Logging::getLast(), and AlgorithmicBase::userInteraction.
Referenced by Process::simulate().
returnValue AlgorithmicBase::getLast | ( | LogName | _name, |
VariablesGrid & | lastValue | ||
) | const [inline, inherited] |
If this item exists in more than one record, the first one is choosen as they are expected to have identical values anyhow.
[in] | _name | Internal name of item. |
[out] | lastValue | Numerical value at last time instant of given item. |
References Logging::getLast(), and AlgorithmicBase::userInteraction.
Options AlgorithmicBase::getOptions | ( | uint | idx | ) | const [inherited] |
[in] | idx | Index of option list. |
References Options::getOptions(), and AlgorithmicBase::userInteraction.
Referenced by ShootingMethod::evaluate().
BooleanType AlgorithmicBase::haveOptionsChanged | ( | ) | const [inline, inherited] |
References Options::haveOptionsChanged(), and AlgorithmicBase::userInteraction.
BooleanType AlgorithmicBase::haveOptionsChanged | ( | uint | idx | ) | const [inline, inherited] |
[in] | idx | Index of option list. |
References Options::haveOptionsChanged(), and AlgorithmicBase::userInteraction.
SCPstepLinesearch & SCPstepLinesearch::operator= | ( | const SCPstepLinesearch & | rhs | ) |
returnValue SCPstepLinesearch::performLineSearch | ( | const OCPiterate & | iter, |
BandedCP & | cp, | ||
SCPevaluation & | eval, | ||
double & | alpha, | ||
const double & | alphaMin | ||
) | [protected] |
References ACADOERROR, EPS, SCPmeritFunction::evaluate(), INFTY, LOG_MERIT_FUNCTION_VALUE, SCPstep::meritFcn, RET_UNKNOWN_BUG, AlgorithmicBase::setLast(), and SUCCESSFUL_RETURN.
Referenced by performStep().
returnValue SCPstepLinesearch::performStep | ( | OCPiterate & | iter, |
BandedCP & | cp, | ||
SCPevaluation * | eval | ||
) | [virtual] |
returnValue AlgorithmicBase::plot | ( | PlotFrequency | _frequency = PLOT_IN_ANY_CASE | ) | [inline, inherited] |
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
References Plotting::plot(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::printLogRecord | ( | int | idx, |
LogPrintMode | _mode = PRINT_ITEM_BY_ITEM |
||
) | const [inline, inherited] |
[in] | idx | Index of record to be printed. |
[in] | _mode | Print mode: see documentation of LogPrintMode of details. |
References ACADOERROR, LogCollection::getNumLogRecords(), Logging::logCollection, LogCollection::print(), RET_INDEX_OUT_OF_BOUNDS, and AlgorithmicBase::userInteraction.
Referenced by SCPmethod::printIteration(), SCPmethod::printRuntimeProfile(), and Integrator::printRunTimeProfile().
returnValue AlgorithmicBase::replot | ( | PlotFrequency | _frequency = PLOT_IN_ANY_CASE | ) | [inline, inherited] |
[in] | _frequency | Frequency determining at which time instants the window is to be plotted. |
References Plotting::replot(), and AlgorithmicBase::userInteraction.
Referenced by SCPmethod::printIteration(), SCPmethod::solve(), and SCPmethod::step().
returnValue AlgorithmicBase::set | ( | OptionsName | name, |
int | value | ||
) | [inherited] |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::set(), and AlgorithmicBase::userInteraction.
Referenced by SCPmethod::initializeHessianProjection().
returnValue AlgorithmicBase::set | ( | OptionsName | name, |
double | value | ||
) | [inherited] |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::set(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::set | ( | uint | idx, |
OptionsName | name, | ||
int | value | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::set(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::set | ( | uint | idx, |
OptionsName | name, | ||
double | value | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | name | Name of option item. |
[in] | value | New value of option. |
References Options::set(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setAll | ( | LogName | _name, |
const MatrixVariablesGrid & | values | ||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | values | All numerical values at all time instants of given item. |
References Logging::logCollection, LogCollection::setAll(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setLast | ( | LogName | _name, |
int | lastValue, | ||
double | time = -INFTY |
||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
References Logging::logCollection, LogCollection::setLast(), and AlgorithmicBase::userInteraction.
Referenced by IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), CondensingBasedCPsolver::finalizeSolve(), IntegratorBDF::logCurrentIntegratorStep(), ShootingMethod::logTrajectory(), SCPmethod::performCurrentStep(), performLineSearch(), SCPstepFullstep::performStep(), performStep(), SCPmethod::prepareNextStep(), CondensingBasedCPsolver::prepareSolve(), SCPmethod::printIteration(), QPsolver_qpOASES::solve(), CondensingBasedCPsolver::solveCPsubproblem(), and SCPmethod::stopClockAndPrintRuntimeProfile().
returnValue AlgorithmicBase::setLast | ( | LogName | _name, |
double | lastValue, | ||
double | time = -INFTY |
||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
References Logging::logCollection, LogCollection::setLast(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setLast | ( | LogName | _name, |
const Vector & | lastValue, | ||
double | time = -INFTY |
||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
References Logging::logCollection, LogCollection::setLast(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setLast | ( | LogName | _name, |
const Matrix & | lastValue, | ||
double | time = -INFTY |
||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
References Logging::logCollection, LogCollection::setLast(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setLast | ( | LogName | _name, |
const VariablesGrid & | lastValue, | ||
double | time = -INFTY |
||
) | [inline, inherited] |
[in] | _name | Internal name of item. |
[in] | lastValue | Numerical value at last time instant of given item. |
[in] | time | Time label of the instant. |
References Logging::logCollection, LogCollection::setLast(), and AlgorithmicBase::userInteraction.
returnValue AlgorithmicBase::setOptions | ( | const Options & | arg | ) | [inherited] |
[in] | arg | New Options object to be assigned. |
References Options::setOptions(), and AlgorithmicBase::userInteraction.
Referenced by ShootingMethod::evaluate().
returnValue AlgorithmicBase::setOptions | ( | uint | idx, |
const Options & | arg | ||
) | [inherited] |
[in] | idx | Index of option list. |
[in] | arg | Options object containing the option list to be assigned. |
References Options::setOptions(), and AlgorithmicBase::userInteraction.
returnValue SCPstep::setupLogging | ( | ) | [protected, virtual, inherited] |
References SUCCESSFUL_RETURN.
Referenced by SCPstep::SCPstep().
returnValue SCPstep::setupOptions | ( | ) | [protected, virtual, inherited] |
References SUCCESSFUL_RETURN.
Referenced by SCPstep::SCPstep().
SCPmeritFunction* SCPstep::meritFcn [protected, inherited] |
Referenced by SCPstep::operator=(), performLineSearch(), SCPstepFullstep::performStep(), SCPstep::SCPstep(), and SCPstep::~SCPstep().
int AlgorithmicBase::outputLoggingIdx [protected, inherited] |
BooleanType AlgorithmicBase::useModuleStandalone [protected, inherited] |
UserInteraction* AlgorithmicBase::userInteraction [protected, inherited] |
Referenced by AlgorithmicBase::addLogRecord(), AlgorithmicBase::addOption(), AlgorithmicBase::addOptionsList(), AlgorithmicBase::AlgorithmicBase(), AlgorithmicBase::get(), AlgorithmicBase::getAll(), ExplicitRungeKuttaExport::getCode(), AlgorithmicBase::getFirst(), ExplicitRungeKuttaExport::getFunctionDeclarations(), AlgorithmicBase::getLast(), AlgorithmicBase::getOptions(), AlgorithmicBase::haveOptionsChanged(), AlgorithmicBase::operator=(), AlgorithmicBase::plot(), AlgorithmicBase::printLogRecord(), AlgorithmicBase::replot(), AlgorithmicBase::set(), AlgorithmicBase::setAll(), ExplicitRungeKuttaExport::setDifferentialEquation(), AlgorithmicBase::setLast(), AlgorithmicBase::setOptions(), ExportGaussElim::setup(), ExportHouseholderQR::setup(), ImplicitRungeKuttaExport::setup(), SCPmethod::setup(), ExportGaussNewtonCN2::setupQPInterface(), ExportGaussNewtonForces::setupQPInterface(), ExportGaussNewtonCondensed::setupQPInterface(), CondensingBasedCPsolver::solveQP(), and AlgorithmicBase::~AlgorithmicBase().