In file /home/blah/darwin2k/src/d2k/d2kcore/evaluator.h:

class evaluator

base class for robot simulation and evaluation.

Inheritance:


Public Fields

[more]metricSpecifierList metricSpec
a list of metric specifiers.
[more]ptrList metrics
a list of metrics
[more]ptrList taskParamRecs
a list of task parameter records

Public Methods

[more] evaluator(void)
constructor
[more]virtual ~evaluator(void)
destructor
[more]virtual int readParams(const char* fname)
reads evaluator-specific parameters from fname.
[more]virtual int setVariables(const ptrList* taskParams)
sets evaluator internal variables based on a configuration's task paramters.
[more]virtual int evaluateConfiguration(void)
evaluates the configuration set by init().
[more]virtual int postComponentCreationHook(void)
reads task parameter info from the p-file.
[more]virtual int postCfgInitHook(void)
sets d2kComponent task parameters and other stuff not handled by d2kSimulator.
[more]static evaluator* createEvaluatorFromFile(const char* evFilename)
creates an evaluator and d2kComponents from a p-file
[more]inline metric* getMetric(int i)
returns the i'th metric
[more]metric* getMetricByType(const char* className)
returns the first metric with given class name
[more]inline taskParamRecord* getTaskParam(int i)
returns the i'th task parameter
[more]inline int numTaskParams(void)
returns the number of task parameters
[more]void printMetrics(FILE* fp)
prints the metrics, including the evaluations for the current configuration.

Public Members

[more]#define getMetricByName(name)
Cover function for getMetricByType that does typecasting


Inherited from d2kSimulator:

Public Fields

odynamicSystem* ds
oconfiguration* cfg
optrList cfgs
optrList d2kComponents
odouble dt
odouble maxRealtime
od2kDisplayHook* display
odouble simTimeout
oulong startSecs
otriple gravity
ouniformField* gravityInfluence
oint useGravity
oint useDynamicSimulation

Public Methods

ovirtual int init(ptrList* cfgs)
ovirtual int cleanup(void)
ovirtual int dynoCleanup(void)
ovirtual int minCfgs(void) const
ovirtual int maxCfgs(void) const

Hooks for derived classes


Inherited from synObject:

Public Fields

ostatic int staticClassID
oint objectID
oint verboseLevel

Public Methods

ovirtual const char* className(void) const
ovirtual synObject* copy(void) const
ovirtual int isOfType(int typeNum, int derivedOk)
ostatic int setStaticClassID(void)
ovirtual int classID(void) const


Documentation

base class for robot simulation and evaluation. Evaluators perform simulation book-keeping (such as allocating dynamicSystems and instantiating configurations), coordinate multiple d2kComponents, and keep track of the metrics being used to evaluate configurations.

All of the above functionality is present in the evaluator base class. Derived classes can take advantage of this functionality while overriding the evaluateConfiguration() method, which allows the user to write application-specific simulation control (such as sequentially simulating multiple scenarios, or changing controllers as the simulation progresses). If no special interactions with (or between) d2kComponents is required, then the user can just use the evaluator to perform initialization and bookkeeping. In this case, the user can access the evaluator's dynamicSystem (ds) to control the physical simulation directly.

Virtual methods for derived classes Derived evaluators may override the following methods:

For all of the above functions except evaluateConfiguration, the derived methods must call the parent class's method (e.g. init() should call the parent class's init() method).

Users writing their own evaluator class should start with (or at least look at) the dummy versions created by darwin2k-makemod.

ometricSpecifierList metricSpec
a list of metric specifiers. This list is either read from the synthesizer's p-file, or is received from the synthesizer in a message

optrList metrics
a list of metrics

optrList taskParamRecs
a list of task parameter records

o evaluator(void)
constructor

ovirtual ~evaluator(void)
destructor

ovirtual int readParams(const char* fname)
reads evaluator-specific parameters from fname. Derived classes should call their parent class's init() method within their own init().

ovirtual int setVariables(const ptrList* taskParams)
sets evaluator internal variables based on a configuration's task paramters. setVariables is called after init(cfgs). Derived classes should call their parent class's setVariables() method within their own setVariables().
Returns:
Returns 1 on success, 0 on failure.

ovirtual int evaluateConfiguration(void)
evaluates the configuration set by init().
Returns:
Returns 1 on success, 0 on failure.

ovirtual int postComponentCreationHook(void)
reads task parameter info from the p-file. Derived classes should call call their parent class's postComponentCreationHook() method at the beginning of their own postComponentCreationHook.

ovirtual int postCfgInitHook(void)
sets d2kComponent task parameters and other stuff not handled by d2kSimulator. Derived classes should call evaluator::postCfgInitHook() (or their parent class's postCfgInitHook) at the beginning of their own postCfgInitHook() method

ostatic evaluator* createEvaluatorFromFile(const char* evFilename)
creates an evaluator and d2kComponents from a p-file

oinline metric* getMetric(int i)
returns the i'th metric

ometric* getMetricByType(const char* className)
returns the first metric with given class name

oinline taskParamRecord* getTaskParam(int i)
returns the i'th task parameter

oinline int numTaskParams(void)
returns the number of task parameters

ovoid printMetrics(FILE* fp)
prints the metrics, including the evaluations for the current configuration.

o#define getMetricByName(name)
Cover function for getMetricByType that does typecasting


Direct child classes:
roverEvaluator
pathEvaluator
See Also:
pathEvaluator
roverEvaluator

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.