makeACOTSPControl: Generates a control object for the 'runACOTSP' function.

Description Usage Arguments Value

View source: R/makeAntsControl.R

Description

This function generates a control object, i.e., internally a simple list, of parameters and does sanity checks.

Usage

1
2
3
4
5
6
7
makeACOTSPControl(n.ants = 2L, n.elite = n.ants, use.global.best = FALSE,
  best.deposit.only = FALSE, alpha = 1, beta = 2, rho = 0.1,
  att.factor = 1, init.pher.conc = 1e-04, min.pher.conc = 0,
  max.pher.conc = 1e+06, local.search.fun = NULL,
  local.search.step = integer(), prp.prob = 0,
  local.pher.update.fun = NULL, max.iter = 10L, max.time = Inf,
  global.opt.value = NULL, termination.eps = 0.1, trace.all = FALSE)

Arguments

n.ants

[integer(1)]
Number of ants. Positive integer.

n.elite

[integer(1)]
Number of “elite” ants. Only the n.elite best ants are allowed to deposit pheromones during the update phase. Must me lower than or equal to n.ants. Default is n.elite = n.ants.

use.global.best

[logical(1)]
Should the global best tour be used to update the pheromones? Default is FALSE. Keep in mind: if use.global.best is TRUE and n.elite is 0, only the global best tour (and consequently only the arcs of the global best tour) gain pheromones in each iteration.

best.deposit.only

[logical(1)]
Should only the arcs of the global “best-so-far” tour be affected by pheromone evaporation and deposit? Default is FALSE. This parameter has an effect if and only if use.global.best is TRUE.

alpha

[numeric(1)]
This parameter decides how much influence the pheromones on an edge have on the selection of edges. Default is 1.

beta

[numeric(1)]
This parameter decided how much influence the edge distances have on the selection of edges. Default is 2.

rho

[numeric(1)]
“Pheromone evaporation coefficient” respectively “evaporation rate”. In each iteration the pheromones on edge (i,j) are first decreased by (1 - rho) before ants deposit their pheromones on it. Must be in (0, 1). Default is 0.1.

att.factor

[numeric(1)]
This is the socalled “constant attractiveness factor”. Default is 1.

init.pher.conc

[numeric(1)]
Initial pheromone concentration for every single edge. Default is 0.0001.

min.pher.conc

[numeric(1)]
Minimal pheromone concentration for every single edge. Default is 0.

max.pher.conc

[numeric(1)]
Maximal pheromone concentration for every single edge. Default is 10e5.

local.search.fun

[function]
Local search procedure which should be applied to all ant tours every local.search.step iterations. The function must expect the TSP instance x as the first, the initial tour initial.tour as the second argument. Default is NULL, i.e., no local search at all.

local.search.step

[integer]
This parameter determines when to apply the local search procedure given by the local.search.fun function. If this is a single scalar value n, the local search is applied every n iterations. If a integer vector is passed, the local search procedure is called on exactly the given iterations. This parameter is considered only if local.search.step is not NULL. Default is the empty vector, which means no local search at all.

prp.prob

[numeric(1)]
Probability used in the pseudo-random-proportional action choice rule used, e.g., by the Ant Colony System. Default is 0, which means that the rule is not applied at all and the tour construction is done in the classical way.

local.pher.update.fun

[function]
Local (pheromone) update rule applied right after an ant crossed an edge. Default is NULL, which means no local update at all. This must be a function which expects a single parameter pher.

max.iter

[integer(1)]
Maximal number of iterations. Default is 10.

max.time

[integer(1)]
Maximum running time in seconds. The algorithm tries hard to hold this restriction by logging the times of a number of prior iterations and determining statistically whether the time limit can be hold when another iteration is done. Default ist Inf, which means no time limit at all.

global.opt.value

[numeric(1)]
Known global best tour length. This can be used as another termination criterion. Default is NULL, which means, that the length of the globally best tour is unknown.

termination.eps

[numeric(1)]
If global.opt.value is set, the algorithm stops if the quadratic distance between the global optimum value and the value of the best tour found so far is lower than these gap value. Ignored if global.opt.value is NULL.

trace.all

[logical(1)]
Should we save additional information in each iteration, i. e., pheromone matrix, all ant trails, best ant trail of the current iteration and so on? Default is FALSE. You need to set this to TRUE if you want to plot the optimization progress via autoplot.AntsResult.

Value

[ACOTSPControl] S3 control object containing all the checked parameters and reasonable defaults.


jakobbossek/acotsp documentation built on May 18, 2019, 9:08 a.m.