MultiAgentDecisionProcess
Release 0.2.1
|
TimedAlgorithm allows for easy timekeeping of parts of an algorithm. More...
#include <TimedAlgorithm.h>
Public Member Functions | |
void | AddTimedEvent (const std::string &id, clock_t duration) |
Adds event of certain duration, e.g., an external program call. | |
std::vector< double > | GetTimedEventDurations (const std::string &id) |
Returns all stored durations (in s) for a particular event. | |
void | LoadTimers (const std::string &filename) |
Load timing info from file filename. | |
void | PrintTimers () const |
Print stored timing info. | |
void | PrintTimersSummary () const |
Sums data and prints out a summary. | |
void | SaveTimers (const std::string &filename) const |
Save collected timing info to file filename. | |
void | SaveTimers (std::ofstream &of) const |
Save collected timing info to ofstream of. | |
void | StartTimer (const std::string &id) const |
Start to time an event identified by id. | |
void | StopTimer (const std::string &id) const |
Stop to time an event identified by id. | |
TimedAlgorithm () | |
(default) Constructor | |
virtual | ~TimedAlgorithm () |
Destructor. |
Private Attributes | |
Timing * | _m_timer |
Stores the timing info. |
TimedAlgorithm allows for easy timekeeping of parts of an algorithm.
Definition at line 40 of file TimedAlgorithm.h.
TimedAlgorithm::TimedAlgorithm | ( | ) |
(default) Constructor
Definition at line 34 of file TimedAlgorithm.cpp.
|
virtual |
Destructor.
Definition at line 39 of file TimedAlgorithm.cpp.
void TimedAlgorithm::AddTimedEvent | ( | const std::string & | id, |
clock_t | duration | ||
) |
Adds event of certain duration, e.g., an external program call.
Definition at line 79 of file TimedAlgorithm.cpp.
vector< double > TimedAlgorithm::GetTimedEventDurations | ( | const std::string & | id | ) |
Returns all stored durations (in s) for a particular event.
Definition at line 84 of file TimedAlgorithm.cpp.
void TimedAlgorithm::LoadTimers | ( | const std::string & | filename | ) |
Load timing info from file filename.
Definition at line 69 of file TimedAlgorithm.cpp.
void TimedAlgorithm::PrintTimers | ( | ) | const |
Print stored timing info.
Definition at line 54 of file TimedAlgorithm.cpp.
void TimedAlgorithm::PrintTimersSummary | ( | ) | const |
Sums data and prints out a summary.
Definition at line 74 of file TimedAlgorithm.cpp.
Referenced by MDPValueIteration::Plan(), Perseus::PlanEndOfIteration(), and MDPValueIteration::PlanSlow().
void TimedAlgorithm::SaveTimers | ( | const std::string & | filename | ) | const |
Save collected timing info to file filename.
Definition at line 59 of file TimedAlgorithm.cpp.
Referenced by GeneralizedMAAStarPlanner::Plan(), Perseus::PlanEndOfIteration(), and Perseus::PlanLeadOut().
void TimedAlgorithm::SaveTimers | ( | std::ofstream & | of | ) | const |
Save collected timing info to ofstream of.
Definition at line 64 of file TimedAlgorithm.cpp.
void TimedAlgorithm::StartTimer | ( | const std::string & | id | ) | const |
Start to time an event identified by id.
Definition at line 44 of file TimedAlgorithm.cpp.
Referenced by DICEPSPlanner::ApproximateEvaluate(), AlphaVectorPlanning::BackProjectFull(), AlphaVectorPlanning::BackProjectSparse(), Perseus::BackupStageLeadIn(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackup(), GMAA_MAAstar::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), MDPValueIteration::Initialize(), MDPValueIteration::Plan(), DICEPSPlanner::Plan(), GeneralizedMAAStarPlanner::Plan(), Perseus::PlanLeadIn(), MDPValueIteration::PlanSlow(), and AlphaVectorPlanning::SampleBeliefs().
void TimedAlgorithm::StopTimer | ( | const std::string & | id | ) | const |
Stop to time an event identified by id.
Definition at line 49 of file TimedAlgorithm.cpp.
Referenced by DICEPSPlanner::ApproximateEvaluate(), AlphaVectorPlanning::BackProjectFull(), AlphaVectorPlanning::BackProjectSparse(), Perseus::BackupStageLeadOut(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackup(), GMAA_MAAstar::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), MDPValueIteration::Initialize(), MDPValueIteration::Plan(), DICEPSPlanner::Plan(), GeneralizedMAAStarPlanner::Plan(), Perseus::PlanLeadOut(), MDPValueIteration::PlanSlow(), and AlphaVectorPlanning::SampleBeliefs().
|
private |
Stores the timing info.
Definition at line 47 of file TimedAlgorithm.h.