Skip to content

OptimizationCompletedEventArgs.JsonReport

property · OptimizationCompletedEventArgs · cAlgo.API Since 5.9

DesktopCLICloud

Gets the full optimization result as JSON (the .optres content).

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 string JsonReport {get;}
optimizationCompletedEventArgs.JsonReport: str

Returns string

Examples

protected override void OnStart()
{
    Optimization.Completed += OnOptimizationCompleted;
}

private void OnOptimizationCompleted(OptimizationCompletedEventArgs args)
{
    if (args.JsonReport != null)
        LocalStorage.SetString("LastOptimizationResult", args.JsonReport);
}
def on_start(self):
    api.Optimization.Completed += self.on_optimization_completed

def on_optimization_completed(self, args):
    if args.JsonReport is not None:
        api.LocalStorage.SetString("LastOptimizationResult", args.JsonReport)