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

Answers (0)

Categories

Find more on Create Large-Scale Model Components in Help Center and File Exchange

Products

Release

R2023a

Asked:

on 8 Apr 2023

Community Treasure Hunt

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

Start Hunting!