- java.lang.Object
-
- org.ojalgo.optimisation.integer.NodeKey
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classNodeKey.IntArrayPool
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<NodeKey>BREADTH_FIRST_SEARCHintdepthHow far have we branched from the rootstatic java.util.Comparator<NodeKey>DEPTH_FIRST_SEARCHdoubledisplacementHow 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 NumberContextFEASIBILITYUsed for one thing only - to validate (log problems with) node solver results.static java.util.Comparator<NodeKey>FIFO_SEQUENCEintindexThe index of the branched on variable.static java.util.Comparator<NodeKey>LARGE_DISPLACEMENTstatic java.util.Comparator<NodeKey>LIFO_SEQUENCEstatic java.util.Comparator<NodeKey>MAX_OBJECTIVEstatic java.util.Comparator<NodeKey>MIN_OBJECTIVE(package private) static doubleMINIMUM_DISPLACEMENTprivate NodeKey.IntArrayPoolmyIntArrayPoolprivate int[]myLowerBoundsprivate booleanmySignChangedprivate int[]myUpperBoundsprivate booleanmyUpperBranchdoubleobjectiveThe objective function value of the parent node.longparentParent node sequence number.longsequenceNode sequence number to keep track of in which order the nodes were created.private static java.util.concurrent.atomic.AtomicLongSEQUENCE_GENERATORstatic java.util.Comparator<NodeKey>SMALL_DISPLACEMENT
-
Constructor Summary
Constructors Modifier Constructor Description privateNodeKey(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappend(java.lang.StringBuilder builder, int idx)(package private) longcalculateTreeSize()intcompareTo(NodeKey ref)(package private) int[]copyLowerBounds()(package private) int[]copyUpperBounds()(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)booleanequals(java.lang.Object obj)private doublefeasible(int idx, double value, boolean validate)(package private) java.math.BigDecimalgetLowerBound(int idx)(package private) doublegetMinimumDisplacement(int idx, double value)(package private) java.math.BigDecimalgetUpperBound(int idx)inthashCode()(package private) booleanisLowerBranch()(package private) booleanisSignChanged()(package private) booleanisUpperBranch()(package private) doublescore(ModelStrategy strategy, boolean found)(package private) voidsetNodeState(ExpressionsBasedModel model, ModelStrategy strategy)java.lang.StringtoString()
-
-
-
Field Detail
-
MINIMUM_DISPLACEMENT
static final double MINIMUM_DISPLACEMENT
- See Also:
- Constant Field Values
-
BREADTH_FIRST_SEARCH
public static final java.util.Comparator<NodeKey> BREADTH_FIRST_SEARCH
-
DEPTH_FIRST_SEARCH
public static final java.util.Comparator<NodeKey> DEPTH_FIRST_SEARCH
-
FIFO_SEQUENCE
public static final java.util.Comparator<NodeKey> FIFO_SEQUENCE
-
LARGE_DISPLACEMENT
public static final java.util.Comparator<NodeKey> LARGE_DISPLACEMENT
-
LIFO_SEQUENCE
public static final java.util.Comparator<NodeKey> LIFO_SEQUENCE
-
MAX_OBJECTIVE
public static final java.util.Comparator<NodeKey> MAX_OBJECTIVE
-
MIN_OBJECTIVE
public static final java.util.Comparator<NodeKey> MIN_OBJECTIVE
-
SMALL_DISPLACEMENT
public static final java.util.Comparator<NodeKey> SMALL_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
-
depth
public final int depth
How far have we branched from the root
-
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
-
myUpperBranch
private final boolean myUpperBranch
-
-
Constructor Detail
-
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 Detail
-
compareTo
public int compareTo(NodeKey ref)
- Specified by:
compareToin interfacejava.lang.Comparable<NodeKey>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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()
-
enforceBounds
void enforceBounds(ExpressionsBasedModel model, int idx, ModelStrategy strategy)
-
enforceBounds
void enforceBounds(NodeSolver nodeSolver, ModelStrategy strategy)
-
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)
-
isLowerBranch
boolean isLowerBranch()
-
isSignChanged
boolean isSignChanged()
-
isUpperBranch
boolean isUpperBranch()
-
score
double score(ModelStrategy strategy, boolean found)
-
setNodeState
void setNodeState(ExpressionsBasedModel model, ModelStrategy strategy)
-
-