Class VRPODInstance
java.lang.Object
es.urjc.etsii.grafo.io.Instance
es.urjc.etsii.grafo.vrpod.model.instance.VRPODInstance
- All Implemented Interfaces:
Comparable<Instance>
- Direct Known Subclasses:
VRPODInstanceProfitODDependant
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[][]
Distances between all destinations, _dist[0][2] returns the distance between the vertex 0 (the warehouse) and vertex 2 (a customer).protected int
Capacity of each vehicle used, each destination has an associated cost, the vehicle route must:capacity < sum(each destination cost)
protected static final Pattern
protected final String
Generator name, extracted from the filename.protected static final Comparator
<VRPODInstance> protected Location[]
protected final String
Instance nameprotected int
Number of destinations where we have to make a delivery +1, the origin counts as a destinationprotected final int
Each occasional driver can potentially deliver a packet to a set of customers, as long as the total distance does not exceed a preconfigured marginprotected Point2D[]
Occasional driver destination coordinatesprotected int[]
Weigth of the packet to deliverprotected final double
Rho value, extracted from the filename. 0.2, 0.05, 1.2, etc.protected final double
Zeta value, extracted from the filename. 1.1, 1.2, etcFields inherited from class es.urjc.etsii.grafo.io.Instance
LOAD_TIME_NANOS
-
Constructor Summary
ConstructorsConstructorDescriptionVRPODInstance
(String name, int numOccasionalDrivers, int capacity, int numberOfDestinations) -
Method Summary
Modifier and TypeMethodDescriptionint
Sort instances in this order: by od, rho, zeta, generator typeprotected void
Computation of Euclidean distances among all vertices.protected double
distanceBetween
(Point2D a, Point2D b) Calculate the Euclidean distance between two pointsint
int
Returns the capacity of the regular vehicles.getClientsOfOccasionalDriver
(int driver) Returns the set of locations that an ocassional driver can attendabstract double
getCost
(int od, int customer) Get the profit an OD would get if he(she delivers the packet to the given customerdouble
getDistance
(int a, int b) Returns the distance between the given elements (vertices)protected Location[]
getName()
int
Returns the number of locationsint
Returns the total number of nodes (including the depot)int
Returns the number of occasional drivers that are available in this instance.getOdsOfClient
(int client) Returns the set of ocasional drivers that can attend a given customerint
getPacketSize
(int client) Returns the packetSizes of the given customer id.int
double
getRho()
double
getZeta()
protected void
initializeClients
(Point2D[] clientsCoordinates) protected void
Methods inherited from class es.urjc.etsii.grafo.io.Instance
customProperties, equals, getId, getPath, getProperty, getPropertyOrDefault, getUniquePropertiesKeys, hashCode, resetProperties, setPath, setProperty, toString
-
Field Details
-
FILE_PATTERN
-
INSTANCE_COMPARATOR
-
numOcassionalDrivers
protected final int numOcassionalDrivers -
rho
protected final double rhoRho value, extracted from the filename. 0.2, 0.05, 1.2, etc. -
zeta
protected final double zetaZeta value, extracted from the filename. 1.1, 1.2, etc -
generator
Generator name, extracted from the filename. C101, C102... RC201 -
name
Instance name -
numberOfDestinations
protected int numberOfDestinationsNumber of destinations where we have to make a delivery +1, the origin counts as a destination -
capacity
protected int capacityCapacity of each vehicle used, each destination has an associated cost, the vehicle route must:capacity < sum(each destination cost)
-
_dist
protected double[][] _distDistances between all destinations, _dist[0][2] returns the distance between the vertex 0 (the warehouse) and vertex 2 (a customer). -
locations
-
packetSizes
protected int[] packetSizesWeigth of the packet to deliver -
odsCoordinates
Occasional driver destination coordinates -
ods2Clients
Each occasional driver can potentially deliver a packet to a set of customers, as long as the total distance does not exceed a preconfigured margin -
clients2Ods
-
-
Constructor Details
-
VRPODInstance
-
-
Method Details
-
getLocations
-
computeDistances
protected void computeDistances()Computation of Euclidean distances among all vertices. -
distanceBetween
Calculate the Euclidean distance between two points- Parameters:
a
- First point, array of coordinatesb
- Second point, array of coordinates- Returns:
- The Euclidean distance between the two points
- Throws:
AssertionError
- If any point is null or the points have different number of dimensions
-
initializeClients
-
inverseOds2Customer
protected void inverseOds2Customer() -
getNumberOfDestinations
public int getNumberOfDestinations()Returns the total number of nodes (including the depot)- Returns:
-
getNumberOfClients
public int getNumberOfClients()Returns the number of locations- Returns:
- Number of locations
-
getNumOccasionalDrivers
public int getNumOccasionalDrivers()Returns the number of occasional drivers that are available in this instance.- Returns:
-
getClientsOfOccasionalDriver
Returns the set of locations that an ocassional driver can attend- Parameters:
driver
-
-
getOdsOfClient
Returns the set of ocasional drivers that can attend a given customer- Parameters:
client
-
-
getPacketSize
public int getPacketSize(int client) Returns the packetSizes of the given customer id.- Parameters:
client
-- Returns:
-
getCapacity
public int getCapacity()Returns the capacity of the regular vehicles.- Returns:
-
getCost
public abstract double getCost(int od, int customer) Get the profit an OD would get if he(she delivers the packet to the given customer- Parameters:
od
- The ocassional driver idcustomer
- The customer id- Returns:
- The profit
-
getDistance
public double getDistance(int a, int b) Returns the distance between the given elements (vertices)- Parameters:
a
-b
-- Returns:
-
getName
-
getRho
public double getRho() -
getZeta
public double getZeta() -
getGenerator
-
getRecommendedNumberOfShakes
public int getRecommendedNumberOfShakes() -
compareTo
Sort instances in this order: by od, rho, zeta, generator type- Specified by:
compareTo
in interfaceComparable<Instance>
- Overrides:
compareTo
in classInstance
-
generatorType
public int generatorType()
-