Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/apps/RTS/RTSDriver.cpp File Reference

#include "RTSDriver.h"
#include "common.h"
#include "aStar.h"
#include "praStar.h"
#include "searchUnit.h"
#include "sharedAMapGroup.h"
#include "mapCliqueAbstraction.h"
#include "mapFlatAbstraction.h"
#include "PRLRTSkGroup.h"
#include "PRLRTSkUnit.h"
#include "PRLRTSk.h"
#include "KoenigsGroup.h"
#include "KoenigsUnit.h"
#include "Koenigs.h"
#include "PrioritizedGroup.h"
#include "PrioritizedUnit.h"
#include "Prioritized.h"
#include "LRTAStarGroup.h"
#include "LRTAStarUnit.h"
#include "LRTAStar.h"
#include "unit.h"
#include "time.h"
#include "unitSimulation.h"
#include "unitRaceSimulation.h"
#include "statUtil.h"
#include <vector>

Include dependency graph for RTSDriver.cpp:

Include dependency graph

Functions

void processStats (statCollection *sC)
 This function is called each time a unitSimulation is deallocated to allow any necessary stat processing beforehand.

void createSimulation (unitSimulation *&unitSim)
 This function is used to allocate the unit simulated that you want to run.

void initializeHandlers ()
 Allows you to install any keyboard handlers needed for program interaction.

void frameCallback (unitSimulation *us)
 This function is called once after each [time-step and frame draw] You can do any high level processing, drawing, etc in this function.

int mapCLH (char *argument[], int maxNumArgs)
 Handles the -map switch.

int printCLH (char *argument[], int maxNumArgs)
 Handles the -print switch.

int scenarioCLH (char *argument[], int maxNumArgs)
 Handles the -scenario switch.

int visradiusCLH (char *argument[], int maxNumArgs)
 Handles the -visradius switch.

int prlrtskCLH (char *argument[], int maxNumArgs)
 Handles the -prlrtsk switch.

int koenigsCLH (char *argument[], int maxNumArgs)
 Handles the -koenigs switch.

int lrtaStarCLH (char *argument[], int maxNumArgs)
 Handles the -lrtaStar switch.

void outputStat (const char *outFileName, const double &mean, const double &varianceSum, const double variance[], const int &totalSamples, const int samples[], const double rawData[], const int &distBucketFirst, const int &distBucketDelta)
 Output the specified stat in the context of running a scenario.

void runScenarioKoenigs (char *scenName, int sizeLSS)
 Run the simulation for Koenig's LRTA*.

void runScenarioPrioritized (char *scenName, int sizeLSS)
 Run the simulation for Prioritized LRTA*.

void runScenarioPRLRTSk (char *scenName, int d, double gamma, double learningQuota, int kParam)
 Run the simulation for PR LRTS(k).

void runScenarioLRTAStar (char *scenName)
void runScenarioStatCompare (char *collecting_stat1, char *collecting_stat2, char *scenName)
void simulateToConvergence (unitSimulation *unitSim)
void myPathfindingKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
 Key handler for Nathan's algorithms.

void myDisplayHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
 Key handler for simulation and display related stuff.

void PrioritizedKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
 Prioritized RTDP key handler.

void KoenigsKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
 Koenig's LRTA* key handler.

void PRLRTSKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
 PR LRTS key handler.

void AstarAndPRLRTSKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
void LRTAStarKeyHandler (unitSimulation *unitSim, tKeyboardModifier mod, char key)
void getStartGoalLocations (int &xs, int &ys, int &xg, int &yg, double length, unitSimulation *unitSim)
 Picks random start and end coordinates so that the optimal path between them is length+/-5.

void getStartLocation (int &xs, int &ys, int &xg, int &yg, double length, unitSimulation *unitSim)
 Picks random start coordinates so that the length of the optimal path to the goal is length +/- 10 .


Variables

PRLRTSkGroupprlrtskGroup = NULL
 PR LRTSk Group.

KoenigsGroupkoenigsGroup = NULL
 Koenigs LRTA* Group.

PrioritizedGroupprioritizedGroup = NULL
 Prioritized RTDP Group.

char scenFileName [1024] = ""
 Scenario file name.

bool printSimulation = false
 global flag for printing simulation in batch sim mode

int visRadius = 10000
 visibility radius


Function Documentation

void AstarAndPRLRTSKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

void createSimulation unitSimulation *&  unitSim  ) 
 

This function is used to allocate the unit simulated that you want to run.

Any parameters or other experimental setup can be done at this time.

void frameCallback unitSimulation us  ) 
 

This function is called once after each [time-step and frame draw] You can do any high level processing, drawing, etc in this function.

void getStartGoalLocations int &  xs,
int &  ys,
int &  xg,
int &  yg,
double  length,
unitSimulation unitSim
 

Picks random start and end coordinates so that the optimal path between them is length+/-5.

void getStartLocation int &  xs,
int &  ys,
int &  xg,
int &  yg,
double  length,
unitSimulation unitSim
 

Picks random start coordinates so that the length of the optimal path to the goal is length +/- 10 .

void initializeHandlers  ) 
 

Allows you to install any keyboard handlers needed for program interaction.

int koenigsCLH char *  argument[],
int  maxNumArgs
 

Handles the -koenigs switch.

void KoenigsKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

Koenig's LRTA* key handler.

int lrtaStarCLH char *  argument[],
int  maxNumArgs
 

Handles the -lrtaStar switch.

void LRTAStarKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

int mapCLH char *  argument[],
int  maxNumArgs
 

Handles the -map switch.

void myDisplayHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

Key handler for simulation and display related stuff.

void myPathfindingKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

Key handler for Nathan's algorithms.

void outputStat const char *  outFileName,
const double &  mean,
const double &  varianceSum,
const double  variance[],
const int &  totalSamples,
const int  samples[],
const double  rawData[],
const int &  distBucketFirst,
const int &  distBucketDelta
[inline]
 

Output the specified stat in the context of running a scenario.

int printCLH char *  argument[],
int  maxNumArgs
 

Handles the -print switch.

void PrioritizedKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

Prioritized RTDP key handler.

int prlrtskCLH char *  argument[],
int  maxNumArgs
 

Handles the -prlrtsk switch.

void PRLRTSKeyHandler unitSimulation unitSim,
tKeyboardModifier  mod,
char  key
 

PR LRTS key handler.

void processStats statCollection sC  ) 
 

This function is called each time a unitSimulation is deallocated to allow any necessary stat processing beforehand.

void runScenarioKoenigs char *  scenName,
int  sizeLSS
 

Run the simulation for Koenig's LRTA*.

A "sample" is a start and goal state that are a specified amount apart.

Read through the scenario; do one problem at a time while collecting stats.

We have finished the simulation; now we extract statiatics.

We have exhausted the tasks in the scenario file. Now tally the statistics collected for output.

We have calculated the statistics, now print them.

void runScenarioLRTAStar char *  scenName  ) 
 

void runScenarioPrioritized char *  scenName,
int  sizeLSS
 

Run the simulation for Prioritized LRTA*.

A "sample" is a start and goal state that are a specified amount apart.

Read through the scenario; do one problem at a time while collecting stats.

We have finished the simulation; now we extract statiatics.

We have exhausted the tasks in the scenario file. Now tally the statistics collected for output.

We have calculated the statistics, now print them.

void runScenarioPRLRTSk char *  scenName,
int  d,
double  gamma,
double  learningQuota,
int  kParam
 

Run the simulation for PR LRTS(k).

void runScenarioStatCompare char *  collecting_stat1,
char *  collecting_stat2,
char *  scenName
 

int scenarioCLH char *  argument[],
int  maxNumArgs
 

Handles the -scenario switch.

void simulateToConvergence unitSimulation unitSim  ) 
 

int visradiusCLH char *  argument[],
int  maxNumArgs
 

Handles the -visradius switch.


Variable Documentation

KoenigsGroup* koenigsGroup = NULL
 

Koenigs LRTA* Group.

bool printSimulation = false [static]
 

global flag for printing simulation in batch sim mode

PrioritizedGroup* prioritizedGroup = NULL
 

Prioritized RTDP Group.

PRLRTSkGroup* prlrtskGroup = NULL
 

PR LRTSk Group.

char scenFileName[1024] = ""
 

Scenario file name.

int visRadius = 10000
 

visibility radius


Generated on Tue Aug 18 03:35:30 2009 for HOG by doxygen 1.3.4