OptimizationPassCompletedEventArgs.Process
property · OptimizationPassCompletedEventArgs · cAlgo.API Since 5.9
DesktopCLICloud
Gets the optimization process that produced the pass.
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 OptimizationProcess Process {get;}
optimizationPassCompletedEventArgs.Process: OptimizationProcess
Returns OptimizationProcess
Examples
protected override void OnStart()
{
Optimization.PassCompleted += OnPassCompleted;
}
private void OnPassCompleted(OptimizationPassCompletedEventArgs args)
{
if (args.Pass.NetProfit < 0 && args.Process.Passes.Count > 100)
args.Process.Terminate();
}
def on_start(self):
api.Optimization.PassCompleted += self.on_pass_completed
def on_pass_completed(self, args):
if args.Pass.NetProfit < 0 and args.Process.Passes.Count > 100:
args.Process.Terminate()