Arrival Distributions - anylogic

Working on my model, set up a custom distribution for the agents to arrive in a bimodal distribution to simulate peaks during the day. To be clear, the agent has a parameter called 'arrivals', and we have a custom distribution connected to the agent, where the distribution for 'arrivals' is set to the custom distribution. And finally, the source has the arrival rate set to the aforementioned custom distribution.
However, upon running the model, the arrivals seem to be coming a lot faster than I intend on modelling.
The distributions are set 'per hour'.
Here are screenshots of the source settings and the custom distribution
Source_Settings
Distribution

I suspect that your source block is not re-drawing a different rate everytime it creates an agent, as you likely expect. Instead, it is defining a fixed rate once at the model start (by chance, it is on the faster end of the distr) and keeps that. Read how the Rate setting works and make sure this is what you want. You probably want the "Interarrival time" setting instead as here, a new value is drawn everytime.

Well, did you make sure the Source object also expects the arrivals to be "per hour"?
Sounds like you are still in the default "per second" mode...

Related

Get the same arrival rate across models

I have a model that I have duplicated and made some adjustments to it. When I run both models with the same fixed seed I don’t get the same results, which I understand because I have other sources of randomness in the model. Regardless, in both models, I am using a source block, such that the arrivals are defined by a rate schedule, the schedule is of type rate, and is provided from the database. Now, I know the following pieces of information:
Generally, I can use my own random number generator (RNG) in distributions, for example triangular(5, 10, 25, myRNG), such that Random myRNG = new Random (2)
By default, a schedule with “type” rate follows a passion distribution that utilizes the default RNG.
At anytime in the model, I can substitute the default RNG with my own by calling setDefaultRandomGenerator(Random r).
The question is: Is it possible to use a fixed seed for the arrival rate to make sure I am getting the same exact input in both models?
In anylogic, rates are always equivalent to a poisson distribution with lambda equal to the rate you set,
Intearrival times don't follow any distribution, but using exponential(lambda) in the field is equivalent to using a arrival by rate with a rate of lambda.
But poisson and exponential are closely related, which is why if you use poisson(1.0/lambda) in the intearrival time, you have the same average arrivals as if you use exponential(lambda).
It is not possible to set a seed for the arrival rate, and that's why you need to use intearrival times instead in your source
But you need to create a variable first, let's call it rand, of type Random with initial value new Random(seed)
where seed is any integer you want (long to be more exact)
then in the intearrival time you need to do:
exponential(lambda, 0,rand)
This will lead to unique simulation runs, no matter what configuration you have in the AnyLogic experiment
Sure, simply set both Source blocks to "Interarrival time" in the "arrivals defined by".
Then, use the same code poisson(1, myRNG) in the field, making sure that the myRNG RNG uses the same initial seed (i.e.new Random(1234)
(the "Rate" setting is the same as using poission(1) for interarrival-time)

Arrival defined by a fixed value - AnyLogic

So Im trying to determine whether another vending machine is required in the gas station (it's an exercise not a real life problem). The only thing that Im given is the fact that each minute a customer is trying to use the vending machine and on average it takes 0.95 min for a customer to buy and pay for what he bought. Im having trouble with "arrivals defined by" field. The exercise says that I absolutely must use interarrival rate. It also says that the probability distribution is unknown and that it is most definitely not exponential. My question is the following, is there any way to define interarrival rate without using a distribution function. I tried inputing the number on it's own and the simulation doesn't work. I considered using rate even though Im not suppose to but it just didn't make sense since rate already considers the distribution to be exponential which isn't the case in my simulation.
Based on your requirement I absolutely must use interarrival rate I understand that you need to use an interarrival time, but not necessarily exponential. In this case you can choose any other distribution from a list of distributions (See below).
If you want those arrivals to be uniformly distributed, use the uniform distribution.
Or if you want them to arrive exactly every 5 minutes, create a bulk of the agents, delay them for 5 minutes and let them in to the system.

Estimating Noise Budget without Secret Key

In the latest version of SEAL, the Simulation class has been removed.
Has it been shifted to some other file?
If it has been completely removed from the library, then how can I estimate noise growth, and choose appropriate parameters for my application?
Simulation class and related tools are indeed removed from the most recent SEAL. There were several reasons for this:
updating them was simply too much work with all the recent API changes;
the parameter selection and noise growth estimation tools worked well only in extremely restricted settings, e.g. very shallow computations;
the design of these tools didn't necessary correspond very well to how we envision parameter selection to happen in the future.
Obviously it's really important to have developer tools in SEAL (e.g. parameter selection, circuit analysis/optimization, etc.) so these will surely be coming back in some form.
Even without explicit tools for parameter selection you can still test different parameters and see how much noise budget you have left after the computation. Repeat this experiment multiple times to account for probabilistic effects and convince yourself that the parameters indeed work.

Using a subset of a SUMO scenario for OMNeT++ network simulation (with VEINS)

I'm trying to evaluate an application that runs on a vehicular network using OMNeT++, Veins and SUMO. Because the application relies on realistic traffic behavior, so I decided to use the LuST Scenario, which seems to be the state of the art for such data. However, I'd like to use specific parts of this scenario instead of the entire scenario (e.g., a high and a low traffic load fragment, perhaps others). It'd be nice to keep the bidirectional functionality that VEINS offers, although I'm mostly interested in getting traffic data from SUMO into my simulation.
One obvious way to implement this would be to use a warm-up period. However, I'm wondering if there is a more efficient way -- simulating 8 hours of traffic just to get a several-minute fragment feels inefficient and may be problematic for simulations with sufficient repetitions.
Does VEINS have a built-in mechanism for warm-up periods, primarily one that avoids sending messages (which is by far the most time consuming part in the simulation), or does it have a way to wait for SUMO to advance, e.g., to a specific time stamp (which also avoids creating vehicle objects in OMNeT++ and thus all the initiation code)?
In case it's relevant -- I'm using the latest stable versions of OMNeT++ and SUMO (OMNeT++ 4.6 with SUMO 0.25.0) and my code base is based on VEINS 4a2 (with some changes, notably accepting the TraCI API version 10).
There are two things you can do here for reducing the number of sent messages in Veins:
Use the OMNeT++ Warm-Up Period as described here in the manual. Basically it means to set warmup-period in your .ini file and make sure your code checks this with if (simTime() >= simulation.getWarmupPeriod()). The OMNeT++ signals for result collection are aware of this.
The TraCIScenarioManager offers a variable double firstStepAt #unit("s") which you can use to delay the start of it. Again this can be set in the .ini file.
As the VEINS FAQ states, the TraCIScenarioManagerLaunchd offers two variables to configure the region of interest, based on rectangles or roads (string roiRoads and string roiRects). To reduce the simulated area, you can restrict simulation to a specific rectangle; for example, *.manager.rioRects="1000,1000-3000,3000" simulates a 2x2km area between the two supplied coordinates.
With both solutions (best used in combination) you still have to run SUMO - but Veins barely consums any of the time.

Reproducing Results / Random-Seed / Sensitivity Analysis

I'm building a cost effectiveness model (infectious disease related) in NetLogo consisting of an intervention and "status quo" cohort that should behave identically except for the influence of the intervention. I can reproduce base case results (default parameter values) using the random-seed statement. However, when I change parameters influence intervention efficacy (e.g., compliance) it changes the random number generation process and then causes the outcomes in the status quo cohort to change. How can I get around this? How do I isolate one cohort from changes taking place in another cohort with respect to the random number generation process? the with-local-randomness statement doesn't really help me ..
Unfortunately, you face two serious problems: NetLogo really does not provide access to random number generators other than the global one, and much of the access to that PRNG is implicit. So for example, whenever you use ask, you are implicitly drawing from the global PRNG.
You may be able to use with-local-randomness. E.g., use it every time you ask turtles outside the status-quo cohort to do something. Or, to use with-local-randomness for the special cohort, you could start the simulation by generating a seed sequence that you then consume as the simulation runs, resetting the random state each time you ask that cohort to do something (or generate random numbers, etc.).
Do the cohorts need to be run simultaneously (ie do they interact)? If not, could you simply run two completely separate experiments - one for the control and one for the intervention scenario.