Logo GenPRES

Constraints Module

Creates, changes, checks and prints the constraints of an order variable and converts the constraints to and from a value range.

Functions and values

Function or value Description

create min incr max vs

Full Usage: create min incr max vs

Parameters:
    min : Minimum option - An optional Minimum
    incr : Increment option - An optional Increment
    max : Maximum option - An optional Maximum
    vs : ValueSet option - An optional ValueSet

Returns: Constraints

Create a Constraints record

min : Minimum option

An optional Minimum

incr : Increment option

An optional Increment

max : Maximum option

An optional Maximum

vs : ValueSet option

An optional ValueSet

Returns: Constraints

fromValueRange _arg1

Full Usage: fromValueRange _arg1

Parameters:
Returns: Constraints
_arg1 : ValueRange
Returns: Constraints

get cs

Full Usage: get cs

Parameters:
Returns: Minimum option * Increment option * Maximum option * ValueSet option

Get the fields of a Constraints record

cs : Constraints
Returns: Minimum option * Increment option * Maximum option * ValueSet option

getNorm cs

Full Usage: getNorm cs

Parameters:
Returns: ValueUnit option

Returns the norm dose when the minimum is 0.9 and the maximum is 1.1 times the same value, as setMinMax stores a norm dose; otherwise None.

cs : Constraints
Returns: ValueUnit option

getUnit cs

Full Usage: getUnit cs

Parameters:
Returns: Unit option

Get the Unit from a Constraints record

cs : Constraints
Returns: Unit option

isEmpty cs

Full Usage: isEmpty cs

Parameters:
Returns: bool

Check whether a Constraints record is empty

cs : Constraints
Returns: bool

isNonZeroPositive cs

Full Usage: isNonZeroPositive cs

Parameters:
Returns: bool

Checks whether a Constraints record has only an exclusive minimum of zero.

cs : Constraints
Returns: bool

map fMin fMax fIncr fVals cs

Full Usage: map fMin fMax fIncr fVals cs

Parameters:
Returns: Constraints

Map the functions, fMin, fMax, fIncr and fVals over the Constraints record

fMin : Minimum -> Minimum

The function to map the Min

fMax : Maximum -> Maximum

The function to map the Max

fIncr : Increment -> Increment

The function to map the Incr

fVals : ValueSet -> ValueSet

The function to map the Values

cs : Constraints

The Constraints record

Returns: Constraints

setIncr vu cs

Full Usage: setIncr vu cs

Parameters:
Returns: Constraints

Sets the increment between the values the order variable may take. None or an empty ValueUnit removes the increment.

vu : ValueUnit option
cs : Constraints
Returns: Constraints

setMax incl vu cs

Full Usage: setMax incl vu cs

Parameters:
Returns: Constraints

Sets the maximum, inclusive when incl is true. None removes the maximum.

incl : bool
vu : ValueUnit option
cs : Constraints
Returns: Constraints

setMin incl vu cs

Full Usage: setMin incl vu cs

Parameters:
Returns: Constraints

Sets the minimum, inclusive when incl is true. None removes the minimum.

incl : bool
vu : ValueUnit option
cs : Constraints
Returns: Constraints

setMinMax calcNormDose minMax cs

Full Usage: setMinMax calcNormDose minMax cs

Parameters:
    calcNormDose : bool - When true, a MinMax with an equal minimum and maximum is a norm dose: the minimum becomes 0.9 and the maximum 1.1 times that value, so the solver has a range to work with
    minMax : MinMax - The MinMax to take the bounds from
    cs : Constraints - The Constraints to set the bounds on

Returns: Constraints

Sets the minimum and maximum of a MinMax as inclusive bounds. A bound the MinMax does not have is left unchanged.

calcNormDose : bool

When true, a MinMax with an equal minimum and maximum is a norm dose: the minimum becomes 0.9 and the maximum 1.1 times that value, so the solver has a range to work with

minMax : MinMax

The MinMax to take the bounds from

cs : Constraints

The Constraints to set the bounds on

Returns: Constraints

setValues vu cs

Full Usage: setValues vu cs

Parameters:
Returns: Constraints

Sets the values the order variable may take. None or an empty ValueUnit removes the values.

vu : ValueUnit option
cs : Constraints
Returns: Constraints

toIncrMaxRange cs

Full Usage: toIncrMaxRange cs

Parameters:
Returns: ValueRange

Creates a ValueRange from only the Increment and the Maximum of a Constraints record.

cs : Constraints
Returns: ValueRange

toMaxString prec cs

Full Usage: toMaxString prec cs

Parameters:
Returns: string option

Formats the maximum of a Constraints record as a short Dutch decimal string with precision prec; None when there is no maximum.

prec : int
cs : Constraints
Returns: string option

toMinIncrRange cs

Full Usage: toMinIncrRange cs

Parameters:
Returns: ValueRange

Creates a ValueRange from only the Minimum and the Increment of a Constraints record.

cs : Constraints
Returns: ValueRange

toMinMaxString prec cs

Full Usage: toMinMaxString prec cs

Parameters:
    prec : int - The precision for decimal values
    cs : Constraints - The Constraints record

Returns: string

Formats the minimum and maximum of a Constraints record as a Dutch string: one value when they are equal or a norm dose, else "min - max". Returns an empty string when a bound is missing.

prec : int

The precision for decimal values

cs : Constraints

The Constraints record

Returns: string

toString cs

Full Usage: toString cs

Parameters:
Returns: string

Get the string representation of a Constraints record (in Dutch)

 let min = 1N |> ValueUnit.singleWithUnit Units.Mass.milliGram |> Minimum.create true
 let max = 10N |> ValueUnit.singleWithUnit Units.Mass.milliGram |> Maximum.create false
 let incr = 1N |> ValueUnit.singleWithUnit Units.Mass.milliGram |> Increment.create
 let cs = Constraints.create (Some min) (Some incr) (Some max) None
 cs |> toString
 // vanaf 1 mg[Mass] per 1 mg[Mass] tot 10 mg[Mass]
val min: obj
val max: obj
val incr: obj
val cs: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>

cs : Constraints

The Constraints record

Returns: string

toValueRange cs

Full Usage: toValueRange cs

Parameters:
Returns: ValueRange

Creates a ValueRange from a Constraints record. A ValueSet, when present, replaces the minimum, maximum and increment.

cs : Constraints
Returns: ValueRange

toValueRangeString

Full Usage: toValueRangeString

Returns: Constraints -> string

Get the string representation of a ValueRange from a Constraints record

Returns: Constraints -> string

Type something to start searching.