protocol
local_optimization_problem_protocol
Protocol for continuous local-optimization problem definitions. A problem object must define the required predicates and may optionally define gradient, Hessian, bounds, stopping, and progress predicates. The same problem object can be used by any solver in the local_optimization library and by the existing global metaheuristics (PSO, DE, …).
logtalk_load(local_optimization(loader))staticPublic predicates
initial_point/1
Returns a starting point for the local search. The point must be a non-empty list of numbers. When position bounds are defined, the point must lie inside those bounds.
staticinitial_point(Point)initial_point(-list(number)) - oneobjective/2
Computes the objective (cost) value of a point. Solvers minimize this value by default; use the objective(maximize) option to maximize it instead. The returned value must be a number.
staticobjective(Point,Value)objective(+list(number),-number) - onegradient/2
Optional. Computes the gradient of the objective at a point. Required by gradient-based solvers (gradient descent, conjugate gradient, BFGS, …). When not defined those solvers raise an existence error. The returned vector must have the same length as the point.
staticgradient(Point,Gradient)gradient(+list(number),-list(number)) - zero_or_onehessian/2
Optional for most solvers. Computes the Hessian matrix of the objective at a point (list of rows). Required by trust-region Newton-CG; when not defined that solver raises an existence error. Not used by any other solver.
statichessian(Point,Hessian)hessian(+list(number),-list(list(number))) - zero_or_oneposition_bounds/1
Optional. Returns one Lower-Upper numeric bound pair per dimension, with Lower =< Upper. When defined, solvers that support bounds project or clamp trial points onto the box. When not defined the search is treated as unbounded.
staticposition_bounds(Bounds)position_bounds(-list(pair)) - zero_or_onestop_condition/3
Optional. True when the search should stop given the completed iteration count, the current best point, and its objective value. When not defined the solver runs until its own termination criteria (maximum iterations, tolerances, …) are met.
staticstop_condition(Iteration,BestPoint,BestValue)stop_condition(+non_negative_integer,+list(number),+number) - zero_or_oneprogress/5
Optional. Called periodically to report progress. Arguments are the completed iteration count, current best point, best objective value, a solver-specific measure of step size or gradient norm, and the number of objective evaluations so far. A final call is made when the solver terminates if progress reporting is enabled.
staticprogress(Iteration,BestPoint,BestValue,Measure,Evaluations)progress(+non_negative_integer,+list(number),+number,+number,+number) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)