on_function_eval#

JSONLogger.on_function_eval(project, eval_num, params, fom_value, gradient, **kwargs)#

Append one evaluation record to the in-memory history.

Three parallel lists are extended (fom_history, param_history, eval_times), and the running-best entry in best_fom is updated incrementally in O(1). The data is only flushed to disk in on_optimization_end() (or save_early_exit() on a crash) – per-eval writes would amplify I/O for long runs.

Parameters:
projectProject

The optimization project.

eval_numint

1-indexed evaluation number.

paramsnp.ndarray

Parameter vector for this evaluation; copied before storing so subsequent in-place mutations by the caller do not corrupt the history.

fom_valuefloat

FOM value produced by this evaluation.

gradientnp.ndarray, optional

Gradient (if available); not stored in the JSON output.

**kwargs

Additional information. Recognised keys are elapsed_time (wall-clock seconds for this eval, default 0.0) and grad_eval_count (cumulative adjoint count at this eval, default 0).