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

This class implements a simple first-in-first-out queue. More...

Inheritance diagram for BasicSampleQueueManager:
Inheritance graph
[legend]

Public Member Functions

 BasicSampleQueueManager (Config config)
 
void addToInputQueue (EvaluationUnit unit)
 Add a new point to the input queue. More...
 
EvaluationUnit getFromInputQueue ()
 Request a new SamplePoint from the input queue. More...
 
void cleanup ()
 Cleanup (empty the queue) More...
 
EvaluationUnit requestNewSample ()
 Get a point from the input queue. More...
 
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...
 

Protected Member Functions

void flagAsPending (EvaluationUnit unit)
 

Detailed Description

This class implements a simple first-in-first-out queue.

Constructor & Destructor Documentation

BasicSampleQueueManager ( Config  config)
inline

Member Function Documentation

void addToInputQueue ( EvaluationUnit  unit)
inline

Add a new point to the input queue.

double averageEvaluationTime ( )
inlineinherited

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

void cleanup ( )
inline

Cleanup (empty the queue)

int evaluatedSamples ( )
inlineinherited

Return the number of samples that have been evaluated already.

Returns
The number of samples.
void flagAsPending ( EvaluationUnit  unit)
inlineprotectedinherited
EvaluationUnit getFromInputQueue ( )
inline

Request a new SamplePoint from the input queue.

Returns null if the queue is empty.

int pendingSamples ( )
inlineinherited

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

Returns
The number of samples.
SamplePoint requestEvaluatedSample ( )
inlineinherited

Get a newly evaluated sample.

Returns null if the queue is empty.

Returns
The evaluated sample.
EvaluationUnit requestNewSample ( )
inlineinherited

Get a point from the input queue.

void submitEvaluatedSample ( EvaluationUnit  unit)
inlineinherited

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

Add & process one new sample.

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

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


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