Package org.ojalgo.optimisation.integer
Class NodeKey
java.lang.Object
org.ojalgo.optimisation.integer.NodeKey
- All Implemented Interfaces:
Comparable<NodeKey>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
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).static final Comparator
<NodeKey> private static final NumberContext
Used for one thing only - to validate (log problems with) node solver results.final int
The index of the branched on variable.static final Comparator
<NodeKey> static final Comparator
<NodeKey> static final Comparator
<NodeKey> static final Comparator
<NodeKey> private final NodeKey.IntArrayPool
private final int[]
private final boolean
private final int[]
final double
The objective function value of the parent node.final long
Parent node sequence number.final long
Node sequence number to keep track of in which order the nodes were created.private static final AtomicLong
static final Comparator
<NodeKey> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
NodeKey
(int[] lowerBounds, int[] upperBounds, long parentSequenceNumber, int integerIndexBranchedOn, double branchVariableDisplacement, double parentObjectiveFunctionValue, boolean signChanged, NodeKey.IntArrayPool pool) (package private)
NodeKey
(ExpressionsBasedModel integerModel) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
append
(StringBuilder builder, int idx) (package private) long
int
(package private) int[]
(package private) int[]
(package private) NodeKey
createLowerBranch
(int branchIntegerIndex, double value, double objVal) (package private) NodeKey
createUpperBranch
(int branchIntegerIndex, double value, double objVal) (package private) void
dispose()
(package private) void
enforceBounds
(ExpressionsBasedModel model, int idx, ModelStrategy strategy) (package private) void
enforceBounds
(NodeSolver nodeSolver, ModelStrategy strategy) (package private) boolean
equals
(int[] lowerBounds, int[] upperBounds) boolean
private double
feasible
(int idx, double value, boolean validate) (package private) BigDecimal
getLowerBound
(int idx) (package private) double
getMinimumDisplacement
(int idx, double value) (package private) BigDecimal
getUpperBound
(int idx) int
hashCode()
(package private) boolean
(package private) void
setNodeState
(ExpressionsBasedModel model, ModelStrategy strategy) toString()
-
Field Details
-
EARLIEST_SEQUENCE
-
LARGEST_DISPLACEMENT
-
LATEST_SEQUENCE
-
MAX_OBJECTIVE
-
MIN_OBJECTIVE
-
SMALLEST_DISPLACEMENT
-
FEASIBILITY
Used for one thing only - to validate (log problems with) node solver results. Does not effect the algorithm. -
SEQUENCE_GENERATOR
-
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
-
-
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
- Specified by:
compareTo
in interfaceComparable<NodeKey>
-
equals
-
hashCode
public int 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
-
isSignChanged
boolean isSignChanged() -
setNodeState
-