Class PDPState

java.lang.Object
org.ddolib.examples.pdp.PDPState

public class PDPState extends Object
Represents the state of a Pickup and Delivery Problem (PDP) during the search process.

A PDPState stores the nodes that can still be visited, all unvisited nodes, the current node (or nodes in case of state fusion), and information about the vehicle content (min and max) to track capacity constraints.

This class is used by search algorithms such as ACS, A*, and DDO to represent partial solutions and manage state transitions efficiently.

  • Constructor Details

    • PDPState

      public PDPState(BitSet current, BitSet openToVisit, BitSet allToVisit, int minContent, int maxContent)
      Constructs a PDPState.
      Parameters:
      current - the current node(s) of the vehicle
      openToVisit - nodes that can currently be visited
      allToVisit - all nodes that have not yet been visited
      minContent - minimum vehicle content
      maxContent - maximum vehicle content
  • Method Details

    • uncertaintyOnContent

      public int uncertaintyOnContent()
      Computes the uncertainty on the vehicle content, defined as maxContent - minContent.
      Returns:
      the difference between maximum and minimum vehicle content
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • singleton

      public BitSet singleton(int singletonValue)
      Returns a BitSet containing a single value.
      Parameters:
      singletonValue - the value to set in the BitSet
      Returns:
      a BitSet with only the specified value set
    • toString

      public String toString()
      Overrides:
      toString in class Object