Define system priority queue storage
defines a priority queue storage element that sorts entities by their system priorities.
Use this method when implementing the
entityType — Entity type
Type of entities that the new storage element works with.
capacity — Capacity
Maximum number of entities that the storage can contain, specified as a double.
order — Sorting order
Direction of sorting. Specify
you want entities with smaller system priority values (higher priority)
to appear in front of the queue. Use
you want entities with higher system priority values (lower priority)
to appear in front of the queue.
storage — Storage
Queue storage element that contains entities and sorts them by the entities’ system priorities.
Define Storage Element as System Priority Queue
Define a storage element that uses an entity system priority for sorting.
% - Queue sorts entities using entity priority (i.e. % the field 'entVar.sys.priority' on a MATLAB variable 'entVar' % representing a SimEvents entity) % - Queue can store entities of type 'myEntity' % - Queue can store no more than 25 entities % - Sorting direction is 'ascending', resulting entities with % higher priority (or smaller entity priority values) to appear % in the front of the queue storage = obj.queueSysPriority('myEntity', 25, 'ascending');