Variable Module
Creates a variable with a name and a value range, restricts and calculates with the value range, and sets the variable to a single value.
Nested modules
| Modules | Description |
|
Holds the Dto of a variable and converts a variable to and from the Dto. Raises a solver exception for an invalid name or an invalid value range. |
|
|
Creates the name of a variable from a string and writes the name as text. Fails for a blank string or a string longer than 1000 characters. |
|
|
Holds the operators to calculate with two variables and to restrict a variable, the constants 1, 2 and 3, and the text of an operator. |
|
|
Creates a value range, restricts the range with a minimum, increment, maximum or value set, and calculates with two value ranges. |
Functions and values
| Function or value |
Description
|
|
|
Full Usage:
calc op (v1, v2)
Parameters:
ValueRange -> ValueRange -> ValueRange
v1 : Variable
v2 : Variable
Returns: Variable
|
Apply the operator op to v1 and v2 return an intermediate *result* Variable.
|
|
|
|
|
Get the number of distinct values Note that the valuerange has to be a ValueSet to get a count
|
|
Full Usage:
create succ n vs
Parameters:
Variable -> 'a
n : Name
vs : ValueRange
Returns: 'a
Type parameters: 'a |
Create a Variable and passes the result to succ
|
|
Helper create function to store the result of a Variable calculation before applying to the actual result Variable.
|
|
Create a Variable and directly return the result.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
Checks whether the ValueRange of a Variable is a Maximum
|
|
Checks whether the ValueRange of a Variable is a Minimum
|
|
|
Checks whether the ValueRange of a Variable Minimum is exclusive zero
|
Checks whether the ValueRange of a Variable is an MinIncr
|
|
|
Checks whether the ValueRange of a Variable is a MinIncrMax
|
Checks whether the ValueRange of a Variable is a MinMax
|
|
|
Checks whether the ValueRange of a Variable is non-zero and positive
|
|
Checks whether a Variable is *solvable* i.e., can be further restricted to one value (or no values at all)
|
|
Checks whether a Variable v is solved, i.e., there is but one possible value left.
|
|
Checks whether there are no restrictions to possible values a Variable can contain
|
Checks whether the ValueRange of a Variable is a ValSet
|
|
Full Usage:
minIncrMaxToValues steps n var
Parameters:
ValueUnit list
-
The rounded steps the prune keeps the multiples of
n : int option
-
Prune the ValueSet to n
var : Variable
-
The variable to change min incr max to a ValueSet
Returns: Variable
A Variable with a ValueSet if this can be calculated
|
Calculate a ValueSet for a Variable if the Value of the Variable is a MinIncrMax
|
Full Usage:
nearestNth find round target var
Parameters:
BigRational -> BigRational[] -> int
round : RationalX -> RationalX
target : ValueUnit
var : Variable
Returns: int option
|
Returns the place, counted from 0, of the value of a variable nearest to the target. In a value set, find returns the place from the target and the values. In a min, increment and max with a value count, round makes a whole number of the increments from the min to the target; a target below the min gives the first place and a target above the max the last place. Returns None when the target is not a single value, and for a variable without a value set and without a value count.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The number of values of a variable: of its value set, or of its min, increment and max when the increment has one value; None for any other range.
|
GenPRES