Class NodeKey

java.lang.Object
org.ojalgo.optimisation.integer.NodeKey
All Implemented Interfaces:
Comparable<NodeKey>

public final class NodeKey extends Object implements Comparable<NodeKey>
  • Field Details

    • EARLIEST_SEQUENCE

      public static final Comparator<NodeKey> EARLIEST_SEQUENCE
    • LARGEST_DISPLACEMENT

      public static final Comparator<NodeKey> LARGEST_DISPLACEMENT
    • LATEST_SEQUENCE

      public static final Comparator<NodeKey> LATEST_SEQUENCE
    • MAX_OBJECTIVE

      public static final Comparator<NodeKey> MAX_OBJECTIVE
    • MIN_OBJECTIVE

      public static final Comparator<NodeKey> MIN_OBJECTIVE
    • SMALLEST_DISPLACEMENT

      public static final Comparator<NodeKey> SMALLEST_DISPLACEMENT
    • FEASIBILITY

      private static final NumberContext FEASIBILITY
      Used for one thing only - to validate (log problems with) node solver results. Does not effect the algorithm.
    • SEQUENCE_GENERATOR

      private static final AtomicLong SEQUENCE_GENERATOR
    • displacement

      public final double displacement
      How much the branched on variable must be displaced because of the new constraint introduced with this node (each node introduces precisely 1 new upper or lower bound).
    • index

      public final int index
      The index of the branched on variable.
    • objective

      public final double objective
      The objective function value of the parent node.
    • parent

      public final long parent
      Parent node sequence number.
    • sequence

      public final long sequence
      Node sequence number to keep track of in which order the nodes were created.
    • myIntArrayPool

      private final NodeKey.IntArrayPool myIntArrayPool
    • myLowerBounds

      private final int[] myLowerBounds
    • mySignChanged

      private final boolean mySignChanged
    • myUpperBounds

      private final int[] myUpperBounds
  • Constructor Details

    • NodeKey

      private NodeKey(int[] lowerBounds, int[] upperBounds, long parentSequenceNumber, int integerIndexBranchedOn, double branchVariableDisplacement, double parentObjectiveFunctionValue, boolean signChanged, NodeKey.IntArrayPool pool)
    • NodeKey

      NodeKey(ExpressionsBasedModel integerModel)
  • Method Details

    • compareTo

      public int compareTo(NodeKey ref)
      Specified by:
      compareTo in interface Comparable<NodeKey>
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
    • append

      private void append(StringBuilder builder, int idx)
    • feasible

      private double feasible(int idx, double value, boolean validate)
    • calculateTreeSize

      long calculateTreeSize()
    • copyLowerBounds

      int[] copyLowerBounds()
    • copyUpperBounds

      int[] copyUpperBounds()
    • createLowerBranch

      NodeKey createLowerBranch(int branchIntegerIndex, double value, double objVal)
    • createUpperBranch

      NodeKey createUpperBranch(int branchIntegerIndex, double value, double objVal)
    • dispose

      void dispose()
    • enforceBounds

      void enforceBounds(ExpressionsBasedModel model, int idx, ModelStrategy strategy)
    • enforceBounds

      void enforceBounds(NodeSolver nodeSolver, ModelStrategy strategy)
    • equals

      boolean equals(int[] lowerBounds, int[] upperBounds)
    • getLowerBound

      BigDecimal getLowerBound(int idx)
    • getMinimumDisplacement

      double getMinimumDisplacement(int idx, double value)
    • getUpperBound

      BigDecimal getUpperBound(int idx)
    • isSignChanged

      boolean isSignChanged()
    • setNodeState

      void setNodeState(ExpressionsBasedModel model, ModelStrategy strategy)