Define priority queue storage
entityType— Entity type
Type of entities that the new storage element works with.
Maximum number of entities that the storage can contain, specified as a double.
Name of the attribute that is used as the key for sorting.
order— Sorting order
Direction of sorting. Specify
you want entities with smaller key values to appear in front of the
'descending' if you want entities
with greater key values to appear in front of the queue.
Queue storage element that contains entities and sorts them using a custom attribute.
Define storage element as a priority queue.
% Define a storage element as a priority queue % - Queue sorts entities using a specific attribute of the entities % - Queue can store entities of type 'myEntity' % - Queue can store no more than 25 entities % - Queue uses the attribute 'age' to sort entities % - Sorting direction is 'ascending', resulting entities with % smaller 'age' attribute values to appear in front of the queue storage = obj.queuePriority('myEntity', 25, 'age', 'ascending');