The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
LocalDataSource Class Reference

This class implements a local sample evaluator. More...

Inheritance diagram for LocalDataSource:
Inheritance graph
[legend]

Public Member Functions

 LocalDataSource (Config config) throws DataSourceException
 
void evaluate (EvaluationUnitBatch batch) throws DataSourceException
 
void setSimulator (Simulator sim)
 
void cleanup ()
 Clean up the threads started and the resources used by the sample evaluator. More...
 
int getNumThreads ()
 
EvaluationUnitBatch requestNewBatch ()
 Request a new batch of SamplePoints from the queue. More...
 
void setBatchSize (int size)
 
void submitSamplesForEvaluation (SamplePoint[] points)
 Schedule points for evaluation. More...
 
SamplePoint fetchEvaluatedSample ()
 Get the next evaluated point. More...
 
int getNumPendingSamples ()
 Return the number of poitns pending evaluation. More...
 
int getNumEvaluatedSamples ()
 Return the number of evaluated points waiting to be fetched. More...
 
double getAverageEvaluationTime ()
 Return the average evaluation time (in seconds) for one data point. More...
 
DataSourceStatus getStatus ()
 Returns default status. More...
 
int getInputDimension ()
 
int getOutputDimension ()
 

Static Public Attributes

static final int MAX_THREADS = 20
 Max number of threads. More...
 

Protected Member Functions

void startThreads ()
 
final void submitEvaluatedBatch (EvaluationUnitBatch batch)
 This function is called by the derived subclass whenever a successfully evaluated batch of points needs to be added to the queue. More...
 
final void submitFailedBatch (EvaluationUnitBatch batch)
 This function is called by the derived subclass whenever a FAILED batch of points needs to be added to the queue. More...
 
AbstractSampleQueueManager getSampleQueueManager ()
 Get the sample queue manager for this sample evaluator. More...
 

Detailed Description

This class implements a local sample evaluator.

The user provides a Simulator in the constructor, which is used to calculate the value of each sample point locally.

Constructor & Destructor Documentation

LocalDataSource ( Config  config) throws DataSourceException
inline

Member Function Documentation

void cleanup ( )
inline

Clean up the threads started and the resources used by the sample evaluator.

Called automatically when the DataSource is not to be used anymore.

Implements DataSource.

void evaluate ( EvaluationUnitBatch  batch) throws DataSourceException
inline
SamplePoint fetchEvaluatedSample ( )
inlineinherited

Get the next evaluated point.

Implements DataSource.

double getAverageEvaluationTime ( )
inlineinherited

Return the average evaluation time (in seconds) for one data point.

Implements DataSource.

int getInputDimension ( )
inlineinherited
int getNumEvaluatedSamples ( )
inlineinherited

Return the number of evaluated points waiting to be fetched.

Implements DataSource.

int getNumPendingSamples ( )
inlineinherited

Return the number of poitns pending evaluation.

Implements DataSource.

int getNumThreads ( )
inlineinherited
int getOutputDimension ( )
inlineinherited
AbstractSampleQueueManager getSampleQueueManager ( )
inlineprotectedinherited

Get the sample queue manager for this sample evaluator.

DataSourceStatus getStatus ( )
inlineinherited

Returns default status.

Can be overrided if other than default behaviour is desired.

Implements DataSource.

EvaluationUnitBatch requestNewBatch ( )
inlineinherited

Request a new batch of SamplePoints from the queue.

Returns null if the queue is empty.

void setBatchSize ( int  size)
inlineinherited
void setSimulator ( Simulator  sim)
inline
void startThreads ( )
inlineprotectedinherited
final void submitEvaluatedBatch ( EvaluationUnitBatch  batch)
inlineprotectedinherited

This function is called by the derived subclass whenever a successfully evaluated batch of points needs to be added to the queue.

Parameters
pointEvaluated point to be added.
final void submitFailedBatch ( EvaluationUnitBatch  batch)
inlineprotectedinherited

This function is called by the derived subclass whenever a FAILED batch of points needs to be added to the queue.

void submitSamplesForEvaluation ( SamplePoint[]  points)
inlineinherited

Schedule points for evaluation.

Implements DataSource.

Member Data Documentation

final int MAX_THREADS = 20
staticinherited

Max number of threads.


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