Evaluator

class Evaluator(val problemDefinition: ProblemDefinition, simulator: RunSimulationsForResponseMapsIfc, val cache: SolutionCacheIfc? = null, oracleReplicationBudget: Int = Int.MAX_VALUE) : EvaluatorIfc

An evaluator should communicate with the simulation oracle to determine solutions for requests for evaluation from solvers.

Parameters

problemDefinition

the problem that the evaluation of responses will be used on

simulator

the provider of responses from the simulation oracle

cache

a cache that can be used instead of a costly simulation evaluation

oracleReplicationBudget

the maximum number of direct replications permitted by the evaluator. The default is Int.MAX_VALUE. This can be used to control the total number of replications executed by the simulation oracle.

Constructors

Link copied to clipboard
constructor(problemDefinition: ProblemDefinition, simulator: RunSimulationsForResponseMapsIfc, cache: SolutionCacheIfc? = null, oracleReplicationBudget: Int = Int.MAX_VALUE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val cache: SolutionCacheIfc? = null
Link copied to clipboard

Indicates if the number of replications budgeted has been exceeded or not.

Link copied to clipboard
open override var maxOracleReplicationBudget: Int

The maximum budget (in terms of number of replications) within the evaluations performed by the simulation oracle.

Link copied to clipboard
Link copied to clipboard
open override val remainingOracleReplications: Int

The total number of remaining replications that can be performed by the simulation oracle.

Link copied to clipboard
open override var totalCachedEvaluations: Int

The total number of evaluations performed via the cache.

Link copied to clipboard
open override var totalCachedReplications: Int

The total number of replications satisfied by the cache.

Link copied to clipboard

The total number of evaluation requests received that were duplicates in terms of inputs.

Link copied to clipboard
open override var totalEvaluations: Int

The total number of evaluations performed. An evaluation may have many replications.

Link copied to clipboard
open override var totalOracleEvaluations: Int

The total number of evaluations performed via the simulation oracle.

Link copied to clipboard
open override var totalOracleReplications: Int

The total number of replications performed by the simulation oracle.

Link copied to clipboard
open override val totalReplications: Int

The total number of replications requested across all evaluation requests.

Link copied to clipboard
open override var totalRequestsReceived: Int

The total number of evaluation requests that were received.

Functions

Link copied to clipboard
open override fun evaluate(rawRequests: List<RequestData>): List<Solution>

Processes the supplied requests for solutions. The solutions may come from an associated solution cache (if present) or via evaluations by the simulation oracle. The list of requests may have duplicated inputs, in which case, the solution will also be a duplicate. That is, no extra evaluations occur for duplicates in the list of requests. Any new solutions that result due to the processing will be entered into the cache (according to the rules governing the cache).

open fun evaluate(request: RequestData): Solution

Processes the supplied request for a solution. The solution may come from an associated solution cache (if present) or via an evaluation by the simulation oracle. A solution that results due to the processing will be entered into the cache (according to the rules governing the cache). If the request is input range-infeasible, then a bad and infeasible solution will be returned.

Link copied to clipboard
open override fun resetEvaluationCounts()

The evaluator collects some basic counts (statistics) on its evaluations. This function resets all counters to 0, perhaps in preparation for another evaluation run.

Link copied to clipboard
open override fun toString(): String