
xf.xfvrp.opt.construct.SavingsDataBag Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xfvrp Show documentation
Show all versions of xfvrp Show documentation
Solver for realistic vehicle routing problems
package xf.xfvrp.opt.construct;
import java.util.ArrayList;
import java.util.List;
import xf.xfvrp.base.Node;
public class SavingsDataBag {
private List nodeList = new ArrayList<>();
private int[] routeIdxForStartNode;
private int[] routeIdxForEndNode;
private List savingsMatrix = new ArrayList<>();
private Node[][] routes;
public void addSaving(int srcIdx, int dstIdx, float potential) {
savingsMatrix.add(new float[] {srcIdx, dstIdx, 1000f / potential});
}
public List getNodeList() {
return nodeList;
}
public void setNodeList(List nodeList) {
this.nodeList = nodeList;
}
public int[] getRouteIdxForStartNode() {
return routeIdxForStartNode;
}
public void setRouteIdxForStartNode(int[] routeIdxForStartNode) {
this.routeIdxForStartNode = routeIdxForStartNode;
}
public int[] getRouteIdxForEndNode() {
return routeIdxForEndNode;
}
public void setRouteIdxForEndNode(int[] routeIdxForEndNode) {
this.routeIdxForEndNode = routeIdxForEndNode;
}
public List getSavingsMatrix() {
return savingsMatrix;
}
public Node[][] getRoutes() {
return routes;
}
public void setRoutes(Node[][] routes) {
this.routes = routes;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy