SimEvents® provides a discrete-event simulation engine that manages and processes sequences of asynchronous events. These events can help model mode changes and trigger state transitions within time-based systems in Simulink®.
With SimEvents you can create entities to represent discrete items of interest, such as packets in a communication system or airplanes in an airport taxiway. The generation, movement, and processing of entities in the system causes events, such as the arrival of a packet or the departure of an airplane. In turn, these events modify the states in the system to affect system behavior. You can characterize your entities with attributes, such as a destination address, processing time, or server delay. Entities can also acquire and release resources, which can represent supplies, machines, or even people that entities use to complete a task or event. SimEvents distinguishes between entity lines, which represent entity movement between blocks and event-signal lines, which denote corresponding event-based computations, via unique port styles.
You can programmatically control event actions and entities in the following ways:
SimEvents provides blocks that enable you to create, process, store, and move entities and their resources in a system. You can model both simple and complex networks of queues and servers. By connecting gate and switching blocks, you can establish paths on which entities travel in response to events. These paths can include delays and selective switching criteria. Many parameters within SimEvents can be programmatically determined to model probabilistic variations in the system. You can also build your own domain-specific blocks by using a Stateflow Discrete-Event Chart or MATLAB Discrete-Event System block. Further, you can use Simulink capabilities, such as masking subsystems and creating libraries, to build up SimEvents subsystems into component blocks that can be shared and reused by others.
The SimEvents Design Patterns library contains predefined blocks for common design patterns, such as time stamping entities upon generation or extracting attributes of entities as signals in Simulink.
You can gain insight into the behavior of your model by:
You can observe entity movement in your model through built-in entity animation. You can also build your own MATLAB animations via custom observers that you create for the entities and events in your model.
Most SimEvents blocks produce statistics that let you monitor aggregate measures, such as average service times, queue lengths, and server utilization. Custom scopes enable you to visualize these signals using familiar staircase and stem plots.
The SimEvents debugger is a standalone tool that you can use to debug your model by pausing a simulation at each step or setting a breakpoint to query simulation behavior. The debugger also creates a simulation log with detailed information about what is about to happen or what has just happened in the simulation. You can debug both discrete-event and hybrid simulations by inspecting this log.