Class VRPODSolution
java.lang.Object
es.urjc.etsii.grafo.solution.Solution<VRPODSolution,VRPODInstance>
es.urjc.etsii.grafo.vrpod.model.solution.VRPODSolution
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Fields inherited from class es.urjc.etsii.grafo.solution.Solution
lastModifiedTime, lastMoves
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignNormal
(int driver, int position, int customer, double cost) void
assignOD
(int driver, int customer) void
assignOD
(int driver, int customer, double cost) boolean
canCarry
(int driver, int customer) Check if a normal driver, or a normal route, can allocate the given customerClone the current solution.void
deassign
(int client) double
getAssignCostNormal
(int driver, int customer) How expensive is assigning a customer to the given driver.double
getAssignCostOD
(int driver, int customer) getAvailableNormalDriversFor
(int customer) Returns the possible store or normal drivers for a given customergetAvailableODDriversFor
(int client) double
getInsertCost
(int driver, int position, int customer) int
long
double
Get the current optimal valuedouble
getRemoveCost
(int driver, int position, int customer) double
getScore()
boolean
isAssigned
(int customer) double
void
revertAssignNormal
(int driver, int customer, double cost) void
revertAssignOD
(int driver, int client, double cost) void
saveRAM()
Metodo chapucero para ahorrar memoria cuando stackeamos miles de soluciones TODO un fix de verdadtoString()
Resume this solution Generate a toString method using your IDEMethods inherited from class es.urjc.etsii.grafo.solution.Solution
customProperties, getInstance, getLastModifiedTime, getVersion, lastExecutesMoves, lastExecutesMovesAsString, notifyUpdate, notifyUpdate
-
Field Details
-
NOT_ASSIGNED
public static final int NOT_ASSIGNED- See Also:
-
ins
-
otherData
-
-
Constructor Details
-
VRPODSolution
-
-
Method Details
-
getNormalDrivers
-
getUnassignedClients
-
canCarry
public boolean canCarry(int driver, int customer) Check if a normal driver, or a normal route, can allocate the given customer- Returns:
- True if the given driver can carry the packet for the given customer
-
getAvailableNormalDriversFor
Returns the possible store or normal drivers for a given customer- Parameters:
customer
- id of the customer- Returns:
- Set of Normal Drivers that can attent the given client
-
getAvailableODDriversFor
-
getOptimalValue
public double getOptimalValue()Get the current optimal value- Returns:
- the current optimal value
-
getAssignCostNormal
public double getAssignCostNormal(int driver, int customer) How expensive is assigning a customer to the given driver. Adds customer to the end of the route- Parameters:
driver
- id of the drivercustomer
- id of the customer- Returns:
- Cost of assigning a customer to a given driver, in the last position of the driver route
-
getAssignCostOD
public double getAssignCostOD(int driver, int customer) -
assignNormal
public void assignNormal(int driver, int position, int customer, double cost) -
revertAssignNormal
public void revertAssignNormal(int driver, int customer, double cost) -
assignOD
public void assignOD(int driver, int customer) -
assignOD
public void assignOD(int driver, int customer, double cost) -
revertAssignOD
public void revertAssignOD(int driver, int client, double cost) -
isAssigned
public boolean isAssigned(int customer) -
getNumberOfNormalDrivers
public int getNumberOfNormalDrivers() -
getNumberOfOdUsed
public long getNumberOfOdUsed() -
getUsedOds
-
getRemoveCost
public double getRemoveCost(int driver, int position, int customer) -
getInsertCost
public double getInsertCost(int driver, int position, int customer) -
deassign
public void deassign(int client) -
saveRAM
public void saveRAM()Metodo chapucero para ahorrar memoria cuando stackeamos miles de soluciones TODO un fix de verdad -
cloneSolution
Description copied from class:Solution
Clone the current solution. Deep clone mutable data or you will regret it.- Specified by:
cloneSolution
in classSolution<VRPODSolution,
VRPODInstance> - Returns:
- A deep clone of the current solution
-
getScore
public double getScore() -
recalculateScore
public double recalculateScore() -
toString
Description copied from class:Solution
Resume this solution Generate a toString method using your IDE- Specified by:
toString
in classSolution<VRPODSolution,
VRPODInstance> - Returns:
- string representation of the current solution
-