Main Content

setupEvents

Class: matlab.DiscreteEventSystem
Package: matlab

Initialize entity generation events

Syntax

events=setupEvents(obj)
[events,out1,...]=setupEvents(obj)

Description

events=setupEvents(obj) sets up the first set of entity generation events at the start of simulation.

[events,out1,...]=setupEvents(obj) specifies such event actions of the object when the block has one or more signal output ports.

Input Arguments

expand all

Discrete-event System object.

Output Arguments

expand all

A vector of events to create initial entities. The discrete-event system schedules these events at the start of simulation.

Data outputs of the object. You must specify these output arguments when the object has data outputs.

Examples

expand all

Schedules two entity generation events at the start of the simulation

function events = setupEvents(obj)
    % Schedules two entity generation events at the start of the
    % simulation
    % - An event with tag 'Adam' to generate an entity in storage element 1.
    % - An event with tag 'Eve' to generate an entity in storage element 2.
    events = [...
        obj.eventGenerate(1, 'Adam', 0.5, 200), ...
        obj.eventGenerate(2, 'Eve', 0.8, 100)];
end
Introduced in R2016a