Iterating in Discrete Event System

Hi,
can somone show me how I can iterate over a FIFO storage and forward the entiyty which entered first. I´m iterating over a storage using function [entity, event, next] = entityIterate how can I tell the allgorithm to forward the entity with a specific attribute which has the longest waiting time to a specific output. I´ve coded it like this but the problem is that it´s forwards the first entity it found (the one which entered last) but I need it to forward the one who entered first:
function [entity, event, next] = entityIterate(obj,~,entity,~,~)
event=obj.initEventArray;
if entity.data.Attribute==1
event=obj.eventForward('output',3,0);
next=false;
else
next=true;
end

回答(0 个)

类别

帮助中心File Exchange 中查找有关 General Applications 的更多信息

产品

版本

R2023a

提问:

2023-4-8

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by