OptimizationCompletedEventArgs
record cAlgo.API Since 5.9
DesktopCLICloud
Provides data for the optimization completed event.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
public class OptimizationCompletedEventArgs
Namespace: cAlgo.API · Group: Optimization
Examples
protected override void OnStart()
{
Optimization.Completed += OnOptimizationCompleted;
}
private void OnOptimizationCompleted(OptimizationCompletedEventArgs args)
{
Print("Optimization completed, error: {0}, best pass: {1}", args.Process.OptimizationError, args.BestPass?.Id);
}
def on_start(self):
api.Optimization.Completed += self.on_optimization_completed
def on_optimization_completed(self, args):
api.Print(f"Optimization completed, error: {args.Process.OptimizationError}")
Constructors
| Name | Description |
|---|---|
| OptimizationCompletedEventArgsDesktopCLICloud |
Properties
| Name | Description |
|---|---|
BestPassDesktopCLICloudOptimizationPass | Gets the best pass by the configured criteria or custom fitness, or null if no pass completed. |
JsonReportDesktopCLICloudstring | Gets the full optimization result as JSON (the .optres content). |
ProcessDesktopCLICloudOptimizationProcess | Gets the optimization process that has completed. |