Package org.ddolib.examples.pdp
Class PDPState
java.lang.Object
org.ddolib.examples.pdp.PDPState
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 Summary
Constructors -
Method Summary
-
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 vehicleopenToVisit- nodes that can currently be visitedallToVisit- all nodes that have not yet been visitedminContent- minimum vehicle contentmaxContent- maximum vehicle content
-
-
Method Details
-
uncertaintyOnContent
public int uncertaintyOnContent()Computes the uncertainty on the vehicle content, defined asmaxContent - minContent.- Returns:
- the difference between maximum and minimum vehicle content
-
hashCode
public int hashCode() -
equals
-
singleton
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
-