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 ExchangeGeneral 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