Class NodeKey

  • All Implemented Interfaces:
    java.lang.Comparable<NodeKey>

    public final class NodeKey
    extends java.lang.Object
    implements java.lang.Comparable<NodeKey>
    • Field Detail

      • EARLIEST_SEQUENCE

        public static final java.util.Comparator<NodeKey> EARLIEST_SEQUENCE
      • LARGEST_DISPLACEMENT

        public static final java.util.Comparator<NodeKey> LARGEST_DISPLACEMENT
      • LATEST_SEQUENCE

        public static final java.util.Comparator<NodeKey> LATEST_SEQUENCE
      • MAX_OBJECTIVE

        public static final java.util.Comparator<NodeKey> MAX_OBJECTIVE
      • MIN_OBJECTIVE

        public static final java.util.Comparator<NodeKey> MIN_OBJECTIVE
      • SMALLEST_DISPLACEMENT

        public static final java.util.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 java.util.concurrent.atomic.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.
      • myLowerBounds

        private final int[] myLowerBounds
      • mySignChanged

        private final boolean mySignChanged
      • myUpperBounds

        private final int[] myUpperBounds
    • Constructor Detail

      • NodeKey

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

      • compareTo

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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

        private void append​(java.lang.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()
      • equals

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

        java.math.BigDecimal getLowerBound​(int idx)
      • getMinimumDisplacement

        double getMinimumDisplacement​(int idx,
                                      double value)
      • getUpperBound

        java.math.BigDecimal getUpperBound​(int idx)
      • isSignChanged

        boolean isSignChanged()