category

local_optimization_solver(Problem)

  • Problem - Problem object implementing local_optimization_problem_protocol.

Common code for local-optimization solvers: option handling, objective-direction helpers, bound projection, vector utilities, progress reporting, and basic validation. Concrete solvers import this category and implement the search loop.

Availability:
logtalk_load(local_optimization(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-08-24
Compilation flags:
static
Extends:
public options
Uses:
Remarks:
(none)

Public predicates

run/2

Runs the solver with default options and returns the best point and objective value found.

Compilation flags:
static
Template:
run(BestPoint,BestValue)
Mode and number of proofs:
run(-list(number),-number) - one

run/3

Runs the solver with the given options and returns the best point and objective value found.

Compilation flags:
static
Template:
run(BestPoint,BestValue,Options)
Mode and number of proofs:
run(-list(number),-number,+list(compound)) - one

run/4

Runs the solver with the given options and returns the best point, objective value, and run statistics.

Compilation flags:
static
Template:
run(BestPoint,BestValue,Statistics,Options)
Mode and number of proofs:
run(-list(number),-number,-list(compound),+list(compound)) - one

Protected predicates

initial_point/2

Returns the initial point defined by the initial_point/1 option if present. Otherwise returns the problem defined initial point.

Compilation flags:
static
Template:
initial_point(Options,Point)
Mode and number of proofs:
initial_point(+list(compound),-list(number)) - one

better_value/3

True when Value is strictly better than Reference according to the optimization direction.

Compilation flags:
static
Template:
better_value(Objective,Value,Reference)
Mode and number of proofs:
better_value(+atom,+number,+number) - zero_or_one

target_reached/3

True when the current value has reached or passed the optional target in the selected direction.

Compilation flags:
static
Template:
target_reached(Objective,Value,Target)
Mode and number of proofs:
target_reached(+atom,+number,+term) - zero_or_one

project_to_bounds/3

Clamps each component of a point to the corresponding Low-High interval. When Bounds is empty the point is returned unchanged.

Compilation flags:
static
Template:
project_to_bounds(Point,Bounds,Projected)
Mode and number of proofs:
project_to_bounds(+list(number),+list(pair),-list(number)) - one

check_bounds/1

Checks that the bounds are valid.

Compilation flags:
static
Template:
check_bounds(Bounds)
Mode and number of proofs:
check_bounds(+list(pair)) - one_or_error
Exceptions:
Bounds is a variable:
instantiation_error
Bounds is neither a variable nor a valid list of bounds:
domain_error(position_bounds,Bounds)

check_point/2

Checks that the bounds are valid. Assumes Point is already checked to be a list of numbers.

Compilation flags:
static
Template:
check_point(Point,Bounds)
Mode and number of proofs:
check_point(+list(number),+list(pair)) - one_or_error
Exceptions:
Point is not a valid point:
domain_error(initial_point,Point)

report_progress/6

Reports solver progress by calling progress_hook/5 if defined.

Compilation flags:
static
Template:
report_progress(Iteration,UpdateInterval,BestPoint,BestValue,Measure,Evaluations)
Mode and number of proofs:
report_progress(+non_negative_integer,+non_negative_integer,+list(number),+number,+number,+non_negative_integer) - one

report_final/5

Reports the final solver solution by calling progress_hook/5 if defined.

Compilation flags:
static
Template:
report_final(Iteration,UpdateInterval,BestPoint,BestValue,Measure)
Mode and number of proofs:
report_final(+non_negative_integer,+non_negative_integer,+list(number),+number,+number) - one

progress_hook/5

User-defined hook predicate to report a solver step.

Compilation flags:
static
Template:
progress_hook(Iteration,BestPoint,BestValue,Measure,Evaluations)
Mode and number of proofs:
progress_hook(+non_negative_integer,+list(number),+number,+number,+non_negative_integer) - zero_or_one

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)