Simulator functions
Functions defined in the simulator CPN ML


Simulator Functions

General Functions

step() Returns the current step number as an integer
RealToIntInf d r Converts the real value r to an InfInt.int with d digits after the decimal point
IntInfToReal d ii Converts the IntInf.int value ii to an real with d digits after the decimal point
CPN'Replications.nreplications n Runs n simulation replications for n>1

Functions in Timed Simulations

The type of model time is infinite integer (IntInf.int in SML Basis Library).

time() Returns the current model time (as an infinite integer) in timed CP-nets
ModelTime.toString t Converts model time value t to a string
ModelTime.fromString st Converts a string representation of an integer st to a time value, i.e. an infinite integer
ModelTime.fromInt i Converts an integer i into a time value.
ModelTime.add(t1,t2) Adds the two time values t1 and t2
ModelTime.sub(t1,t2) Subtracts the time value t2 from t1
ModelTime.mult(t1,t2) Multiplies the two time values t1 and t2
ModelTime.lt(t1,t2) Less than function for time values
ModelTime.cmp(t1,t2) Comparison function for time values t1 and t2 that returns an SML order value, e.g. LESS, GREATER or EQUAL
ModelTime.col cts Returns the colour value of cts which is a colour value paired with a time stamp