execute.model: Execute a Simile model to a given time point

 

Description

The model will be executed using the time steps specified by earlier calling set.model.step until either the finish.time is reached or an exception occurs.

Usage

execute.model(instance.handle, finish.time, integration.method,
start.time, error.limit, pause.on.event)

Arguments

instance.handle

The handle returned by create.model(), identifying an executable model instance.

finish.time

Time returned by functions in the model on the last execution step, when incrementing the time takes it to or beyond this value.

integration.method

One of "Euler" or "Runge-Kutta", the latter being 4th-order. Default is "Euler".

start.time

Time returned by functions in the model on the first execution step. On each subsequent step this will be incremented by the value specified by earlier calling set.model.step. Default is NA, which starts the model at the time to which it was previously reset or executed.

error.limit

Maximum integration error allowed by adaptive step size variation, as a fraction of the allowed range of each model compartment value. The integration error is estimated by comparing each compartment's rate of change with that predicted on the previous time step (equal to its previous rate of change if integration method is Euler). If error limit is exceeded, the time step is temporarily shortened and the model re-executed from the end of the last time step. Default is 0, in which case no adaptive step size variation is done.

pause.on.event

Reserved for future Simile versions with discrete event handling. Default is FALSE.

Value

Result code: value of system error (-ve), user-defined interruption (+ve) or 0 if model runs to finish.time

Author(s)