0
votes

I hope you are all safe,

Suppose I have this system that is shown in the first photo. There are 2 sources that are linked to 2 different agent types. they are served from the same Delay.

My Goal: is to find the waiting time of the agent from the first sources and agents from the second sources.

What I did: I first used the "timeMeasureEnd" dataset. I ran the simulation and I then checked the datasets_Log in the Logs. (see photo 2).

My problem: is that I can`t know which agents are from source 1 and which are from source 2. it just gives me the index of the agent based on FIFO.

I need a way that gives me the waiting time of each agent as well as tells me the type of the agent (or from which source it came).

What I tried: 1. I tried to save the agent ID in a dataset, but it didn`t show in the logs. 2. I created one extra queue and assigned a dataset for it. The agent ID, as well as the waiting time, is typed in the dataset, then I compared the agent ID. but that would take a long time to do.

I wish I made it clear.

In one word: I need to get the source and the waiting time of the agent.

Thank You

photo 1 photo 2

1

1 Answers

0
votes

Option 1:

just create a variable in your agent called source (it can be an integer)

If your agent comes from source, on exit you can do agent.source=0; if it comes from source1 you can do agent.source=1;

After that on the delay you can use the following for the delay time

agent.source==0 ? delayForAgentsComingFromSource : delayForAgentsComingFromSource1 

of course delayForAgentsComingFromSource is a number.

Option 2:

If your agent types are Meow (source) and Meow2 (source1) then you can in the delay do the following:

agent instanceof Meow ? delayForAgentsComingFromSource : delayForAgentsComingFromSource1