Anylogic-how to create parament containing changing growth rate over time - anylogic

I am building a simulation in Anylogic. I am new to anylogic. I would like to define a parameter: e.g. expected growth rate. it is not constant. it changes monthly. I would like to assign growth rate over a 18 month horizon and add product variants. e,g. product A, growthrate is 5% in the first month, Product B is 4% in the first month. product A, growthrate is 3% in the second month, Product B is 5% in the second month.
How do I realize the requirement in Anylogic
Bests
Zishi

Create a variable called growthRates of type ArrayList<Double>() of size how many products you simulate.
Create an integer variable called month.
Create a Source block that creates a dummy agent every month and connect it to a Sink block. Inside Sink block, On Enter section, update your variables based on the time. For example;
month+=1;
if (month==0){
growthRates.set(0, 0.05); //growth rate for product A
growthRates.set(1, 0.04; //growth rate for product B
}
else if(month==1){
growthRates.set(0, 0.06); //growth rate for product A
growthRates.set(1, 0.03); //growth rate for product B
}
...
Then in your simulation, you use this variable growthRates with the correct index when referring to different products.

Related

Mean statistics about agents in Anylogic

I'm working on a family practitioner model, my goal is to model the population of a city and all of the family practitioners in that given city by taking into account the distribution of the treatment time and the arrival schedule of patients etc... So far i've managed to create an agent that contains a bloc diagram to model the whole process
With a source and a delay bloc to generate patients according to a fixed schedule, a service bloc and two sinks.
Now i've put a population of this agent "process" in the main and i've simulated the model for 3 months.
Lets say i've started with a population of 10 process which represents the number of practitioners. My goal now to to collect some Mean statistics, like the Mean number of treated patients (treated patients goes to the sink "Served") of the 10 practitioners, the Mean waiting time of patients at the service bloc, the mean utilization ratio of the resource of the service bloc...
I want to also know if is it possible to limit the total number of Patients (or to at least count them), for exemple, instead of simulating the model for 3 months, i wanna limit the total number of patients that goes to the 10 process to 10k and i want to know how much time does it take to serve all of them. (is it possible with this architecture of the model or do i have to make major changes)
Thank you

Pick rate calculation

I am trying to create an excel sheet that calculates average cases per hour based off of start time, end time, and total case count of the order. Ex. Employee A takes a 200 cs order at 0700 and completes by 0745. Employee B takes a 350 case order at 0715 and completes at 0920. Is it possible to create a spreadsheet with formulas that will calculate after entering the required data?
Looking for the pick rates per order, then would like to average on an 8 hour day per each employee.

How to determine costs for the service time and idle time in a queuing problem in anylogic?

I need to simulate a simple M/M/1 problem in Anylogic. So far, I created the model and calculated all performance measures like the average time in queue and system and the average number in queue and system. Now I need to calculate the Total Costs. The painting time for a car would be 6 hours and costs $70 per hour. The cost of idle time per car is $100 per hour. The cars arrive according to a Poisson process with a mean rate of 1 every 5 hours. Can someone help me how I can calculate the total costs in this model in annylogic?
enter image description here
Refer to this question about measuring time:
Method the measure the time an agent is not in use during a simulation
You need to create an agent type that has variables for time and cost. Then on the On Enter and On Exit fields, record time and cost for individual agents. Once you have measured time, cost is simply time multiplied by the hourly cost.
If you want to measure total cost, you can create variables in main such as totalCost and the code of the sink's On Enter would be:
totalCost += agent.totalCost
Where the second totalCost variable would be the variable inside the agent type.
Anyway, the above should give you a good idea on how to proceed...

Gathering statistics on agent population

I have some issues with gathering statistics on the population level in a model I've been working with.
In the model I have an agent type Company and RawMaterial. Within Company a process flow exists, where on some blocks costs are assigned to a variable in Company upon entry of RawMaterial (e.g. cost = gamma(3, 125, 0);)
To calculate the Company-level cumulative costs I use a Statistics object with cost in the value field of this object.
So far so good it seems.
However, when I want to sum the cumulative costs of all Company agents into one value I run into trouble. Ideally, I want the cumulative costs for each Company agent to be plotted in Main.
I've looked at the Help file (section "Functions to collect statistics on agent population") with no success.
what about doing this in main? (you can even put this function in your time plot)
sum( companies, c->c.cost );
This function calculates the sum of the costs of all company agents (as long as you have a population of agents called companies in main, and not only an agent type)
If you don't have companies as a population of agents, you have to create it, otherwise it's very difficult to calculate anything. How to create it depends on your model.

OLAP Cube design issue for Telecommunication Data

Background: I’m doing analysis of call detail record (CDR) data in order to segmentify customer with respect to their call duration, time of call (holiday call or non holiday call, Business call or non Business call), age group of subscriber and gender. Data is from two table name cdr (include card_number, service_key, calling, called, start_time, clear_time, duration column) and subscriber_detail (include subscriber_name, subscriber_address, DOB, gender column)
I have design OLAP as given below.
Call_date includes Date of call with year, month, and day. Call_time is time of call happen in second.
Question:- if we take call_time in second then it has 86400 column for each day (may be curse of dimensionality) and so we think to reduce its dimensional by taking 30 second time pulse ( telecom charges money on the basic of the pulse and 30 is pulse duration for our context). First Question is :- Is it the best way to replace time by pulse duration? And second is :- if one subscriber do more than 2 call on range of pulse it may cause problem i.e. first call start at 21:01:00 and end at 21:01:05 and he start second call at 21:01:15 and end at 21:01:20. How to resolve these type of problem.
If I were you I would divide the time in 10 minute slot and use link list to store multiple duration time within given time slot so total dimension of time is 144 (Which restrict roll down upto 10 minutes only).
I would keep start_call_time, end_call_time and ellapsed_call_time in seconds.
Then having ellapsed_time does not mean the cube would have a dimension of 86400 members; you could setup a 'ranged/banded' dimension : i.e., a dimension that is built using intervals instead of instants. This is something possible for example with icCube (www).