How to get the distribution of all the times in a queue? [closed] - queue

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last year.
Improve this question
Edit: The solution was that the serviceRate was too high for the amount of arriving trucks.
In my Anylogic model, I have a population of terminals (5) and a population of trucks (100). The trucks visit the terminals, which are a queueing model for them. The terminals have a number of gates (e.g., 7) that can all service 1 truck at a time (service time is based on a uniform distribution). If all the gates are busy, the other trucks have to wait in a (FIFO) queue in front of the terminal.
I want to measure the time trucks are standing within the queues before the terminals (without the service time). How can I create these terminal processes best within my Anylogic model?
I tried using a service block (the first processes in the picture), but I think that gives all the time and not only the time within the queue. I also tried a queue and delay block (below), to be able to measure the queue time. However, the distribution of the time measurement is not working as I get no distribution but just 1 (very small) number, as can be seen in the lowest picture. Same if I measure the time within the service or delay block... Does any body know how to let this work? Thanks!

You delay capacity is numberOfGates. It means if that value is 5, then 5 trucks will move into delay block at the same time. Other arrived trucks will wait in the queue if delay.size()=5. There is nothing wrong in this, you should check if your model really works as intended.
The agents would move into delay block immediately if you selected the maximum capacity option in the delay block.
Also instead of timeMeasureStart/End, use your own assignments. That is, inside the delay, on enter type agent.waitStart = time(); and upon leaving type yourHistogramData.add(time()-agent.waitStart);

It turns out that the service rate was too high for the amount of trucks I send to the terminal.

Related

AnyLogic - How to define and redefine Agent's Parameters?

We’re generating the data that we might get from a shop floor to run, test, and validate our machine learning models. We first have here a discrete event simulation model for our manufacturing system. Each production order is seen as an agent, which then goes through different processes with a queue (waiting time) and delays (firstly production time, secondly logistics time).
enter image description here
But sometimes we have one process, for example, printing (code 5A, after the second Select5Output), with three different machines, which do not have a particular capacity. It’s time when we divide our order into parts and send them to those machines (very randomly, subjectively).
The data we take is from flowchart_process_states_log in Database.
The data we take is from flowchart_process_states_log in Database.
My questions here are:
How can we define the number of products in each order? Ex. we’re printing card, for one order it may be 10k, for another 8k or 33k. Can we define it as agent’s parameter? Then how can we vary them (stochastically, no exact number needed).
How can we split those 10k cards into three different machines? And then how to get back an complete agent with 10k? The Agent ID should remain the same as we trace and analyse them in ML model. Is it reasonable to see an order as an agent?
How can we multiply the number of our agent after a process? Ex. After cutting 10k pieces we have 20k.
We have the distribution for delay ex. triangle distribution. But we want some disturbances, when it suddenly takes 2 days for that delay instead of 3-4 hours as normal. How to do it?
Thank you in advance for your effort. Every help is highly appreciated, because we're here and learning together. Thank you !!

Modeling a waiting line in a call centre in AnyLogic

I need to model a waiting line in a call centre in AnyLogic. This is what I don't understand. It says:
If all of the service representatives are busy, an arriving customer is placed on hold, but ties up on the phone lines.
I am not sure what block or how to model customers waiting. Can someone help me? Thank You!
Here is my solution, although I'm absolutely sure other methods exist.
To represent an arrival rate of 15/hr, use a source block with arrivals defined by rate, with the rate set to 15 per hour.
To represent 24 phone lines and 3 service reps, use a queue block (callsWaiting) followed by a delay block (service). The queue block should have capacity = 21 and the delay block should have capacity = 3 with a delay time of exponential(0.1,0) minutes representing the exponential service time (with mean 10 min).
To represent losing calls when all of the phone lines are tied up, place a selectOutput block before the callsWaiting queue and set its condition to: callsWaiting.canEnter(). It will return false if the queue is at maximum capacity. On the false branch for that selectOutput, place a sink block for dropped calls.

How should I implement the function to choose the route i want? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a simple network that has several routes from start to end. Vehicles from a transporter fleet will carry agents from the left conveyor to the right conveyor using the moveByTransporter block. What are some syntax i can use to refer to paths/nodes on the network?
Also, what is a sample code line of how i can check the number of vehicles on a specific path?
This is my sample network and idea of trying how to make a new routing instead of just the shortest path (the path i want to follow is via the yellow highlighted one)
The moveTo block will take the route with the shortest distance. If the agent's speed is the same across all choices, then the shortest distance will also be the fastest time.
In the past, I have used Dijkstra's algorithm and manually routed my agents from a to b, then b to c, etc. This way, I could use travel times instead of just distances. This also opens up the possibility of considering congestion by applying a penalty to some segments if there are too many other agents on them. You can also pick a route, but then when you get to the next node, re-calculate the rest of the route for updated congestion considerations.
This is all custom, and I would not recommend it for simple problems. You would be better off to look at other alternatives (assume constant speeds or consider the pedestrian library with walls, etc, depending on your problem).

to reach the conclusion stability in the model developed in netlogo starting with a random population of agents [duplicate]

This question already has answers here:
How many simulations need to do?
(3 answers)
Closed 7 years ago.
I have a model in netlogo which simulates the behavior of crowd starting with a random population. In every simulation, the people differ so does their behaviour. So, how many simulations must i at least run to conclude the stability in the system?
Your question does not have a specific answer. Do you have different mechanisms which has impact on agent's behavior change? I think for each factor which has impact on the agent's change, run the simulation at least with 20-30 different random-seeds, or even if your simulation does not take that long to finish, try higher number of random-seeds.
On the other hand, if you are talking about number of ticks your agents should live, consider covering enough generations or enough years that make sense. People don't change overtime. If its a habit it might take months or years. If its a cultural aspect of people's life it might take a few generations. Define clearly what each parameter means each tick can mean a day, a week, or anything else.

Why is bandwidth measured in bits per second? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
There is another question with this same title, but the question is asked differently than what's troubling me, and the answer is not sufficient.
The most prominent analogies I hear to explain bandwidth are the highway example, and the pipe example. In the highway example, bandwidth is the amount of cars that can drive on the highway in a given amount of time, and in the pipe its an amount of water that can flow through.
My question is - by measuring by cars per second, or liters per second, does that mean that a longer highway, pipe or copper wire has a higher bandwidth than a shorter one? That seems strange to me.
Wouldn't it make more sense to give the highway bandwidth as the amount of lanes it has - irrespective of a unit of time? It just makes more sense to me and is simpler to say that the pipe is "1 foot in diameter" rather than "it carries 100 litres per second".
Why do we measure bandwidth in bits per second and not just in bits?
"My question is - by measuring by cars per second, or liters per second, does that mean that a longer highway, pipe or copper wire has a higher bandwidth than a shorter one?"
No!
Bandwidth is not about how many cars can fit on the road. It's about how many cars can pass a point on the road during a certain time. How many cars per second can pass under a bridge, for example.
No, it wouldn't. You quote a highway in terms of lanes, because it's more understandable, and a reasonable approximation to assume 4 lanes = 4x as much traffic. But even then, you might have a traffic jam, and then 4 lanes is 'transmitting' fewer cars per minute than it would otherwise.
With a hose pipe, the width of the pipe is the speed of transmission if you assume the same water pressure.
These assumptions don't apply to communications - when I'm transmitting 'a bit' nothing physical is moving *. A 'bit' is the smallest piece that 'information' can be broken down into, and in order to transmit it, something needs to change.
If I turn on my torch and shine it at you, I've sent one 'message' (my torch is on). To send you anything more detailed, I would need to turn it off and on again - morse code is an example of doing this. The pattern of switching it off and on gives you some letters. How fast I can switch it off and on again, is how fast I can send a message.
So it is with bandwidth. I need to change things to communicate. If I can change things faster, I can communicate faster.
"bits" would be a measure of the number of torches I own. Bits per second is how fast I can flick them on and off to send a message.
* Electrons and photons do move, as does air to carry sound. But the signal isn't the thing moving - I don't have to move an atom of air from my mouth to your ear to 'talk' to you, the wave propagates through the medium.