Main Content

getBlocksToNotify

Class: simevents.SimulationObserver
Namespace: simevents

Specify list of blocks to be notified of entity entry and exit events

Syntax

getBlocksToNotify(obj)

Description

getBlocksToNotify(obj) is used to specify a cell array of block paths that are notified by the SimulationObserver object. These blocks have to be discrete event blocks with entity storages. Override this function in your subclass to specify a cell array of blocks for which preExit and postEntry methods will be called. Specify 'ALL' to run these methods on all the discrete-event blocks with entity storages in the model. If you do not want any blocks to be notified, specify an empty cell array, {}.

Input Arguments

expand all

Object of class SimulationObserver

Output Arguments

expand all

Cell array of full block paths of all blocks being notified of runtime events

Examples

expand all

Return the list of blocks you want to observe in the model.

function blks = getBlocksToNotify(this)
            % Return list of blocks to observe in the model
            %
            % For this example, we are only interested in the following
            % blocks as they are sufficient for us to know all events of
            % interest
            blks = { ...
                [this.mModel '/Patron Enter'], ...
                [this.mModel '/Have Dinner'], ...
                [this.mModel '/Patron Leave'] ...
                };
        end

Version History

Introduced in R2016a