fitness: Computes fitness of a solution. It handles vehicle capacity.

Description Usage Arguments Examples

Description

Computes fitness of a solution. It handles vehicle capacity.

Usage

1
fitness(sol, vc, demand, DMat, route = FALSE)

Arguments

sol

Solution vector

vc

Vehicle capacity

route

Logical variable. If TRUE,

Examples

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)

kavetinaveen/HeuristicsVRP documentation built on May 20, 2019, 7:53 a.m.