Class VRPODSolution

java.lang.Object
es.urjc.etsii.grafo.solution.Solution<VRPODSolution,VRPODInstance>
es.urjc.etsii.grafo.vrpod.model.solution.VRPODSolution

public class VRPODSolution extends Solution<VRPODSolution,VRPODInstance>
  • Field Details

  • Constructor Details

  • Method Details

    • getNormalDrivers

      public List<VRPODSolution.Route> getNormalDrivers()
    • getUnassignedClients

      public Set<Integer> 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

      public Set<Integer> getAvailableNormalDriversFor(int customer)
      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

      public List<Integer> getAvailableODDriversFor(int client)
    • 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 driver
      customer - 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

      public Set<Integer> 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

      public VRPODSolution cloneSolution()
      Description copied from class: Solution
      Clone the current solution. Deep clone mutable data or you will regret it.
      Specified by:
      cloneSolution in class Solution<VRPODSolution,VRPODInstance>
      Returns:
      A deep clone of the current solution
    • getScore

      public double getScore()
    • recalculateScore

      public double recalculateScore()
    • toString

      public String toString()
      Description copied from class: Solution
      Resume this solution Generate a toString method using your IDE
      Specified by:
      toString in class Solution<VRPODSolution,VRPODInstance>
      Returns:
      string representation of the current solution