CompleteOrder Module
Searches for complete orders, in which every variable has one value and every equation holds, and drops the values that a search proves no complete order reaches. The search fixes the free variables one at a time and solves the order for the minimum and the maximum after each value, so values that the equations then rule out are removed before the search tries them.
Types
| Type | Description |
|
The outcome of a search. |
Functions and values
| Function or value |
Description
|
|
Returns the order variable with the name. Throws when the order has no such variable.
|
Full Usage:
dropProvenImpossible logger ord ovar
Parameters:
Logger
ord : Order
ovar : OrderVariable
Returns: OrderVariable option
|
Removes from the value list of the variable each value that a search proves impossible, with one search per value, run in parallel. A value that a search cannot decide stays in the list. Returns the variable unchanged when it has no list of more than one value, and None when every value in the list is proven impossible.
|
|
Returns the names of the basic variables and the invariants that occur in the order equations. The order count is left out because it has no maximum, so every multiple of a total over the order is reached. A variable outside the equations, such as the adjust quantity of an order without an adjusted dose, is not searched.
|
Full Usage:
isProvenImpossible logger ovar ord
Parameters:
Logger
ovar : OrderVariable
ord : Order
Returns: bool
|
Returns true when no complete order has the variable set to the value of ovar: the solve with the value fails with messages that prove it, or a finished search finds no complete order. Returns false for a failure that proves nothing, or for a search that stops at maxSolves or at a range that cannot be listed.
|
Full Usage:
maxSolves
Returns: int
|
The maximum number of solves in one search.
|
|
Returns true when the messages of a failed solve prove that the order cannot hold the values it was solved with. A loop limit, a value set too large to list or an unexpected exception proves nothing.
|
|
|
|
|
|
Returns one copy of the variable for each of its values, with that single value. Returns None when the range of the variable cannot be listed in at most 100000 values.
|
Full Usage:
tryFindWith logger ovar ord
Parameters:
Logger
ovar : OrderVariable
ord : Order
Returns: Order option
|
Returns the first complete order in which the variable has the value of ovar, or None.
|
Full Usage:
withValues vu ovar
Parameters:
ValueUnit
ovar : OrderVariable
Returns: OrderVariable
|
Returns the variable with its values replaced by the values of the value unit vu.
|
GenPRES