Class TSPState

java.lang.Object
org.ddolib.examples.nolayer.tsp.TSPState

public class TSPState extends Object
Represents a state in the Traveling Salesman Problem (TSP) for nolayer models.
  • Field Details

    • toVisit

      public BitSet toVisit
      Set of nodes that have not been visited yet.
    • current

      public BitSet current
      Current node(s). Usually a singleton, but can be multiple in merged states.
  • Constructor Details

    • TSPState

      public TSPState(BitSet current, BitSet toVisit)
      Constructs a new TSPState.
      Parameters:
      current - the current node(s)
      toVisit - the nodes that have not yet been visited
  • Method Details

    • 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)
      Creates a BitSet containing only the specified singleton value.
      Parameters:
      singletonValue - the value to set
      Returns:
      a BitSet with a single bit set
    • toString

      public String toString()
      Overrides:
      toString in class Object