Esa_Execute_Until()
Abstract
Enables a simulation to process some events.
Syntax
Esa_Execute_Until (esa_state_ptr, status_ptr, until, execute_flags, time_reached_ptr, num_events_ptr)
| Argument | Type | Description |
|---|---|---|
esa_state_ptr |
EsaT_State_Handle |
ESA state information generated by Esa_Init() |
status_ptr |
int * |
area to be filled with an appropriate status value (see Details) |
until |
double |
simulation time limit for the invocation, or ESAC_TIME_MAX to run to completion |
execute_flags |
int |
a combination of - ESAC_UNTIL_EXCLUSIVE—execute until simulation time reaches the until value, but return before executing events at that time.- ESAC_UNTIL_INCLUSIVE—execute until simulation time reaches the until value, including events scheduled for that time.- ESAC_UNTIL_ONE_EVENT—execute at most one event. |
time_reached_ptr |
double * |
simulation time after this function returns |
num_events_ptr |
int * |
number of events executed |
Return Type
EsaT_Compcode
EsaC_Comp_Success if the simulation executed as specified; EsaC_Comp_Failure otherwise.
Header
esa.h
Details
This function enables the cosimulation to let the Riverbed Modeler simulation process a set of scheduled events before control is returned to the cosimulation code.
In a cosimulation, the Riverbed Modeler simulation is executed in pieces (a few events at a time). This function enables the cosimulation to control the size of these pieces.
When this function is invoked, the Riverbed Modeler simulation executes until one of the following conditions occurs (with a corresponding value set to *status_ptr):
execute_flagsisESAC_UNTIL_EXCLUSIVEand the simulation time is greater than or equal tountil[*status_ptrset toESAC_STATUS_DURATION]execute_flagsisESAC_UNTIL_INCLUSIVEand either the simulation time is greater thanuntilor the time is equal tountiland no more events are scheduled for that time [*status_ptrset toESAC_STATUS_DURATION]execute_flagsisESAC_UNTIL_EXCLUSIVE | ESAC_UNTIL_ONE_EVENTand either one event was executed or the simulation time is greater than or equal tountil[*status_ptrset toESAC_STATUS_DURATION]execute_flagsisESAC_UNTIL_INCLUSIVE | ESAC_UNTIL_ONE_EVENTand either one event was executed or the simulation time is greater thanuntil[*status_ptrset toESAC_STATUS_DURATION]- No more events are scheduled
[
*status_ptrset toESAC_STATUS_DURATION] - The simulation terminated (by exceeding the simulation duration, executing op_sim_end(), or encountering an abortive error)
[
*status_ptrset toESAC_STATUS_TERMINATION] - Esa_Interrupt() was invoked by an interface callback (in which case the function will return after completion of the event during which Esa_Interrupt() was called)
[
*status_ptrset toESAC_STATUS_EXTERNAL] - Esa_Interrupt() was invoked during the execution of Riverbed analysis software events
[
*status_ptrset toESAC_STATUS_INTERRUPTED] - The ESA package was not loaded via Esa_Load()
[
*status_ptrset toESAC_STATUS_PACKAGE_CLOSED]