CrossEntropySolver

class CrossEntropySolver @JvmOverloads constructor(evaluator: EvaluatorIfc, val ceSampler: CESamplerIfc, maxIterations: Int = ceDefaultMaxIterations, replicationsPerEvaluation: ReplicationPerEvaluationIfc, name: String? = null) : StochasticSolver(source)

Constructs an instance of CrossEntropySolver with specified parameters.

Parameters

evaluator

The evaluator responsible for assessing the quality of solutions. Must implement the EvaluatorIfc interface.

ceSampler

the cross-entropy sampler for the cross-entropy distribution

maxIterations

The maximum number of iterations allowed for the search process.

replicationsPerEvaluation

Strategy to determine the number of replications to perform for each evaluation.

name

Optional name identifier for this instance of solver.

Constructors

Link copied to clipboard
constructor(evaluator: EvaluatorIfc, ceSampler: CESamplerIfc, maxIterations: Int = ceDefaultMaxIterations, replicationsPerEvaluation: Int = defaultReplicationsPerEvaluation, name: String? = null)

Constructs an instance of CrossEntropySolver with specified parameters.

constructor(evaluator: EvaluatorIfc, ceSampler: CESamplerIfc, maxIterations: Int = ceDefaultMaxIterations, replicationsPerEvaluation: ReplicationPerEvaluationIfc, name: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The sample size associated with the CE algorithm used to determine the elite solutions. By default, this is determined by the function recommendCESampleSize() within the companion object. The value cannot be less than defaultMinCESampleSize or greater than defaultMaxCESampleSize

Link copied to clipboard

A value between 0 and 1 that represents the proportion of the CE sample that determines the elite sample. By default, this is 0.1, which can be controlled globally via the companion object's defaultElitePct.

Link copied to clipboard

The current list of elite solutions ordered from the best

Link copied to clipboard

If supplied, this function will be used to determine the size of the elite sample during the cross-entropy process. Supplying a function can permit dynamic changes when determining the elite sample.

Link copied to clipboard
Link copied to clipboard

This value is used as a termination threshold for the largest number of iterations during which no improvement of the best function value is found. By default, set to 5, which can be controlled globally via the companion object's defaultNoImproveThreshold

Link copied to clipboard

If supplied, this function will be used to determine the size of the cross-entropy sample during the cross-entropy process. Supplying a function can permit dynamic changes when determining the size of the cross-entropy sample (population).

Functions

Link copied to clipboard
fun eliteSize(): Int

If eliteSizeFn is supplied it will be used; otherwise, the elite percentage is used to determine the size of the elite sample.

Link copied to clipboard

If sampleSizeFn is supplied it will be used; otherwise, the value of ceSampleSize is used to determine the size of the cross-entropy sample (population).

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