Skip to content

ACO

python_motion_planning.global_planner.evolutionary_search.aco.ACO

Bases: EvolutionarySearcher

Class for Ant Colony Optimization(ACO) motion planning.

Parameters:

Name Type Description Default
start tuple

start point coordinate

required
goal tuple

goal point coordinate

required
env Env

environment

required
heuristic_type str

heuristic function type, default is euclidean

'euclidean'
n_ants int

number of ants

50
alpha float

pheromone and heuristic factor weight coefficient

1.0
beta float

pheromone and heuristic factor weight coefficient

5.0
rho float

evaporation coefficient

0.1
Q float

pheromone gain

1.0
max_iter int

maximum iterations

100

Examples:

Python Console Session
>>> import python_motion_planning as pmp
>>> planner = pmp.ACO((5, 5), (45, 25), pmp.Grid(51, 31))
>>> cost, path, cost_list = planner.plan()     # planning results only
>>> planner.plot.animation(path, str(planner), cost, cost_curve=cost_list)  # animation
>>> planner.run()       # run both planning and animation
References

[1] Ant Colony Optimization: A New Meta-Heuristic

getNeighbor(node)

Find neighbors of node.

Parameters:

Name Type Description Default
node Node

current node

required

Returns:

Name Type Description
neighbors list

neighbors of current node

plan()

Ant Colony Optimization(ACO) motion plan function.

Returns:

Name Type Description
cost float

path cost

path list

planning path

run()

Running both plannig and animation.