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 enumclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFields inherited from class es.urjc.etsii.grafo.solution.Solution
lastModifiedTime, lastMoves -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignNormal(int driver, int position, int customer, double cost) voidassignOD(int driver, int customer) voidassignOD(int driver, int customer, double cost) booleancanCarry(int driver, int customer) Check if a normal driver, or a normal route, can allocate the given customerClone the current solution.voiddeassign(int client) doublegetAssignCostNormal(int driver, int customer) How expensive is assigning a customer to the given driver.doublegetAssignCostOD(int driver, int customer) getAvailableNormalDriversFor(int customer) Returns the possible store or normal drivers for a given customergetAvailableODDriversFor(int client) doublegetInsertCost(int driver, int position, int customer) intlongdoubleGet the current optimal valuedoublegetRemoveCost(int driver, int position, int customer) doublegetScore()booleanisAssigned(int customer) doublevoidrevertAssignNormal(int driver, int customer, double cost) voidrevertAssignOD(int driver, int client, double cost) voidsaveRAM()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:SolutionClone the current solution. Deep clone mutable data or you will regret it.- Specified by:
cloneSolutionin classSolution<VRPODSolution,VRPODInstance> - Returns:
- A deep clone of the current solution
-
getScore
public double getScore() -
recalculateScore
public double recalculateScore() -
toString
Description copied from class:SolutionResume this solution Generate a toString method using your IDE- Specified by:
toStringin classSolution<VRPODSolution,VRPODInstance> - Returns:
- string representation of the current solution
-