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

Respuestas (0)

Categorías

Más información sobre General Applications en Centro de ayuda y File Exchange.

Productos

Versión

R2023a

Preguntada:

el 8 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by