You can extend the existing functionality of SimEvents® by authoring new blocks to model behaviors that are not provided with a SimEvents built-in solution. To create custom functionality in SimEvents models, you can use the MATLAB Discrete-Event System block that allows you to implement a discrete-event System object written in MATLAB® language.
To implement a custom discrete-event System object, inherit matlab.DiscreteEventSystem
class. Link the System object to a SimEvents model by using a MATLAB Discrete-Event
System block. The linked MATLAB Discrete-Event
System block exhibits the desired custom behavior during
simulation.
MATLAB Discrete-Event System | MATLAB discrete-event system |
matlab.DiscreteEventSystem | Base class for discrete-event system objects |
SimEvents Common Design Patterns
The SimEvents library provides design patterns that you can refer to while modeling.
Create Custom Blocks Using MATLAB Discrete-Event System Block
Author discrete-event System object by defining entity types, ports, storage, and events.
Create a Discrete-Event System Object
Use the matlab.DiscreteEventSystem
class to
implement a discrete-event System object.
Generate Code for MATLAB Discrete-Event System Blocks
Configure MATLAB Discrete-Event System block.
Customize Discrete-Event System Behavior Using Events and Event Actions
Define and work with events in custom discrete-event systems.
Call Simulink Function from a MATLAB Discrete-Event System Block
Call Simulink® function from a MATLAB Discrete-Event System Block.
Resource Scheduling Using MATLAB Discrete-Event System and Data Store Memory Blocks
This example shows how to model resource scheduling using data exchange between the MATLAB Discrete-Event System block and the Data Store Memory block.