OptimizationProcess.Passes
property · OptimizationProcess · cAlgo.API Since 5.9
DesktopCLICloud
Gets the passes completed so far, ordered by pass id. While running this grows as passes finish; on completion it holds every 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
IReadOnlyList<OptimizationPass> Passes {get;}
optimizationProcess.Passes: Sequence[OptimizationPass]
Returns IReadOnlyList<OptimizationPass>
Examples
Optimization.Completed += args =>
{
var profitablePasses = args.Process.Passes.Count(pass => pass.NetProfit > 0);
Print("{0} of {1} passes were profitable", profitablePasses, args.Process.Passes.Count);
};
def on_start(self):
api.Optimization.Completed += self.on_optimization_completed
def on_optimization_completed(self, args):
profitablePasses = len([p for p in args.Process.Passes if p.NetProfit > 0])
api.Print(f"{profitablePasses} of {args.Process.Passes.Count} passes were profitable")