lobot::Dataset Class Reference

A thread-safe container for storing parsed metlogs and performing various operations on them. More...

#include <Robots/LoBot/metlog/LoDataset.H>

Collaboration diagram for lobot::Dataset:
Collaboration graph
[legend]

List of all members.

Classes

struct  eol

Public Member Functions

 Dataset ()
 Constructor.
void add (Experiment *)
int size () const
bool empty () const
 Check if the dataset is empty.
const Experimentfind_refexp (PointListName) const
const Experimentnext () const
void rewind ()
 ~Dataset ()
 Clean-up.
void dump () const

Detailed Description

A thread-safe container for storing parsed metlogs and performing various operations on them.

Multiple instances of the lobot::MetlogLoader class are used to load and parse an LGMD trajectory dataset's individual metlogs in parallel. Each parsed metlog is stored in a lobot::Experiment object. The lobot::Dataset class is used to collect all the parsed metlogs, i.e., experiments, and put them in a thread-safe container.

Additionally, this class also provides various API's to support the necessary number crunching operations on the experiments to aid in their analysis.

NOTE: The lobot::MetlogLoader class is responsible for creating the individual lobot::Experiment objects corresponding to each of the metlogs in a dataset. However, once it is done parsing the metlog and filling in the data in the Experiment object, it will hand the object over to the Dataset, which will then take over "ownership" of the Experiment. That is, modules that create Experiment objects should not delete those objects if they hand them over to a Dataset.

Definition at line 109 of file LoDataset.H.


Constructor & Destructor Documentation

lobot::Dataset::Dataset (  ) 

Constructor.

Definition at line 62 of file LoDataset.C.

lobot::Dataset::~Dataset (  ) 

Clean-up.

Definition at line 136 of file LoDataset.C.


Member Function Documentation

void lobot::Dataset::add ( Experiment E  ) 

This method adds a parsed metlog, i.e., an Experiment, to its internal data structure. It is thread-safe and is meant to be used by lobot::MetlogLoader.

Definition at line 69 of file LoDataset.C.

void lobot::Dataset::dump (  )  const

Debug support: dump each of the experiments to see what data they contain and allow users to verify whether that matches the original log files properly.

Definition at line 143 of file LoDataset.C.

References lobot::Experiment::dump().

bool lobot::Dataset::empty (  )  const [inline]

Check if the dataset is empty.

Definition at line 145 of file LoDataset.H.

const Experiment * lobot::Dataset::find_refexp ( PointListName  L  )  const

This method returns the "reference experiment" for different criteria.

Each dataset consists of several experiments. Each experiment contains a variety of point lists. One of these point lists records the robot's trajectory from start location to goal; another records the points at which the robot's LGMD-based extrication behaviour kicked in; another marks the locations where the robot's avoidance algorithms failed and made it bump into an obstacle; so on and so forth.

To make this discussion a little more concrete and clear, let us say we are interested in computing the average trajectory from start to goal across all the experiments in a dataset. Each experiment will have a different number of points recorded in its trajectory list. To find the average path, we will have to somehow "normalize" all the recorded trajectories so that they all have the same number of points.

To effect this "normalization," we find the trajectory containing the number of points that is the median of all the trajectories. The corresponding experiment is regarded as the "reference" and all average computations are made w.r.t. to this reference.

This method returns the reference experiment for the specified point list. The return value is a const pointer to an Experiment object contained in the dataset. Clients should consider this object read-only, i.e., they should refrain from casting away the constness of the returned pointer and changing the returned object in any way. Clients should also not delete the pointer returned by this function.

An invocation of this function prior to the addition of any parsed experiment objects to the dataset will result in a lobot::misc_error exception with the LOGIC_ERROR code.

WARNING: This method alters the dataset object's internal state. It is most definitely not thread-safe. It is meant to be called by the lomet program's main thread and not from one of its helper threads.

Definition at line 100 of file LoDataset.C.

const Experiment * lobot::Dataset::next (  )  const

This method returns the next experiment that needs to be processed. It is meant to be used by the correspondence finder threads.

Definition at line 118 of file LoDataset.C.

void lobot::Dataset::rewind (  ) 

Since an experiment contains several different point lists, full analysis of a dataset requires invocation of the point correspondence finder procedure several times. Before we start the multithreaded correspondence finding procedure, we should first rewind the dataset so that the correspondence finder threads start off processing from the first experiment in the dataset. This method implements the dataset rewinding described above.

This method is meant to be used by the lomet main program right before it launches the multiple correspondence finder threads. Note that it is not thread-safe and should not be called from any of lomet's helper threads.

WARNING: If this function is called before any experiments have been added to the dataset, it will throw a lobot::misc_error with LOGIC_ERROR as the code.

Definition at line 127 of file LoDataset.C.

int lobot::Dataset::size (  )  const [inline]

This function returns the number of experiments currently part of the dataset.

Definition at line 142 of file LoDataset.H.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:44:29 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3