MultiAgentDecisionProcess  Release 0.2.1
TimedAlgorithm Class Reference

TimedAlgorithm allows for easy timekeeping of parts of an algorithm. More...

#include <TimedAlgorithm.h>

+ Inheritance diagram for TimedAlgorithm:
+ Collaboration diagram for TimedAlgorithm:

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.

Detailed Description

TimedAlgorithm allows for easy timekeeping of parts of an algorithm.

Definition at line 40 of file TimedAlgorithm.h.

Constructor & Destructor Documentation

TimedAlgorithm::TimedAlgorithm ( )

(default) Constructor

Definition at line 34 of file TimedAlgorithm.cpp.

TimedAlgorithm::~TimedAlgorithm ( )
virtual

Destructor.

Definition at line 39 of file TimedAlgorithm.cpp.

Member Function Documentation

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.

Member Data Documentation

Timing* TimedAlgorithm::_m_timer
private

Stores the timing info.

Definition at line 47 of file TimedAlgorithm.h.


The documentation for this class was generated from the following files: