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

This class manages input, output and pending queues for samples that need to be evaluated or have been evaluated. More...

Inheritance diagram for AbstractSampleQueueManager:
Inheritance graph
[legend]

Public Member Functions

 AbstractSampleQueueManager (Config config)
 
void submitNewSamples (SamplePoint[] points)
 Prepare the passed sample points for evaluation and add them to the queue. More...
 
void submitNewSample (SamplePoint point)
 Add & process one new sample. More...
 
int pendingSamples ()
 Return the number of samples that are currently waiting to be evaluated. More...
 
int evaluatedSamples ()
 Return the number of samples that have been evaluated already. More...
 
double averageEvaluationTime ()
 Get the average time it takes to evaluate one single sample. More...
 
void submitEvaluatedSample (EvaluationUnit unit)
 Signal that a set of samples have been evaluated Valid termination states include: EVALUATED: The point was evaluated correctly. More...
 
SamplePoint requestEvaluatedSample ()
 Get a newly evaluated sample. More...
 
void cleanup ()
 

Protected Member Functions

abstract void addToInputQueue (EvaluationUnit unit)
 Add a new evaluation unit to the input queue. More...
 
void flagAsPending (EvaluationUnit unit)
 

Detailed Description

This class manages input, output and pending queues for samples that need to be evaluated or have been evaluated.

This abstract base class does not implement the input queue, which is covered by the derived class.

Constructor & Destructor Documentation

AbstractSampleQueueManager ( Config  config)
inline

Member Function Documentation

abstract void addToInputQueue ( EvaluationUnit  unit)
abstractprotected

Add a new evaluation unit to the input queue.

double averageEvaluationTime ( )
inline

Get the average time it takes to evaluate one single sample.

void cleanup ( )
inline
int evaluatedSamples ( )
inline

Return the number of samples that have been evaluated already.

Returns
The number of samples.
void flagAsPending ( EvaluationUnit  unit)
inlineprotected
int pendingSamples ( )
inline

Return the number of samples that are currently waiting to be evaluated.

Returns
The number of samples.
SamplePoint requestEvaluatedSample ( )
inline

Get a newly evaluated sample.

Returns null if the queue is empty.

Returns
The evaluated sample.
void submitEvaluatedSample ( EvaluationUnit  unit)
inline

Signal that a set of samples have been evaluated Valid termination states include: EVALUATED: The point was evaluated correctly.

AGAIN: The point wasn't evaluated, but might succeed a next time (for cluster failover, reintroduce in new samples queue). FAILED: The point can't be evaluated.

void submitNewSample ( SamplePoint  point)
inline

Add & process one new sample.

Parameters
pointThe sample to be submitted.
void submitNewSamples ( SamplePoint[]  points)
inline

Prepare the passed sample points for evaluation and add them to the queue.


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