Click or drag to resize

SystemPerformanceOptimizationContextOnExecutedIteration Method

Called after completion of each iteration of a CrossEntropyProgram executing in this context.

Namespace:  Novacta.Analytics.Advanced
Assembly:  Novacta.Analytics (in Novacta.Analytics.dll) Version: 2.0.0
Syntax
protected override void OnExecutedIteration(
	int iteration,
	DoubleMatrix sample,
	LinkedList<double> levels,
	LinkedList<DoubleMatrix> parameters
)

Parameters

iteration
Type: SystemInt32
The current iteration identifier.
sample
Type: Novacta.AnalyticsDoubleMatrix
The current sample.
levels
Type: System.Collections.GenericLinkedListDouble
The performance levels achieved by the program in previous iterations.
parameters
Type: System.Collections.GenericLinkedListDoubleMatrix
The sampling parameters applied by the program in previous iterations.
Remarks

In the SystemPerformanceOptimizationContext class, this method calls SmoothParameter(LinkedListDoubleMatrix) to provide a smoothing scheme for Cross-Entropy parameters.

Caution note Caution
When overriding this method, please remember to call its base implementation, or no smoothing scheme will be applied to Cross-Entropy parameters.
Examples

In the following example, a new context class is derived from SystemPerformanceOptimizationContext that needs to override method OnExecutedIteration(Int32, DoubleMatrix, LinkedListDouble, LinkedListDoubleMatrix).

Overriding method OnExecutedIteration
class DerivedContext : SystemPerformanceOptimizationContext
{
    public override void OnExecutedIteration(
        int iteration,
        DoubleMatrix sample,
        LinkedList<double> levels,
        LinkedList<DoubleMatrix> parameters)
    {
        Console.WriteLine("Iteration: {0}", iteration);

        // Calling the base class OnExecutedIteration method.
        base.OnExecutedIteration(
            iteration,
            sample,
            levels,
            parameters);
    }

    // Additional code here. 
}
See Also