Carlzeriss
Carlzeriss

Reputation: 33

Q: [Anylogic] Measuring production throughput rate

I would like to know how to measure the throughput rate of the production line on Anylogic.

Question: Are there any methods to measure the Time Between Departure of the agent at the sink block? >>(I will calculate the throughput rate by inverting the time between departure value.)

At the moment, I just simply calculated the throughput based on Little's law, which I use the average lead time and WIP level of the line. I am not sure that whether the throughput value based on this calculation will be equal to the inverted value of the time between departure or not?

I hope you guys could help me figure it out. Thanks in advance!

Upvotes: 2

Views: 1317

Answers (2)

Hano Smith
Hano Smith

Reputation: 1

Not sure if this will help but it stems off Tatiana's answer. In the agents state chart you can create variables TimeIn, TimeOut, and TimeInSystem. Then at the Statechart Entry Point have,

TimeIn = time();

And at the Final state have,

TimeOut = time();
TimeInSystem = TimeOut - TimeIn; 

To observe these times for each individual agent you can use the following code,

System.out.println("I came in at " + TimeIn + " and exited at " TimeOut + " and spent " + TimeInSystem + " seconds in the system";

Then for statistical analysis you can calculate the min, avg, and max throughputs of all agents by creating in Main variables, TotalTime, TotalAgentsServiced, AvgServiceTime, MaxServiceTime, MinServiceTime and then add a function call it say TrackAvgTimeInSystem ... within the function add argument NextAgent with type double. In the function body have,

TotalTime += NextAgent;
TotalAgentsServiced += 1;
AverageServiceTime = TotalTime/TotalCarsServiced;

if(MinServiceTimeReported == 0)
{
    MinServiceTime = NextAgent;
}
else if(NextAgent < MinServiceTime)
{
    MinServiceTime = NextAgent;
}
if(NextAgent > MaxServiceTime)
{
    MaxServiceTime = NextAgent;
}

Then within your agent's state charts, in the Final State call the function

get_Main().TrackAvgTimeInSystem(TimeInSystem);

This then calculates the min, max, and average throughput of all agents.

Upvotes: 0

Tatiana Gomzina
Tatiana Gomzina

Reputation: 273

There is a function "time()" that returns the current model time in model time units. Using this function, you may know the times when agent A and agent B left the system, and calculate the difference between these times. You can do this by writing the code like below in the "On exit" field of the "sink" block:

statistic.add(time() - TimeOfPreviousAgent);
TimeOfPreviousAgent = time();

"TimeOfPreviousAgent" is a variable of "double" type; "statistic" is a "Statistic" element used to collect the measurements

This approach of measuring time in the process flow is described in the tutorial Bank Office.

As an alternative, you can store leaving time of each agent into a collection. Then, you will need to iterate over the samples stored in the collection to find the difference between each pair of samples.

Upvotes: 2

Related Questions