I'm still new to Mathematica and this is the first time I've wanted to do something more complicated than plotting and changing parameters of mathematical functions.
I want to make a simple simulation of a bus station. Two SkewNormalDistribution
s with different parameters give the rates for arrivals and services. Basically, the program should draw a number from the arrival distribution, then draw a number from the service distribution, subtract it from the arrivals and go on to the next simulation step. If possible, each number should be represented graphically. For instance, drawing 20
from the arrival distribution could be represented as a list of 20 circles, or 20 *
s.
As far as I know, this is something that could be made with Animate[]
(and maybe Table[]
), but I don't even know where to start. I thought of using a While[]
loop and using Pause[]
at the end of each step, but I don't think this is a good way of doing it.
Edit: Here's the procedural code of what I want to do:
arrivals = SkewNormalDistribution[30, 5, -4];
departures = SkewNormalDistribution[2, 1, 0];
Do[
entries = Round[RandomReal[arrivals]];
services = Round[RandomReal[departures]];
remaining += entries - services;
If[remaining < 0, remaining = 0];
Print[entries]; Print[services]; Print[remaining]; Print[" "],
{n, 10}
]