ZooDriver
[Zoo]


Functions

int ZooDriver::ClearScore (const char *)
rmap_tZooDriver::FindRobot (stg_model_t *)
rmap_tZooDriver::FindRobot (ZooController *)
rmap_tZooDriver::FindRobot (int port)
rmap_tZooDriver::FindRobot (const char *modelName)
stg_model_tZooDriver::GetModelByIndex (int)
stg_model_tZooDriver::GetModelByName (const char *)
stg_model_tZooDriver::GetModelByPort (int)
int ZooDriver::GetModelCount (void)
const char * ZooDriver::GetModelNameByIndex (int)
const char * ZooDriver::GetModelNameByPort (int)
int ZooDriver::GetModelPortByName (const char *)
int ZooDriver::GetScore (const char *, void *)
int ZooDriver::GetScoreSize (const char *)
ZooSpeciesZooDriver::GetSpeciesByName (const char *)
void ZooDriver::Kill (const char *)
void ZooDriver::Kill (int)
void ZooDriver::KillAll (void)
void ZooDriver::Prepare (void)
void ZooDriver::Run (const char *)
void ZooDriver::Run (int)
void ZooDriver::RunAll (void)
int ZooDriver::SetScore (const char *, void *, size_t)
void ZooDriver::SetScoreDrawCB (zooref_score_draw_t, void *userdata)
int ZooDriver::Setup (void)
int ZooDriver::Shutdown (void)
 ZooDriver::ZooDriver (ConfigFile *cf, int section)
Driver * ZooDriver_Init (ConfigFile *cf, int section)
void ZooDriver_Register (DriverTable *table)
 ZooDriver::~ZooDriver ()

Variables

DeviceTable * deviceTable

Function Documentation

int ZooDriver::ClearScore const char *  model  )  [inherited]
 

Erase the score data for this model. Frees any allocated memory.

Parameters:
model a string for the name of the model (the "token" field of a stg_model_t struct).
Returns:
-1 if the model is not found, 0 otherwise.

rmap_t * ZooDriver::FindRobot stg_model_t mod  )  [inherited]
 

Find a robot in the robot map, searching by model.

rmap_t * ZooDriver::FindRobot ZooController zc  )  [inherited]
 

Find a robot in the robot map, searching by Controller.

rmap_t * ZooDriver::FindRobot int  port  )  [inherited]
 

Find a robot in the robot map, searching by port number.

rmap_t * ZooDriver::FindRobot const char *  modelName  )  [inherited]
 

Find a robot in the robot map, searching by model name.

stg_model_t * ZooDriver::GetModelByIndex int  k  )  [inherited]
 

Get a Stage stg_model_t object for the kth model in the robot map.

Parameters:
k the index to the robot map.
Returns:
a pointer to the model; this is Stage's copy and should not be freed.

stg_model_t * ZooDriver::GetModelByName const char *  name  )  [inherited]
 

Get a Stage stg_model_t object for the model with this name (the stg_model_t.token entry).

Parameters:
name the name (token) of the model.
Returns:
a pointer to the model; this is Stage's copy and should not be freed.

stg_model_t * ZooDriver::GetModelByPort int  p  )  [inherited]
 

Get a Stage stg_model_t object for the model on the given port.

Parameters:
p the port on which there's a model we're interested in.
Returns:
a pointer to the model; this is Stage's copy and should not be freed.

int ZooDriver::GetModelCount void   )  [inherited]
 

Get the number of top-level models. FIXME: This should be the number of top-level models that Zoo cares about; i.e., the ones in the population of some species.

Returns:
the number of top-level models.

const char * ZooDriver::GetModelNameByIndex int  k  )  [inherited]
 

DEPRECATED: Use ZooDriver::FindRobot instead.

Parameters:
k index of a robot in the robot map.
Returns:
the name of the top-level model of the robot.

const char * ZooDriver::GetModelNameByPort int  p  )  [inherited]
 

DEPRECATED: Use ZooDriver::FindRobot instead.

Parameters:
p the port
Returns:
the name of the top-level model on this port.

int ZooDriver::GetModelPortByName const char *  m  )  [inherited]
 

DEPRECATED: Use ZooDriver::FindRobot instead.

Parameters:
m the name of a top-level model.
Returns:
the port that this model is on.

int ZooDriver::GetScore const char *  model,
void *  data
[inherited]
 

Get the score data for this model. If no score data has been set yet (using ZooDriver::SetScore), return 0. The caller must provide enough space to store the data, which is in a format unknown to Zoo.

Parameters:
model a string for the name of the model (the "token" field of a stg_model_t struct).
data pointer to memory to copy the data to.
Returns:
the number of bytes copied, or -1 if the model is not found.

int ZooDriver::GetScoreSize const char *  model  )  [inherited]
 

Get the size of the score data for this model. 0 could mean that no score data has been set yet.

Parameters:
model a string for the name of the model (the "token" field of a stg_model_t struct).
Returns:
the size of the score data, or -1 if the model is not found.

ZooSpecies * ZooDriver::GetSpeciesByName const char *  name  )  [inherited]
 

Locate a species by its name.

Parameters:
name the name of the species.
Returns:
a pointer to the ZooSpecies object.

void ZooDriver::Kill const char *  model  )  [inherited]
 

Kill the controller controlling a robot with a given top-level model name.

Parameters:
model the name of the top-level model

void ZooDriver::Kill int  p  )  [inherited]
 

Kill the controller for a robot on a given port.

Parameters:
p the port whose controller should be killed.

void ZooDriver::KillAll void   )  [inherited]
 

Kill all active controllers.

void ZooDriver::Prepare void   )  [inherited]
 

Player calls this after everything else is ready; Zoo uses it to tell the referee to start.

void ZooDriver::Run const char *  model  )  [inherited]
 

Run a controller to control a robot with a given model name. NOTE: currently uses GetModelPortByName, which I want to deprecate in favour of FindRobot.

Parameters:
model the name of the top-level model of the robot.

void ZooDriver::Run int  p  )  [inherited]
 

Run a controller on a specific port. If more than one species has a robot on this port in its population, then more than one controller will be started.

Parameters:
p the port to connect the controller to.

void ZooDriver::RunAll void   )  [inherited]
 

Run a controller for every member of the populations of every species.

int ZooDriver::SetScore const char *  model,
void *  score,
size_t  siz
[inherited]
 

Set the score data for this model. Reallocates storage, stored locally, each time the function is called.

Parameters:
model a string for the name of the model (the "token" field of a stg_model_t struct).
score a pointer to the data to be copied into the local score buffer.
siz the number of bytes to copy.

void ZooDriver::SetScoreDrawCB zooref_score_draw_t  sdcb,
void *  udata
[inherited]
 

Set the callback for drawing score data on the GUI, but do so for every species.

int ZooDriver::Setup void   )  [inherited]
 

Player wants Setup and Shutdown functions; NOOP for now.

int ZooDriver::Shutdown void   )  [inherited]
 

Player wants Setup and Shutdown functions; NOOP for now.

ZooDriver::ZooDriver ConfigFile *  cf,
int  section
[inherited]
 

ZooDriver constructor. Load all the species. TODO: The Player config-file reader should really have a way of getting all child sections of a given section. Then the species and controller sections could be included directly in the zoo section, and this would be syntactically meaningful.

Driver* ZooDriver_Init ConfigFile *  cf,
int  section
 

Called by player_driver_init, defined in p_driver.cc. Just creates a new ZooDriver object.

Parameters:
cf the current Player config file
section the section that ended up causing this Zoo to be created.
Returns:
a pointer to the Player driver object.

void ZooDriver_Register DriverTable *  table  ) 
 

Register the name of this driver, along with the function that creates it, with Player's driver table.;

Parameters:
table Player's driver table

ZooDriver::~ZooDriver  )  [inherited]
 

ZooDriver destructor. Deletes the species list and robot map entries.


Variable Documentation

DeviceTable* deviceTable
 

Description: An addon to the Stage plugin for Zoo functionality. Author: Adam Lein Date: July 14, 2005


Generated on Thu Dec 13 14:35:18 2007 for Stage by  doxygen 1.4.6