Class NodeKey
java.lang.Object
org.ojalgo.optimisation.integer.NodeKey
- All Implemented Interfaces:
Comparable<NodeKey>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<NodeKey> final intHow far have we branched from the rootstatic final Comparator<NodeKey> final doubleHow 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).private static final NumberContextUsed for one thing only - to validate (log problems with) node solver results.static final Comparator<NodeKey> final intThe index of the branched on variable.static final Comparator<NodeKey> static final Comparator<NodeKey> static final Comparator<NodeKey> static final Comparator<NodeKey> (package private) static final doubleprivate final NodeKey.IntArrayPoolprivate final int[]private final booleanprivate final int[]private final booleanfinal doubleThe objective function value of the parent node.final longParent node sequence number.final longNode sequence number to keep track of in which order the nodes were created.private static final AtomicLongstatic final Comparator<NodeKey> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNodeKey(int[] lowerBounds, int[] upperBounds, long parentSequenceNumber, int parentDepth, int integerIndexBranchedOn, double branchVariableDisplacement, double parentObjectiveFunctionValue, boolean signChanged, boolean upperBranch, NodeKey.IntArrayPool pool) (package private)NodeKey(ExpressionsBasedModel integerModel) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappend(StringBuilder builder, int idx) (package private) longint(package private) int[](package private) int[](package private) NodeKeycreateLowerBranch(int branchIntegerIndex, double value, double objVal) (package private) NodeKeycreateUpperBranch(int branchIntegerIndex, double value, double objVal) (package private) voiddispose()(package private) voidenforceBounds(ExpressionsBasedModel model, int idx, ModelStrategy strategy) (package private) voidenforceBounds(NodeSolver nodeSolver, ModelStrategy strategy) (package private) booleanequals(int[] lowerBounds, int[] upperBounds) booleanprivate doublefeasible(int idx, double value, boolean validate) (package private) BigDecimalgetLowerBound(int idx) (package private) doublegetMinimumDisplacement(int idx, double value) (package private) BigDecimalgetUpperBound(int idx) inthashCode()(package private) boolean(package private) boolean(package private) boolean(package private) doublescore(ModelStrategy strategy, boolean found) (package private) voidsetNodeState(ExpressionsBasedModel model, ModelStrategy strategy) toString()
-
Field Details
-
MINIMUM_DISPLACEMENT
static final double MINIMUM_DISPLACEMENT- See Also:
-
BREADTH_FIRST_SEARCH
-
DEPTH_FIRST_SEARCH
-
FIFO_SEQUENCE
-
LARGE_DISPLACEMENT
-
LIFO_SEQUENCE
-
MAX_OBJECTIVE
-
MIN_OBJECTIVE
-
SMALL_DISPLACEMENT
-
FEASIBILITY
Used for one thing only - to validate (log problems with) node solver results. Does not effect the algorithm. -
SEQUENCE_GENERATOR
-
depth
public final int depthHow far have we branched from the root -
displacement
public final double displacementHow 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 indexThe index of the branched on variable. -
objective
public final double objectiveThe objective function value of the parent node. -
parent
public final long parentParent node sequence number. -
sequence
public final long sequenceNode sequence number to keep track of in which order the nodes were created. -
myIntArrayPool
-
myLowerBounds
private final int[] myLowerBounds -
mySignChanged
private final boolean mySignChanged -
myUpperBounds
private final int[] myUpperBounds -
myUpperBranch
private final boolean myUpperBranch
-
-
Constructor Details
-
NodeKey
private NodeKey(int[] lowerBounds, int[] upperBounds, long parentSequenceNumber, int parentDepth, int integerIndexBranchedOn, double branchVariableDisplacement, double parentObjectiveFunctionValue, boolean signChanged, boolean upperBranch, NodeKey.IntArrayPool pool) -
NodeKey
NodeKey(ExpressionsBasedModel integerModel)
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<NodeKey>
-
equals
-
hashCode
-
toString
-
append
-
feasible
private double feasible(int idx, double value, boolean validate) -
calculateTreeSize
long calculateTreeSize() -
copyLowerBounds
int[] copyLowerBounds() -
copyUpperBounds
int[] copyUpperBounds() -
createLowerBranch
-
createUpperBranch
-
dispose
void dispose() -
enforceBounds
-
enforceBounds
-
equals
boolean equals(int[] lowerBounds, int[] upperBounds) -
getLowerBound
-
getMinimumDisplacement
double getMinimumDisplacement(int idx, double value) -
getUpperBound
-
isLowerBranch
boolean isLowerBranch() -
isSignChanged
boolean isSignChanged() -
isUpperBranch
boolean isUpperBranch() -
score
-
setNodeState
-