OrderVariable Module
Creates and changes an order variable, a solver variable with defined and calculated constraints: applies the constraints, selects or steps a value and prints values.
Nested modules
| Modules | Description |
|
Wraps an order variable as a concentration, a quantity per quantity, with the name part cnc, and applies the order variable functions to it. |
|
|
Creates, changes, checks and prints the constraints of an order variable and converts the constraints to and from a value range. |
|
|
Wraps an order variable as a count, with the name part cnt, and applies the order variable functions to it. |
|
|
Holds the serializable shape of an order variable and converts an order variable to and from the Dto. Reading a Dto raises an exception when a value is not valid. |
|
|
Wraps an order variable as a frequency, with the name part frq, and applies the order variable functions to it. |
|
|
Wraps an order variable as a quantity per time, with the name part ptm, and applies the order variable functions to it. |
|
|
Wraps an order variable as an adjusted quantity per time, with the name part ptm_adj, and applies the order variable functions to it. |
|
|
Wraps an order variable as a quantity, with the name part qty, and applies the order variable functions to it. |
|
|
Wraps an order variable as an adjusted quantity such as mg/kg, with the name part qty_adj, and applies the order variable functions to it. |
|
|
Wraps an order variable as a rate, with the name part rte, and applies the order variable functions to it. |
|
|
Wraps an order variable as an adjusted rate such as mL/kg/hour, with the name part rte_adj, and applies the order variable functions to it. |
|
|
Wraps an order variable as a time, with the name part tme, and applies the order variable functions to it. |
|
|
Wraps an order variable as a total, with the name part tot, and applies the order variable functions to it. |
|
|
Wraps an order variable as an adjusted total such as mL/kg, with the name part tot_adj, and applies the order variable functions to it. |
Functions and values
| Function or value |
Description
|
|
|
Full Usage:
applyConstraints ovar
Parameters:
OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Sets the Variable to the calculated constraints when these are not empty and not only an exclusive minimum of zero. Otherwise sets the Variable to the defined constraints, or to non-zero positive when there are no defined constraints. A ValueSet in the constraints replaces their minimum, maximum and increment.
|
|
Set the Variable of an OrderVariable to its defined constraints; the constraints stay as they are.
|
|
Sets the Variable to the increment and maximum of the defined constraints. Without defined constraints, sets the Variable to non-zero positive.
|
Full Usage:
applyOnlyMinIncrConstraints ovar
Parameters:
OrderVariable
Returns: OrderVariable
|
Sets the Variable to the minimum and increment of the defined constraints. Without defined constraints, sets the Variable to non-zero positive.
|
|
Returns a map of the order variables by name.
|
|
|
|
Removes the calculated constraints of an order variable.
|
Full Usage:
convertFirstUnit u ovar
Parameters:
Unit
-
The Unit to convert to
ovar : OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Convert the
|
Full Usage:
convertTimeUnit tu ovar
Parameters:
Unit
-
The time Unit to convert to
ovar : OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Convert the
|
Full Usage:
create n min incr max vs cst cal
Parameters:
Name
-
The Name of the Variable
min : Minimum option
-
An optional Minimum of the Variable
incr : Increment option
-
An optional Increment of the Variable
max : Maximum option
-
An optional Maximum of the Variable
vs : ValueSet option
-
An optional ValueSet of the Variable
cst : Constraints
-
The Constraints for the OrderVariable
cal : Constraints
-
The calculated constraints
Returns: OrderVariable
|
Creates an OrderVariable: a Variable with defined and calculated Constraints.
|
Full Usage:
createNew n un
Parameters:
Name
-
The Name of the Variable
un : Unit
-
The Unit of the Values in the Variable and Constraints
Returns: OrderVariable
|
Create a new OrderVariable. The OrderVariable will have an exclusive Minimum of zero and a Constraints with an exclusive Minimum of zero
|
Full Usage:
decrease useLarge n
Parameters:
bool
n : int
Returns: OrderVariable -> OrderVariable
|
|
Full Usage:
eqsName ovar1 ovar2
Parameters:
OrderVariable
ovar2 : OrderVariable
Returns: bool
|
Check whether two OrderVariables have the same name
|
Full Usage:
eqsUnitGroup ovar1 ovar2
Parameters:
OrderVariable
ovar2 : OrderVariable
Returns: bool
|
Checks whether two OrderVariables have units of the same group, so that their values can be added or subtracted.
|
Full Usage:
fixToValues setsBack vu ovar
Parameters:
OrderVariable -> bool
vu : ValueUnit
ovar : OrderVariable
Returns: OrderVariable option
|
Fixes the order variable to the values of vu, as for one concentration. Sets the defined value list, and the calculated value list when there is one, to those values, so that a reset of the variable returns them. When setsBack ovar is true, the values are not narrowed; otherwise they are narrowed to vu, and the result is None when none of those values lie in the current range.
|
|
Frees the values of an order variable. With a defined increment, the values become any multiple of that increment from the smallest increment up, with no maximum. Without a defined increment, the values become non-zero positive.
|
|
|
|
|
|
Get the names of a list of OrderVariables as a comma-separated string
|
|
|
|
Get the optional ValueUnit from the ValueSet of the Variable
|
|
|
|
Checks whether the defined Constraints of an OrderVariable are not empty and not only an exclusive minimum of zero.
|
|
Checks whether the defined constraints have an increment. The values are not checked, because the solver can calculate values without an increment.
|
|
Check whether the ValueRange of the Variable of an OrderVariable is a MinIncrMax, i.e. has an increment
|
|
Check whether the defined Constraints of an OrderVariable have a Maximum or a ValueSet
|
|
Checks whether the values of the OrderVariable have a maximum; a single value also has one.
|
|
Checks whether the calculated constraints of an order variable have a value set of one value.
|
|
Checks whether the values of an order variable are a list of one value.
|
|
Check whether the Values of the Variable of an OrderVariable are set, i.e., have a distinct set of values
|
Full Usage:
includeOriginalValue original ovar
Parameters:
OrderVariable
ovar : OrderVariable
Returns: OrderVariable
|
Adds the value of original to the value list of ovar when original has one value, ovar has a value list and the value lies within the calculated constraints of ovar. Otherwise returns ovar unchanged.
|
Full Usage:
increase useLarge n
Parameters:
bool
n : int
Returns: OrderVariable -> OrderVariable
|
|
Full Usage:
increaseIncrement maxCount incrs ovar
Parameters:
RationalX
-
The maximum count
incrs : Increment list
-
The increment list
ovar : OrderVariable
-
The OrderVariable
Returns: OrderVariable
The resulting (more restrictive) ValueRange
|
Try and increase the increment of a When there is no increment in the list that can be used to increase the increment of the ValueRange to the maximum count, the largest possible increment is used.
|
|
Check whether the Values of the Variable of an OrderVariable are cleared, i.e., unrestricted
|
|
Checks whether the values of the Variable are unrestricted, non-zero positive or have an exclusive minimum of zero, so that no constraints have been applied.
|
|
Check whether the Values of the Variable of an OrderVariable are non-zero positive or have an exclusive Minimum of zero
|
|
Checks whether the Variable is solved: one value, unrestricted or non-zero positive.
|
Full Usage:
isWithinConstraints useCalc ovar
Parameters:
bool
ovar : OrderVariable
Returns: bool
|
Checks whether the values of the Variable lie within the calculated constraints when useCalc is true, else within the defined constraints. Returns true when there are no defined constraints.
|
|
Returns the increment a large step moves by: the calculated increment, or ten times the calculated increment when that is 0.1 mL or 0.1 mL/hour; None when the order variable has no calculated increment.
|
Full Usage:
map f ovar
Parameters:
ValueUnit -> ValueUnit
-
The function to map
ovar : OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Map a function f to the Values (i.e., ValueUnit) of the Variable of the OrderVariable
|
Full Usage:
mapConstraints f ovar
Parameters:
Constraints -> Constraints
ovar : OrderVariable
Returns: OrderVariable
|
Applies f to the defined Constraints of an OrderVariable.
|
Full Usage:
minIncrMaxToValues steps n ovar
Parameters:
ValueUnit list
-
The rounded steps whose multiples are kept when the ValueSet is pruned
n : int option
-
Prune the ValueSet to max n values
ovar : OrderVariable
-
The OrderVariable to change min incr max to a ValueSet
Returns: OrderVariable
An OrderVariable with a Variable with a ValueSet if this can be calculated
|
Calculate a ValueSet for a Variable of an OrderVariable if the Value of the Variable is a MinIncrMax
|
Full Usage:
pickNearestHigherElseLower target candidates
Parameters:
OrderVariable
candidates : OrderVariable
Returns: OrderVariable
|
|
|
|
Full Usage:
setConstraints cs ovar
Parameters:
Constraints
-
The Constraints to set
ovar : OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Set the defined
|
Full Usage:
setMaxToValueOf upTo ovar
Parameters:
OrderVariable
ovar : OrderVariable
Returns: OrderVariable
|
Sets an inclusive maximum on the Variable at the value of upTo; an existing maximum is only lowered. Leaves the OrderVariable unchanged when upTo has no value set.
|
|
Set the maximum value of the Variable of an OrderVariable
|
|
Set the median value of the Variable of an OrderVariable
|
|
Set the minimum value of the Variable of an OrderVariable
|
|
Sets the name of the Variable of an OrderVariable.
|
Full Usage:
setNearestValue target side ovar
Parameters:
ValueUnit
side : NearestSide
ovar : OrderVariable
Returns: OrderVariable
|
Sets the variable to the value nearest to the target on the given side: the highest value at or below the target, but not below the floor, for AtMost; the lowest value at or above the target for AtLeast.
|
|
|
|
|
|
|
|
Set the Values of the Variable of an OrderVariable to non-zero positive values
|
|
|
Full Usage:
setUnit ovar
Parameters:
OrderVariable
-
The OrderVariable
Returns: OrderVariable
|
Set the unit of the Variable of an OrderVariable according to the unit of the Constraints of the OrderVariable. Uses the first unit other than the zero unit of the Min, Max, ValueSet and Incr, in that order.
|
Full Usage:
setValueRange vr ovar
Parameters:
ValueRange
ovar : OrderVariable
Returns: OrderVariable
|
Set the Values of the Variable of an OrderVariable to a given value range
|
|
|
|
Returns how a value can be set on an order variable. A list of more than one value, or a min, increment and max, is selectable. One value with a defined increment is steppable. Anything else is not settable.
|
|
Returns the value of an order variable with one value; None otherwise.
|
Full Usage:
step isStepUp useLarge n ovar
Parameters:
bool
-
Whether the operation is an increase, otherwise decrease
useLarge : bool
-
Whether the large increment should be used, see largeIncrement
n : int
-
The number of increases or decreases
ovar : OrderVariable
-
The OrderVariable to step
Returns: OrderVariable
The OrderVariable with the stepped value, unchanged when there is no floor or increment
|
Steps the value of an order variable up or down by n increments and returns one value. A single value (minimum equal to maximum) moves by n increments. For a range, the first step goes to the minimum when stepping up and to the maximum when stepping down, and each further step moves one increment; with only one bound, the first step goes to that bound. A decrease, or an increase from only a minimum, that falls below the floor returns the floor. The floor is the calculated increment for a large step, also when the large increment is ten times that, and the defined increment for a small step.
|
|
Get the string representation of an OrderVariable.
|
Full Usage:
toStringWithConstraints withConstraints exact ovar
Parameters:
bool
-
Whether to add the defined and calculated constraints; they are added only when the defined
constraints are not empty
exact : bool
-
Whether to use the exact representation of the ValueRange
ovar : OrderVariable
-
The OrderVariable
Returns: string
|
Get the string representation of an OrderVariable.
|
Full Usage:
toValueUnitMarkdown get prec x
Parameters:
'a -> OrderVariable
prec : int
x : 'a
Returns: string
Type parameters: 'a |
Gets the ValueRange of the OrderVariable that get returns from x as Markdown with precision prec. Returns an empty string unless the values are a min max, a min incr max or a value set.
|
Full Usage:
toValueUnitString get arg2 x
Parameters:
'a -> OrderVariable
arg1 : int
x : 'a
Returns: string
Type parameters: 'a |
Gets the ValueRange of the OrderVariable that get returns from x as a Dutch string.
|
Full Usage:
toValueUnitStringList get x
Parameters:
'a -> OrderVariable
x : 'a
Returns: string option
Type parameters: 'a |
Gets the value set of the OrderVariable that get returns from x as a short Dutch string; None without a value set.
|
Full Usage:
toValueUnitText get prec x
Parameters:
'a -> OrderVariable
prec : int
x : 'a
Returns: string
Type parameters: 'a |
Gets the ValueRange of the OrderVariable that get returns from x as plain Dutch text with precision prec, as toValueUnitMarkdown prints it without the markers. A range with only a minimum or only a maximum shows as "min" or "max" with the limit; an exclusive minimum of zero and a maximum without a unit show no text.
|
Full Usage:
tryConstrain vu ovar
Parameters:
ValueUnit
ovar : OrderVariable
Returns: OrderVariable option
|
Narrows the values of the order variable to the values of vu. Returns None when none of those values lie in the current range.
|
|
Returns the value list of an order variable: its values when these are a list, else the value list of the calculated constraints, else that of the defined constraints.
|
Full Usage:
unionPerConcentration maxCount records orig ovars
Parameters:
int
records : bool
orig : OrderVariable
ovars : OrderVariable list
Returns: OrderVariable
|
Combines the same order variable of the orders per concentration into one. The values are the union of the values of ovars and the defined constraints are those of orig. The calculated constraints are those of orig, or the union of those of ovars when records is true.
|
GenPRES