Package org.ojalgo.optimisation.integer
Class NodeKey
- java.lang.Object
-
- org.ojalgo.optimisation.integer.NodeKey
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
NodeKey.IntArrayPool
-
Field Summary
Fields Modifier and Type Field Description 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).static java.util.Comparator<NodeKey>
EARLIEST_SEQUENCE
private static NumberContext
FEASIBILITY
Used for one thing only - to validate (log problems with) node solver results.int
index
The index of the branched on variable.static java.util.Comparator<NodeKey>
LARGEST_DISPLACEMENT
static java.util.Comparator<NodeKey>
LATEST_SEQUENCE
static java.util.Comparator<NodeKey>
MAX_OBJECTIVE
static java.util.Comparator<NodeKey>
MIN_OBJECTIVE
private NodeKey.IntArrayPool
myIntArrayPool
private int[]
myLowerBounds
private boolean
mySignChanged
private int[]
myUpperBounds
double
objective
The objective function value of the parent node.long
parent
Parent node sequence number.long
sequence
Node sequence number to keep track of in which order the nodes were created.private static java.util.concurrent.atomic.AtomicLong
SEQUENCE_GENERATOR
static java.util.Comparator<NodeKey>
SMALLEST_DISPLACEMENT
-
Constructor Summary
Constructors Modifier Constructor Description private
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
append(java.lang.StringBuilder builder, int idx)
(package private) long
calculateTreeSize()
int
compareTo(NodeKey ref)
(package private) int[]
copyLowerBounds()
(package private) int[]
copyUpperBounds()
(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
equals(java.lang.Object obj)
private double
feasible(int idx, double value, boolean validate)
(package private) java.math.BigDecimal
getLowerBound(int idx)
(package private) double
getMinimumDisplacement(int idx, double value)
(package private) java.math.BigDecimal
getUpperBound(int idx)
int
hashCode()
(package private) boolean
isSignChanged()
(package private) void
setNodeState(ExpressionsBasedModel model, ModelStrategy strategy)
java.lang.String
toString()
-
-
-
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.
-
myIntArrayPool
private final NodeKey.IntArrayPool myIntArrayPool
-
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)
-
NodeKey
NodeKey(ExpressionsBasedModel integerModel)
-
-
Method Detail
-
compareTo
public int compareTo(NodeKey ref)
- Specified by:
compareTo
in interfacejava.lang.Comparable<NodeKey>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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)
-
isSignChanged
boolean isSignChanged()
-
setNodeState
void setNodeState(ExpressionsBasedModel model, ModelStrategy strategy)
-
-