Event based simulation

1.2k Views Asked by At

I don't know how to do event based simulation in matlab. Just need a start for it, this question is a start part of my bigger task.

i have this,

      Arrival   Departure  frequencies
      0.0000    5.9489         0
      0.0000    6.6353         0
      0.0001    6.9292         0
      0.0001    6.9361         0
      0.0001    7.2979         0
      0.0001    7.7989         0
      0.0002    7.9419         0
      0.0002    8.8358         0
      0.0002    8.8383         0
      0.0002    9.0600         0

First column is my event_arrivals and the 2nd column is event_departure. I want to change the value of third column from 0 to 1 when the simulation is in between arrival time and the departure time.

Once the event_departure arrives it again back set to O. Thank you so much.

1

There are 1 best solutions below

5
On

You will need the Matlab SimEvents® Toolbox.

SimEvents® provides a discrete-event simulation engine and component library for Simulink®. You can model event-driven communication between components to analyze and optimize end-to-end latencies, throughput, packet loss, and other performance characteristics. Libraries of predefined blocks, such as queues, servers, and switches, enable you to accurately represent your system and customize routing, processing delays, prioritization, and other operations.

There are free alternatives like Function Chart V.3.2 which with I made good experiences.

Design, simulation, Real-Time Code Generation and Documentation of event-driven systems

I once tried to write an event driven simulation by myself and implement it in Simulink, it's possible, but quite some pain in the ass and definitely too much as an answer for this question.