Promodel Error "For <Entity> arriving at Queue: A new cycle has been scheduled to start before the current cycle will be completed!" - simulation

This error ocurres when you have set an arrival cycle and click play to run the model.

Solution: "For arriving at Queue: A new cycle has been scheduled to start before the current cycle will be completed!"
The problem is that the arrival cycle table is defined in hours, and the frequency is normally set in minutes, this error could be avoided by setting a higher or equal time than the maximum time set in the arribe cycle table.
i.e. if you define a cycle of 36 hours, you should put in frequency a minimum of "36 hr" or "2160" (36 x 60) by doing this your simulation shouldn't give the error.

Related

AnyLogic - stop simulation at specific model time

I want to stop the model at a specific model time.
Do I have to work with a counter variable per time and then throw stopSimulation() or is there another possibility? My simulation will run for one week in model time. I want to stop the simulation 5min before it will end, so 5min before one week of model time is over.
You can specify the stop time in the simulation experiment properties. See below:
In the settings of Simulation:main you can define exactly when you want your simulation to stop.
See attached image:
To set a week less 5 minutes, replace the number 100 with the number 10,075 (assuming your model runs in units of minutes)
Good luck

SetParameter of a source

I have the following problem: My model must be fed by a fixed number of patients per day. Specifically, three patients must arrive every 11 minutes from 8am to 6pm! I have set the source block in the "Interarrival" mode which allows me to define the interval between patients and to have three patients every 11 min; To block the arrival of patients at 6pm I have created an event which resets the patients arrival rate to zero! But the next morning how can I set again all the specifications for the source block through an event?
I would use the inject function instead of interarrival mode.
You are on the right track by using an event. Set the event as cyclic with a cycle time of 11 minutes. The action would be:
if( getHourOfDay() >= 8 && getHourOfDay() <= 18 )
source.inject(3);
Below are some images to guide you further:

Google OR-Tools: Minimize Total Time

I am working on a VRPTW and want to minimize the total time (travel time + waiting time) cumulated for all vehicles. So if we have 2 vehicles one that starts at time 0 and returns at time 50 and one that starts at time 25 and returns at time 100, then the objective value would be 50+75=125.
Currently I have implemented the following code:
for i in range(data['num_vehicles']):
routing.AddVariableMinimizedByFinalizer(
time_dimension.CumulVar(routing.End(i)))
However, this seems like it is only minimizing the time we arrive back at the depot.
Also it results in very high waiting times.
How do I implement it correctly in Google OR tools?
This is called the span.
See the SetSpanCostCoefficientForVehicle method for one vehicle.
You can also set it for all vehicles.

AnyLogic mean waiting time in queue

I would like to get the mean waiting time of each unit spending in my queue of every hour. (so betweeen 7-8 am for example 4 minutes, 8-9 10 minutes and so on). Thats my current queue with my timemeasure Is there a way to do so?
]
Create a normal dataset and call it datasetHourly. Deactivate the option Use time as horizontal value. This is where we will store your hourly data.
Creat a cyclic event and set the trigger to cyclic, once every hour.
This cyclic event will get the current mean of your time measurement ( waiting time + service time in your example) and save this single value in the extra dataset.
Also we have to clear the dataset that is integrated into the timeMeasurementEnd, in order to get clean statistics again for the next hour interval.
datasetHourly.add(time(HOUR),timeMeasureEnd.dataset.getYMean());
timeMeasureEnd.dataset.reset();
You can now visualise the hourly development by adding the hourlyDataset to a normal plot.

How to set up arrival rate that depends on time

I want to simulate a call center where the customers' arrival rate is different depending on the time slot. For example:
from 8am to 8:30am the rate is 50
from 8:30am to 9am the rate is 60
May I ask how I can set this in Anylogic?
First you create a schedule with the rate that you want:
this example has a default value rate of 10/hour and has the values you suggested for 8:00-9am.
And in the source you define your agent arrivals based on the schedule you created: