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

Same as BasicDataSource, only now samples can be evaluated in batches. More...

Inheritance diagram for BatchDataSource:
Inheritance graph
[legend]

Public Member Functions

 BatchDataSource (Config config)
 
abstract void evaluate (EvaluationUnitBatch point) throws DataSourceException
 Evaluate one batch. More...
 
EvaluationUnitBatch requestNewBatch ()
 Request a new batch of SamplePoints from the queue. More...
 
void cleanup ()
 Cleanup procedure called when the sample queue thread is aborted. 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 ()
 

Protected Member Functions

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

Same as BasicDataSource, only now samples can be evaluated in batches.

Constructor & Destructor Documentation

BatchDataSource ( Config  config)
inline

Member Function Documentation

void cleanup ( )
inline

Cleanup procedure called when the sample queue thread is aborted.

Stops the polling thread.

Implements DataSource.

abstract void evaluate ( EvaluationUnitBatch  point) throws DataSourceException
abstract

Evaluate one batch.

This function is called in a separate thread so it is non-blocking for the main thread.

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 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 ( )
inline

Request a new batch of SamplePoints from the queue.

Returns null if the queue is empty.

void setBatchSize ( int  size)
inline
final void submitEvaluatedBatch ( EvaluationUnitBatch  batch)
inlineprotected

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)
inlineprotected

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.


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