object
tabu_search(Problem,Random)
Problem- Problem object implementingtabu_search_problem_protocol.Random- Random number generator object providingbetween/3,randomize/1,permutation/2, andsample/4predicates.
Tabu search optimization algorithm. Parameterized by a problem object implementing the tabu_search_problem_protocol protocol and by a random number generator algorithm for the fast_random library. Minimizes energy with optional problem-defined tabu keys, tenure, aspiration, restart states, neighbor generation, stopping, and progress reporting.
logtalk_load(tabu_search(loader))static, context_switching_callsPublic predicates
run/2
Runs the tabu search algorithm using default options and returns the best state found and its energy.
staticrun(BestState,BestEnergy)run(-nonvar,-number) - onedomain_error(tabu_hook_result,Result)run/3
Runs the tabu search algorithm using the given options and returns the best state found and its energy.
staticrun(BestState,BestEnergy,Options)run(-nonvar,-number,+list(compound)) - onedomain_error(option,Option)existence_error(procedure,Problem::neighbors/2)domain_error(tabu_hook_result,Result)
max_steps(N)option: Maximum number of iterations per cycle (default:10000).
tabu_tenure(T)option: Fixed lifetime in selection steps (default:7). Ignored when a range or a problemtabu_tenure/4implementation is present.
tabu_tenure_range(Min, Max)option: Uniform random tenure in the inclusive integer range. Overrides fixed tenure; ignored when the problem implementstabu_tenure/4.
candidates(N)option: Number of candidate neighbors examined per iteration (default:20).
exhaustive(Boolean)option: Evaluates the fullneighbors/2list in source order when true, ignoring the candidate limit (default:false). Requires implemented enumeration.
updates(N)option: Number of progress reports during the run. Set to0to disable. Progress is reported by callingprogress/5on the problem object (default:0).
seed(S)option: Positive integer seed for the random number generator, enabling reproducible runs (default: none).
restarts(N)option: Number of additional cycles (default:0). Clears memory and usesrestart_state/2when implemented, otherwise the global best state.
run/4
Runs the tabu search algorithm using the given options, returns the best state found and its energy, and returns run statistics.
staticrun(BestState,BestEnergy,Statistics,Options)run(-nonvar,-number,-list(compound),+list(compound)) - onedomain_error(option,Option)existence_error(procedure,Problem::neighbors/2)domain_error(tabu_hook_result,Result)
Statistics list: A list of
Key(Value)pairs:steps(N)is the number of steps executed,acceptances(A)is the number of accepted moves,improvements(I)is the number of moves that improved the best energy, andfinal_tabu_size(S)is the number of non-expired tabu entries at termination.
Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
select_candidate/10
Selects the best admissible candidate using the cached run policy.
staticselect_candidate(Policy,State,Energy,BestEnergy,Tabu,Step,Candidates,Neighbor,NeighborEnergy,Accepted)select_candidate(+compound,+nonvar,+number,+number,+list,+non_negative_integer,+positive_integer,-nonvar,-number,-boolean) - onedomain_error(tabu_hook_result,neighbors/2)domain_error(tabu_hook_result,Result)require_neighborhood/2
Checks the implementation required for exhaustive evaluation.
staticrequire_neighborhood(Exhaustive,Problem)require_neighborhood(+boolean,+object_identifier) - oneexistence_error(procedure,Problem::neighbors/2)restart_candidate/7
Resolves a restart state and updates the global best independently.
staticrestart_candidate(Policy,Best,BestEnergy,State,Energy,NewBest,NewBestEnergy)restart_candidate(+compound,+nonvar,+number,-nonvar,-number,-nonvar,-number) - onedomain_error(tabu_hook_result,Result)state_key/3
Resolves an optional tabu key without copying the state.
staticstate_key(KeyHook,State,Key)state_key(+boolean,+nonvar,-nonvar) - onedomain_error(tabu_hook_result,Result)resolve_tenure/6
Resolves tenure with hook, range, then fixed-option precedence.
staticresolve_tenure(TenureHook,Specification,Step,BestEnergy,CurrentEnergy,Tenure)resolve_tenure(+boolean,+compound,+non_negative_integer,+number,+number,-non_negative_integer) - onedomain_error(tabu_hook_result,Result)Operators
(none)