Main Content

cancelForward

Class: matlab.DiscreteEventSystem
Namespace: matlab

Cancel previously scheduled forward events

Syntax

event=cancelForward(destinationType,destinationID)

Description

event=cancelForward(destinationType,destinationID) cancel previously scheduled forward events on the current entity. You can then schedule this event by returning it as the output argument when implementing an event action method, such as entry or exit.

Input Arguments

expand all

Destination type. Its value can be either:

  • storage, if destination of the forward event is a storage element.

  • output, if destination of forward event is an output port.

Destination index, specified as a double. Its value can be either:

  • Storage index, when destinationType is storage.

  • Output port index, when destinationType is output.

Output Arguments

expand all

Event for cancelling an entity forward.

Examples

expand all

Cancel a previously scheduled forward event of the entity in the current event action context.

function [entity,events] = timer(obj,storage,entity,tag)
    % Cancel a previously scheduled forward event of the entity in
    % current event action context. The entity was scheduled to go to
    % storage element 2. 
    event1 = obj.cancelForward('storage', 2);
 
    % Cancel a previously scheduled forward event of the entity in
    % current event action context. The entity was scheduled to go to
    % output port 1.
    event2 = obj.cancelForward('output', 1);        
end

Version History

Introduced in R2016a