Cross Entropy Solver
Constructs an instance of CrossEntropySolver with specified parameters.
Parameters
The evaluator responsible for assessing the quality of solutions. Must implement the EvaluatorIfc interface.
the cross-entropy sampler for the cross-entropy distribution
The maximum number of iterations allowed for the search process.
Strategy to determine the number of replications to perform for each evaluation.
Used when testing if solutions have converged for equality between solutions. The default is InputsAndConfidenceIntervalEquality, which checks if the inputs are the same and their is no statistical difference between the solutions
Optional name identifier for this instance of solver.
Constructors
Constructs an instance of CrossEntropySolver with specified parameters.
Properties
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
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.
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.
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).
Used to check if the last set of solutions that were captured are the same.
Functions
If eliteSizeFn is supplied it will be used; otherwise, the elite percentage is used to determine the size of the elite sample.
Subclasses may implement this function to prepare the solver before running the first iteration. Generally, it is sufficient to just implement the startingPoint() function.
Subclasses should implement this function to determine if the solver should continue running iterations. This will likely include some implementation of stopping criteria. This function should implement stopping criteria based on the quality of the solution. The number of iterations, compared to the maximum number of iterations, is automatically checked after each step in the iterative process. Unless overridden, this function returns false by default, which indicates that the solution quality criteria have not been satisfied. This will cause the solver to iterate through all iterations of the solution process up to the maximum number of iterations. Alternatively, the user can specify an instance of the SolutionQualityEvaluatorIfc interface to determine if the solution quality has been reached.
This function should contain the logic that iteratively executes until the maximum number of iterations is reached or until the stopping criteria is met. The base implementation calls nextPoint() to determine the next point to evaluate, requests an evaluation of the point, and then updates the current solution if the resulting solution is better than the current solution. Generally, implementing startingPoint() and nextPoint() should be adequate. The property iterationCounter represents the current iteration within the mainIteration() function. That is, the value of iterationCounter is incremented prior to the execution of the mainIteration() function.
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).