ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Allows real time measurements based on the system's clock. More...
#include <real_clock.hpp>
Public Member Functions | |
RealClock () | |
Default constructor. | |
RealClock (const RealClock &rhs) | |
Copy constructor (deep copy). | |
virtual | ~RealClock () |
Destructor. | |
RealClock & | operator= (const RealClock &rhs) |
Assignment Operator (deep copy). | |
virtual Clock * | clone () const |
Clone constructor (deep copy). | |
virtual returnValue | start () |
Starts time measurement. | |
virtual returnValue | step (double _timeShift) |
Shifts measured time by a given offset. | |
virtual returnValue | stop () |
Stops time measurement. | |
virtual returnValue | init (double _initialTime) |
Initializes the clock with given initial time. | |
virtual returnValue | reset () |
Initializes the clock with initial time zero. | |
virtual returnValue | getTime (double &_elapsedTime) |
Returns elapsed time. | |
virtual double | getTime () |
Returns elapsed time. | |
ClockStatus | getStatus () const |
Returns current status of clock, see documentation of ClockStatus for details. | |
Protected Attributes | |
double | lastTimeInstant |
Last time instant at which start() has been called. | |
double | elapsedTime |
Elapsed time since last reset. | |
ClockStatus | status |
Status of clock. |
The class RealClock allows real time measurements based on the system's clock.
References lastTimeInstant.
Referenced by clone().
RealClock::RealClock | ( | const RealClock & | rhs | ) |
[in] | rhs | Right-hand side object. |
References lastTimeInstant.
RealClock::~RealClock | ( | ) | [virtual] |
Clock * RealClock::clone | ( | ) | const [virtual] |
BEGIN_NAMESPACE_ACADO ClockStatus Clock::getStatus | ( | ) | const [inline, inherited] |
References Clock::status.
returnValue Clock::getTime | ( | double & | _elapsedTime | ) | [virtual, inherited] |
[in] | _elapsedTime | Elapsed time. |
References ACADOERROR, CS_NOT_INITIALIZED, CS_RUNNING, CS_STOPPED, Clock::elapsedTime, RET_BLOCK_NOT_READY, RET_UNKNOWN_BUG, Clock::start(), Clock::status, Clock::stop(), and SUCCESSFUL_RETURN.
Referenced by IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), CondensingBasedCPsolver::finalizeSolve(), Controller::getPreviousRealRuntime(), EllipsoidalIntegrator::integrate(), Controller::obtainEstimates(), SCPmethod::performCurrentStep(), Controller::preparationStep(), SCPmethod::prepareNextStep(), CondensingBasedCPsolver::prepareSolve(), CondensingBasedCPsolver::solveCPsubproblem(), SimulationEnvironment::step(), and SCPmethod::stopClockAndPrintRuntimeProfile().
double Clock::getTime | ( | ) | [virtual, inherited] |
References INFTY, and SUCCESSFUL_RETURN.
returnValue Clock::init | ( | double | _initialTime | ) | [virtual, inherited] |
[in] | _initialTime | Initial time. |
References CS_STOPPED, Clock::elapsedTime, Clock::status, and SUCCESSFUL_RETURN.
Referenced by SimulationEnvironment::init(), Clock::reset(), and SimulationEnvironment::step().
[in] | rhs | Right-hand side object. |
References lastTimeInstant.
returnValue Clock::reset | ( | ) | [virtual, inherited] |
References Clock::init().
Referenced by Clock::Clock(), SCPmethod::feedbackStep(), Controller::feedbackStep(), CondensingBasedCPsolver::finalizeSolve(), Controller::init(), Controller::obtainEstimates(), SCPmethod::performCurrentStep(), SCPmethod::prepareNextStep(), CondensingBasedCPsolver::prepareSolve(), and CondensingBasedCPsolver::solveCPsubproblem().
returnValue RealClock::start | ( | ) | [virtual] |
Implements Clock.
References ACADOERROR, acadoGetTime(), CS_RUNNING, CS_STOPPED, lastTimeInstant, RET_CLOCK_NOT_READY, RET_NO_SYSTEM_TIME, Clock::status, and SUCCESSFUL_RETURN.
Referenced by IntegratorBDF::determineCorrector(), IntegratorRK::determineEta45(), IntegratorLYAPUNOV::determineEta45(), IntegratorBDF::determinePredictor(), IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), SCPmethod::feedbackStep(), Controller::feedbackStep(), CondensingBasedCPsolver::finalizeSolve(), EllipsoidalIntegrator::integrate(), Controller::obtainEstimates(), SCPmethod::performCurrentStep(), Controller::preparationStep(), SCPmethod::prepareNextStep(), CondensingBasedCPsolver::prepareSolve(), IntegratorBDF::rk_start_solve(), CondensingBasedCPsolver::solveCPsubproblem(), EllipsoidalIntegrator::step(), and step().
returnValue RealClock::step | ( | double | _timeShift | ) | [virtual] |
[in] | _timeShift | Time offset. |
Implements Clock.
References Clock::elapsedTime, start(), stop(), and SUCCESSFUL_RETURN.
returnValue RealClock::stop | ( | ) | [virtual] |
Implements Clock.
References ACADOERROR, acadoGetTime(), CS_NOT_INITIALIZED, CS_STOPPED, Clock::elapsedTime, lastTimeInstant, RET_CLOCK_NOT_READY, RET_NO_SYSTEM_TIME, Clock::status, and SUCCESSFUL_RETURN.
Referenced by IntegratorBDF::determineCorrector(), IntegratorRK::determineEta45(), IntegratorLYAPUNOV::determineEta45(), IntegratorBDF::determinePredictor(), IntegratorBDF::evaluate(), IntegratorRK::evaluate(), IntegratorLYAPUNOV::evaluate(), Controller::feedbackStep(), CondensingBasedCPsolver::finalizeSolve(), EllipsoidalIntegrator::integrate(), Controller::obtainEstimates(), SCPmethod::performCurrentStep(), Controller::preparationStep(), SCPmethod::prepareNextStep(), CondensingBasedCPsolver::prepareSolve(), IntegratorBDF::rk_start_solve(), CondensingBasedCPsolver::solveCPsubproblem(), EllipsoidalIntegrator::step(), step(), and SCPmethod::stopClockAndPrintRuntimeProfile().
double Clock::elapsedTime [protected, inherited] |
Referenced by Clock::Clock(), Clock::getTime(), Clock::init(), Clock::operator=(), SimulationClock::step(), step(), and stop().
double RealClock::lastTimeInstant [protected] |
Referenced by operator=(), RealClock(), start(), and stop().
ClockStatus Clock::status [protected, inherited] |
Referenced by Clock::Clock(), Clock::getStatus(), Clock::getTime(), Clock::init(), Clock::operator=(), SimulationClock::start(), start(), SimulationClock::stop(), and stop().