RFTester Tool for automated testing relevance feedback algorithms fro known-item search

Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RFTesterBackend.Evaluator.EvaluatorEngine Class Reference

Class for parallel evaluation of tasks. More...

## Public Member Functions
void | Start ()
| Starts parallel evaluation of tasks. More...
void | Stop ()
| Stops taking new tasks to solve. More...
void | AddTasks (List< EvaluationTask > tasks)
| Adds tasks to the evaluation queue. More...
void | AddTasks (EvaluationProcess process)
| Adds single task to the evaluation queue. More...
int | UnprocessedTasksLength ()
| Returns number of tasks, which are unprocessed. More...

## Static Public Member Functions
static EvaluatorEngine | Instance ()
| Retunrs an instance of the singleton. More...

## Static Public Attributes
static int | NUMBER_OF_THREADS = Environment.ProcessorCount
| Number of threads for evaluation. More...

## Properties
bool | Running`[get]`

## Private Member Functions
| EvaluatorEngine ()
void | DoTaskFromQueue ()
| Takes new evaluation task from queue and evaluates it. More...

## Private Attributes
object | runningSync = new object()
| Synchronization object. More...
bool | running = false
| Indicator of state. More...
BlockingCollection< EvaluationTask > | taskQueue = new BlockingCollection<EvaluationTask>()
| Queue of tasks to solve. More...
Thread[] | pool = new Thread[NUMBER_OF_THREADS]
| Engine thread pool. More...

## Static Private Attributes
static readonly log4net.ILog | log
static EvaluatorEngine | engine
| Main evaluation object. More...

## Detailed Description

Class for parallel evaluation of tasks.

## Constructor & Destructor Documentation

## ◆ EvaluatorEngine()

RFTesterBackend.Evaluator.EvaluatorEngine.EvaluatorEngine | ( |  | ) |
| inlineprivate

## Member Function Documentation

## ◆ AddTasks() [1/2]

void RFTesterBackend.Evaluator.EvaluatorEngine.AddTasks | ( | EvaluationProcess | process | ) |
| inline

Adds single task to the evaluation queue.

Parameters

  process |

## ◆ AddTasks() [2/2]

void RFTesterBackend.Evaluator.EvaluatorEngine.AddTasks | ( | List< EvaluationTask > | tasks | ) |
| inline

Adds tasks to the evaluation queue.

Parameters

  tasks |

## ◆ DoTaskFromQueue()

void RFTesterBackend.Evaluator.EvaluatorEngine.DoTaskFromQueue | ( |  | ) |
| inlineprivate

Takes new evaluation task from queue and evaluates it.

## ◆ Instance()

static EvaluatorEngine RFTesterBackend.Evaluator.EvaluatorEngine.Instance | ( |  | ) |
| inlinestatic

Retunrs an instance of the singleton.

Returns

## ◆ Start()

void RFTesterBackend.Evaluator.EvaluatorEngine.Start | ( |  | ) |
| inline

Starts parallel evaluation of tasks.

## ◆ Stop()

void RFTesterBackend.Evaluator.EvaluatorEngine.Stop | ( |  | ) |
| inline

Stops taking new tasks to solve.

Running tasks will be completed.

## ◆ UnprocessedTasksLength()

int RFTesterBackend.Evaluator.EvaluatorEngine.UnprocessedTasksLength | ( |  | ) |
| inline

Returns number of tasks, which are unprocessed.

Tasks that are being processesed are not counted.

Returns

## Member Data Documentation

## ◆ engine

EvaluatorEngine RFTesterBackend.Evaluator.EvaluatorEngine.engine
| staticprivate

Main evaluation object.

## ◆ log

readonly log4net.ILog RFTesterBackend.Evaluator.EvaluatorEngine.log
| staticprivate

Initial value:
= log4net.LogManager.GetLogger(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)

## ◆ NUMBER_OF_THREADS

int RFTesterBackend.Evaluator.EvaluatorEngine.NUMBER_OF_THREADS = Environment.ProcessorCount
| static

Number of threads for evaluation.

Number of processors.

## ◆ pool

Thread [] RFTesterBackend.Evaluator.EvaluatorEngine.pool = new Thread[NUMBER_OF_THREADS]
| private

Engine thread pool.

## ◆ running

bool RFTesterBackend.Evaluator.EvaluatorEngine.running = false
| private

Indicator of state.

## ◆ runningSync

object RFTesterBackend.Evaluator.EvaluatorEngine.runningSync = new object()
| private

Synchronization object.

## ◆ taskQueue

BlockingCollection<EvaluationTask> RFTesterBackend.Evaluator.EvaluatorEngine.taskQueue = new BlockingCollection<EvaluationTask>()
| private

Queue of tasks to solve.

## Property Documentation

## ◆ Running

bool RFTesterBackend.Evaluator.EvaluatorEngine.Running
| get

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

- RFTesterBackend/Evaluator/EvaluatorEngine.cs