getEntityStorageImpl
Class: matlab.DiscreteEventSystem
Namespace: matlab
Define entity storage elements of discrete-event system
Syntax
[storageSpecs,I,O]=getEntityStorageImpl(obj)
Description
[
defines
entity storage elements of a discrete-event system.storageSpecs
,I
,O
]=getEntityStorageImpl(obj
)
Input Arguments
obj
— Discrete-event System object™
MATLAB® object
Discrete-event System object.
Output Arguments
storageSpecs
— Storage specifications
vector of MATLAB structures
Entity storage specifications of a discrete-event system, specified
as a vector of MATLAB structures with its length indicating number
of entity storage elements of the discrete-event system. The Nth
element of the vector defines an entity storage element with index N.
Use utility methods such as queueFIFO
to create
such definition as a MATLAB structure.
I
— Connections between input ports and entity storage elements
cell array
Define connections between input ports and entity storage elements
as a cell array. The length of the cell array must match the number
of input ports of this discrete-event system. The Nth
element of the cell array defines the connection between the N
th
input port and any entity storage element. If the input port is an
entity port, a valid entity storage index must be specified. If the
input port is a signal port, the element takes a value of zero.
You can connect multiple entity input ports to a common storage element.
O
— Connections between output ports and entity storage elements
cell array
Define connections between output ports and entity storage elements
as a cell array. The length of the cell array must match the number
of output ports of this discrete-event system. The Mth
element of the cell array defines the connections between the M
th
output port and any entity storage elements. If the output port is
an entity port, specify one of these:
A scalar indicating a single connection from a storage element to the output port.
A vector indicating multiple connections from multiple storage elements to the output port.
If the output port is a signal port, the element takes a value of zero.
You can connect multiple entity output ports to a common storage element.
Examples
Specify Entity Storage Elements
Specify entity storage elements and connections between entity input ports and storage elements for the discrete-event system object.
function [storageSpecs, I] = getEntityStorageImpl(obj) % Specify entity storage elements and connections between % entity input ports and storage elements. % % The implementation specifies two storage elements for the % discrete-event system: % 1. A priority queue % - Stores entities of type 'student' % - Has maximal capacity of 25 % - Sort entities by an attribute named 'age', in ascending % direction % 2. A FIFO queue % - Stores entities of type 'student' % - Has maximal capacity of 10 % - Sort entities in a First-In-First-Out order % % The implementation also specifies that the entity input port % of the discrete-event system is connected to the 2nd storage % element. % % Other methods of the discrete-event system must have defined: % - An entity type named 'student' (by method 'getEntityTypesImpl') % - An entity input port (by method 'getEntityPortsImpl') % storageSpecs = [... obj.queuePriority('student', 25, 'age', 'ascending'), ... obj.queueFIFO('student', 10)]; I = 2; end
Version History
Introduced in R2016a
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)