How to model arrival distribution which is non poisson? - anylogic

I am modelling a process where everyday certain x number arrives over a period of month. The arrival rate in anylogic assumes poission distribution. How we should go for no possion distribution ?

Here is 1 way: switch to inter-arrival times and use any distribution you like:
Check out the "Probability distribution wizard" (see help) for more info on available distributions.
Also check custom distributions. And the help on "distributions"... :)
PS: Tons of options, many people asked this previously, use the search as well.

Related

Anylogic - Substantial variances in identical arrival rate schedule outputs

I am currently completing some verification checks on an Anylogic DES simulation model, and I have two source blocks with identical hourly arrival rate schedules, broken down into 24 x 1h blocks.
The issue I am encountering is significant differences in the number of agents generated by one block compared with another. I understand that the arrival rate is based on the poisson distribution, so there is some level of randomness in the instants of agent generation, but I would expect that the overall number generated by these two blocks should be similar, if not identical. For example, in one operating scenario one block is generating 78 agents, whilst the other is only generating 67 over the 24h period. This seems to be a common issue across all operating scenarios.
Is there a potential explanation regarding idiosyncrasies within Anylogic that might explain this?
Any pointers would be welcomed.
I think it occurs because it follows a poisson distribution. To solve this, you could use the interarrival time function of the source block. In that case you would have the same number of arrivals for different source blocks. However, I'm not sure whether this fits a schedule. If not, you could use the getHourOfDay() function together with a parameter representing the interarrival time. You then have to write the code below for every hour of the day:
if(getHourOfDay()==14) parameter =5;
using sources with poisson distributions will definitely not produce same results... That's the magic of stocastic models.
An alternative to solve this problem is the following:
sources will generate using the inject function
use dynamic events that will be in charge to do source.inject();
let's imagine you have R trains coming per day, and this is a fixed value you want to use, you can then distribute the trains accross the day by doing this:
for(int i=0;i<R;i++){
create_DynamicEvent1(uniform(0,1),DAY); //for source1
create_DynamicEvent2(uniform(0,1),DAY); //for source2
}
This doesn't follow a poisson distribution, but generates a predefined number of arrivals of trains throughout the day, and you can use another distribution of your choice if the uniform is not good enough for you.
run this for every day

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.

Arrival Distributions

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...

Recommendation system design

I am currently working on a research in which I try to predict people's IQ.
This is how the research goes, on day 1 participants take IQ test. At regular intervals of 2 weeks they continue to take the test (with different questions maybe) for 6 months.
Given this information (or dataset) how does one go about designing a recommendation system.
I imagine it something like this
IQvalue --input--> [ Recommendation Engine ] --spits out--> probable IQ value (after 6 months)
My actual research is not on IQ at all. I just made this example up.
Kindly suggest if I am going in the right direction at all? Are there any algorithms that do something similar?
Appreciate any help.
For case 1, you only have the time-related IQ values, I suggest you consider the time series analysis methods. Your target is to predict how the IQ change with time. My suggestion for this solution is the statsmodels library. Its github address is as follows:
https://github.com/statsmodels/statsmodels .
This tool is written in python and easy to use. It contains many generally used tsa models, such as ARIMA.
For case 2, if you also have the features of people, for instance, the answers in the QA test, ages, gender, education, etc., I suggest you consider use a machine learning methods to predict the IQs. You may consider the random forest or gradient boost to solve this problem. I suggest you use the tools such as Scikit-learn or xgboost.
For case 3, you can model it as a recommender system problem. Suppose user-test people, item-IQ, rating-IQ value, you can construct a user-item matrix. After that, you can use RS methods, such as matrix factorization or memory-based methods to predict the IQ values.
In my opinion, the first two means may be better for your case.

What's the name of algorithm to decide best collect frequency in facebook games?

So in many facebook games there are various buildings with different collect frequency and the number of collection you can make depends on the length and gap of periods of free time you have in a day.
Thinking about how to find the maximum occurrence of different frequency reminds me of words like knapsack and scheduling, but I forgot what's really the name of the algorithm about this or whether this is as difficult as those problems.
So, what's the name I am looking for?
Thanks.
(Test: Is it possible to bump a question in SO?)
Sounds like weighted interval scheduling.
A list of tasks is given as a set of time intervals; for instance, one task might run from 2:00 to 5:00 and another task might run from 6:00 to 8:00. Posed as an optimization problem, the goal is to maximize the number of executed tasks without overlapping the tasks. A request corresponds to an interval of time. We say that a subset of requests is compatible if no two of them overlap in time and our goal is to accept as large a compatible subset as possible. A compatible set of maximum size is called optimal.