|
5 ay önce | |
---|---|---|
.. | ||
src | 5 ay önce | |
Cargo.lock | 5 ay önce | |
Cargo.toml | 5 ay önce | |
README.md | 5 ay önce | |
example.cmd | 5 ay önce | |
example.sh | 5 ay önce |
Команда запуска с cargo: cargo run -q -- -a=1 -b=2 -e=0.1 -i=100 -n=20 -q=100 1-2=10 1-3=15 1-4=20 2-4=25 2-3=35 3-4=30
Команда запуска исходника: ant-colony.exe -a=1 -b=2 -e=0.1 -i=100 -n=20 -q=100 1-2=10 1-3=15 1-4=20 2-4=25 2-3=35 3-4=30
Пример вывода:
Best path: 1 -> 2 -> 4 -> 3 -> 1
1-2=10 (pheromone: 307.674). Cumulative length: 10
2-4=25 (pheromone: 307.668). Cumulative length: 35
4-3=30 (pheromone: 307.681). Cumulative length: 65
3-1=15 (pheromone: 0.006). Cumulative length: 80
Total path length: . . . . . 80
cargo run -- --help
/ ant-colony.exe --help
--alpha
, -a
--beta
, -b
--evaporation
, -e
--iterations
, -i
--ants
, -n
-q
A-B=расстояние
!! Стартовой точкой считается самая первая вершина в списке ребер (в примере - 1)Пример: ant-colony.exe -a=1 -b=2 -e=0.1 -i=100 -n=20 -q=100 1-2=10 1-3=15 1-4=20 2-4=25 2-3=35 3-4=30
cargo run -- <параметры> <ребра>