Description Usage Arguments Examples
Computes fitness of a solution. It handles vehicle capacity.
1 |
sol |
Solution vector |
vc |
Vehicle capacity |
route |
Logical variable. If TRUE, |
1 2 3 4 5 6 7 8 | locations <- An32k5locations
demand <- An32k5demand
sol <- sample(nrow(locations)-1, nrow(locations)-1)
vc <- 100
DMat <- as.matrix(dist(locations[, -1], upper = TRUE, diag = TRUE))
row.names(DMat) <- c(0, 1:(nrow(demand)-1))
colnames(DMat) <- c(0, 1:(nrow(demand)-1))
fitness(sol, vc, demand, DMat, route = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.