public abstract class ModelEntity<ME extends ModelEntity<ME>> extends Object implements Optimisation.Constraint, Optimisation.Objective, Comparable<ME>
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M extends Optimisation.Model,S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State
Modifier | Constructor and Description |
---|---|
protected |
ModelEntity(ME entityToCopy) |
protected |
ModelEntity(String name) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addTo(Expression target,
BigDecimal scale) |
BigDecimal |
adjust(BigDecimal factor) |
protected void |
appendLeftPart(StringBuilder builder) |
protected void |
appendMiddlePart(StringBuilder builder) |
protected void |
appendRightPart(StringBuilder builder) |
protected void |
destroy() |
boolean |
equals(Object obj) |
double |
getAdjustedLowerLimit() |
double |
getAdjustedUpperLimit() |
protected int |
getAdjustmentExponent() |
double |
getAdjustmentFactor() |
BigDecimal |
getContributionWeight()
The weight/factor by which this model entity's value contributes to the objective function - may
return null.
|
BigDecimal |
getLowerLimit()
The lower limit/bound - may return null.
|
String |
getName() |
double |
getUnadjustedLowerLimit() |
double |
getUnadjustedUpperLimit() |
BigDecimal |
getUpperLimit()
The upper limit/bound - may return null.
|
int |
hashCode() |
boolean |
isConstraint()
The Constraint has a lower or an upper limit actually set (possibly both) - it actually is
constained.
|
boolean |
isContributionWeightSet() |
boolean |
isEqualityConstraint()
The Constraint has both a lower limit and an upper limit, and they are equal.
|
abstract boolean |
isInteger()
Is this entity (all involved variables) integer?
|
boolean |
isLowerConstraint()
The Constraint has a lower limit, and the upper limit (if it exists) is different.
|
boolean |
isLowerLimitSet() |
boolean |
isObjective() |
boolean |
isUpperConstraint()
The Constraint has an upper limit, and the lower limit (if it exists) is different.
|
boolean |
isUpperLimitSet() |
ME |
level(Comparable<?> level) |
ME |
level(double level) |
ME |
level(long level) |
ME |
lower(Comparable<?> lower)
Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are
treated as exactly 0.0, unless the input number type is
BigDecimal . |
ME |
lower(double lower) |
ME |
lower(long lower) |
BigDecimal |
reverseAdjustment(BigDecimal adjusted)
Purely the reverse scaling part of
toUnadjusted(double, NumberContext) |
void |
shift(BigDecimal shift)
Add this shift to the lower/upper limits, if they exist.
|
double |
toAdjusted(BigDecimal unadjusted)
Will convert a
BigDecimal model parameter to a corresponing double solver parameter, in
the process scaling it. |
String |
toString() |
BigDecimal |
toUnadjusted(double adjusted,
NumberContext context)
The inverse of
toAdjusted(BigDecimal) . |
ME |
upper(Comparable<?> upper)
Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are
treated as exactly 0.0, unless the input number type is
BigDecimal . |
ME |
upper(double upper) |
ME |
upper(long upper) |
protected boolean |
validate(BasicLogger.Printer appender)
Validate model parameters, like lower and upper limits.
|
protected boolean |
validate(BigDecimal value,
NumberContext context,
BasicLogger.Printer appender) |
ME |
weight(Comparable<?> weight) |
ME |
weight(double weight) |
ME |
weight(long weight) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo
protected ModelEntity(ME entityToCopy)
protected ModelEntity(String name)
public abstract void addTo(Expression target, BigDecimal scale)
public final BigDecimal adjust(BigDecimal factor)
public final boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public final double getAdjustedLowerLimit()
public final double getAdjustedUpperLimit()
public final double getAdjustmentFactor()
public final BigDecimal getContributionWeight()
Optimisation.Objective
getContributionWeight
in interface Optimisation.Objective
public final BigDecimal getLowerLimit()
Optimisation.Constraint
getLowerLimit
in interface Optimisation.Constraint
public final String getName()
public final double getUnadjustedLowerLimit()
public final double getUnadjustedUpperLimit()
public final BigDecimal getUpperLimit()
Optimisation.Constraint
getUpperLimit
in interface Optimisation.Constraint
public final boolean isConstraint()
Optimisation.Constraint
isConstraint
in interface Optimisation.Constraint
public final boolean isContributionWeightSet()
public final boolean isEqualityConstraint()
Optimisation.Constraint
isEqualityConstraint
in interface Optimisation.Constraint
public abstract boolean isInteger()
public final boolean isLowerConstraint()
Optimisation.Constraint
isLowerConstraint
in interface Optimisation.Constraint
public final boolean isLowerLimitSet()
public final boolean isObjective()
isObjective
in interface Optimisation.Objective
public final boolean isUpperConstraint()
Optimisation.Constraint
isUpperConstraint
in interface Optimisation.Constraint
public final boolean isUpperLimitSet()
public final ME level(Comparable<?> level)
getLowerLimit()
,
getUpperLimit()
public final ME level(double level)
public final ME level(long level)
public ME lower(Comparable<?> lower)
BigDecimal
. BigDecimal
values
are always used as they are.public final ME lower(double lower)
public final ME lower(long lower)
public final BigDecimal reverseAdjustment(BigDecimal adjusted)
toUnadjusted(double, NumberContext)
public void shift(BigDecimal shift)
public final double toAdjusted(BigDecimal unadjusted)
BigDecimal
model parameter to a corresponing double
solver parameter, in
the process scaling it. This operation is reversed by toUnadjusted(double, NumberContext)
and/or reverseAdjustment(BigDecimal)
.public final BigDecimal toUnadjusted(double adjusted, NumberContext context)
toAdjusted(BigDecimal)
. This will also enforce the lower and upper limits as
well as the NumberContext
. To "only" do the reverse adjustment call
reverseAdjustment(BigDecimal)
.public ME upper(Comparable<?> upper)
BigDecimal
. BigDecimal
values
are always used as they are.public final ME upper(double upper)
public final ME upper(long upper)
public final ME weight(Comparable<?> weight)
getContributionWeight()
public final ME weight(double weight)
public final ME weight(long weight)
protected void appendLeftPart(StringBuilder builder)
protected void appendMiddlePart(StringBuilder builder)
protected void appendRightPart(StringBuilder builder)
protected void destroy()
protected final int getAdjustmentExponent()
protected final boolean validate(BasicLogger.Printer appender)
protected boolean validate(BigDecimal value, NumberContext context, BasicLogger.Printer appender)
Copyright © 2022 Optimatika. All rights reserved.