# Simulation of the ASK system

## Reo Simulator

Stochastic Reo serves as a general purpose modeling formalism to specify the stochastic behavior of systems. For analysis, the ECT includes tools to automatically translate Stochastic Reo models into Continuous Time Markov Chains (CTMCs). Although Stochastic Reo models can specify any distribution, having CTMCs as the translation target implies that only exponential distributions can be used in the models for this type of analysis. In reality, however, the patterns of many event occurrences do not fit exponential distributions, which makes it impossible to analyze the properties of many real systems through CTMCs. The Reo simulator has been developed to allow the analysis of stochastic models with general distributions through simulation.

## ASK system

The ASK system is an industrial software that has been developed by Almende, and is marketed by ASK Community Systems. The ASK system provides *efficient matching* between service providers and clients. An example of the application of the ASK system consists of a service-based system running in a call center that matches calling clients with the appropriate representatives that can provide them with the specialized customer service that they need. More on the ASK system case study in Stochastic Reo/CTMC can be found here.

## Simulation

For this simulation analysis, we focus on the Reception component of the ASK system. Since the other components in the ASK system have very similar architectures, we can use some of the results from this simulation for their simulation as well. The Reo simulator tool currently does not support hierarchical models yet. Therefore, to run our simulation we had to *flatten* the original Reo model for the ASK system, abstract its nested components into FIFO1 channels, and somewhat simplify it to reflect some restrictions. The resulting Reo circuit that we use for this simulation analysis appears in the ECT screen-shot, below.

The simulator accepts arbitrary distributions and provides:

- Average waiting time of I/O requests at boundary nodes
- Buffer utilization
- End-to-end delays
- Channel utilization

As an example of the simulation results we obtain, the following ECT screen-shot shows the utilization of the buffer between the TQIn and TQOut nodes. Actually, this buffer corresponds to the task queue in the Reception component, whose average utilization, according to this analysis, is 57.52%. That is, averagely 57% of running time of the ASK system, this buffer is used.

In addition, the graph at the bottom of the result shows how frequently this average value occurs during simulation. In general, this value follows a normal distribution, which in this case does not happen. This can be due to a low number of batches: if this number increases, it might tend to a normal distribution.

As another example of the simulation, the following ECT screen-shot shows the end-to-end delay from RRequestIn node to Rmatcher Request Out? node, which implies how long it takes for the Reception component to handle a request. The average end-to-end delay is around 6500 microseconds, i.e., 6.5 milliseconds.

The following screen-shot shows the waiting time of I/O request at RRequestIn node. According to the result, in average, I/O requests wait 1727 microseconds, i.e., around 1.7 milliseconds.