protocol
ant_colony_problem_protocol
Protocol for ant colony optimization problem definitions. A problem object must define the required predicates for constructive solution building on a construction graph (typically a complete graph over a set of nodes, as in the TSP). Optional predicates allow custom stopping and progress reporting.
logtalk_load(ant_colony(loader))staticPublic predicates
nodes/1
Returns the ordered list of nodes that form the construction graph. Solutions are permutations (or paths) over these nodes.
staticnodes(Nodes)nodes(-list) - oneheuristic/3
Returns the heuristic desirability Eta of moving from From to To. Typically the reciprocal of a distance or cost. Must be strictly positive for every pair that can appear in a solution.
staticheuristic(From,To,Eta)heuristic(+nonvar,+nonvar,-number) - onesolution_cost/2
Computes the cost (energy) of a complete solution (tour/path). The algorithm minimizes this value.
staticsolution_cost(Solution,Cost)solution_cost(+list,-number) - onestop_condition/3
True when the search should stop given the current iteration, best cost found so far, and the cost of the iteration-best solution. Optional. When not defined by the problem, the search runs until the maximum number of iterations is reached.
staticstop_condition(Iteration,BestCost,IterationBestCost)stop_condition(+non_negative_integer,+number,+number) - zero_or_oneprogress/5
Called periodically to report optimization progress. Optional. When not defined by the problem, progress reporting is skipped. The rates are values between 0.0 and 1.0.
staticprogress(Iteration,BestCost,IterationBestCost,AcceptanceRate,ImprovementRate)progress(+non_negative_integer,+number,+number,+number,+number) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)
See also