How can I set adifferent service time for each job / vehicle in JSprit? - logistics

Some employees are faster than others doing the services so the service time is different for each one. Its there any way to apply a multiplier on service time for each vehicle?
Other more exact approach would be to provide a service time / vehicle matrix with the duration calculated for each vehicle, I can pre-calculate this matrix with SVM. Is possible to give this data to JSprit?
Edit: I know that its possible to specify a duration for each job.
What I'm asking for is to assign a matrix of different service times for each job depending on the vehicle.

Currently, it is not easily possible. However, since it is OS you can tweak it for your own.
If you do not want to go into the details, please open a new feature request in jsprit's issue tracker. There is actually an open pull request on it. This might be also helpful.

Related

Measuring system time of specific agent in anylogic

I've got 3 different product types of agent, which each go it's individual path within the fabric. How can i measure the average time the product type spends in the system?
My logic looks like this , and i wanted to implement the measurement in the first service, like this:, it will be completed in the last service like this :
Now I get some really high numbers, which are absolutely wrong. The process itself works fine, if you run the measurement with the code "//agent.enteredSystemP1 = time()", you will get a mean of 24 minutes, per product. But how can i get the mean per product type?
Just use the same if-elseif-else distinction in the 2nd service block as well.
Currently, any agent leaving the system adds time to any systemTimeDistribution

Creating a dataset from queue size in service block

I am a newbie to anylogic simulations. In my project, I want to take out queue size at every time step from a service block and create a dataset. Similarly, I also want to take out the mean queue size from the same after every replication and create a dataset of that as well. Can anyone help me with how to do it?
Welcome to SOF and AnyLogic. Best post separate issues for separate questions, see this intro to SOF for AnyLogic users.
But for now:
I want to take out queue size at every time step from a service block and create a dataset.
Use a cyclic event that calls myDataSet.add(myServiceBlock.queue.size())
I also want to take out the mean queue size from the same after every replication and create a dataset of that as well.
In your experiment, add a DataSet myMeanResults. In the "On Simulation end" code box of your experiment, call myMeanResults.add(root.myDataSet.getYMean())
Make sure your Datasets can keep enough values!
Also, always check the AnyLogic help and example models. Very often, these basics are covered there already. Else, tell us what you already tried :)

How to stop timeout in service block

I am modeling ticket system with various SLA. The model must contain several service blocks with different reaction time ( from 2 to 32 hours). In the service block only working hours should be taken into account. So in the service block timeout should stop when non-workong hours and on the weekend. Could you please kindly tell me how i can realize it?
Thank you very much in advance!
I can think of two answers, one simplified but works in many cases, the other more advanced and probably more accurate:
Simplified approach: I would set the model in hours and keep everything running as is without any stop. So, at the end of the simulation, if the total time is 100 hours and you know that you have 8 hours/day with 5 days/week, then you'd know the total duration is 2.5 weeks. Of course, this might have limitations or might become more complex later on if you want day-specific actions (e.g. you want to differentiate between Monday, Tuesday, etc.)
Advanced more accurate approach: Create resources whose capacities are defined by schedule and assigned them to your services. Create a schedule and specify the working hours in that schedule. Check the below link to learn more about schedules. I call this the more advanced approach because you need to make sure the schedule is defined correctly and make sure all elements in the model are properly controlled (e.g. non-service blocks such as source, delays, etc.).
https://help.anylogic.com/topic/com.anylogic.help/html/data/schedule.html?resultof=%22%73%63%68%65%64%75%6c%65%73%22%20%22%73%63%68%65%64%75%6c%22%20
I personally would use the first approach if the model is rather simple and modeling working hours is enough for analysis. Otherwise, I'd go for option 2.
Finally, another option I'd like to highlight is the "suspend/resume" functions. I am only adding this because you asked "how to stop timeout". So these functions specifically stop and resume timeout. But you'll need to define the times at which they are executed (through an event for example).

Is there a way to not start an Anylogic simulation from scratch every time?

Good day
I'm a new user trying to find my with Anylogic.
Any help with the following question will be appreciated.
Is it possible to start a model with initial values/quantities given to certain blocks/sections in a model? In other words not have the model start from 0 but from the values given.
You can run a "warmup" period manually and save that as a model snapshot. In future runs, you can start off from that snapshot by loading it. See the help on model snapshots
This is the general problem of model initialisation (e.g., if you're modelling a manufacturing facility, you may want the run to start with the facility at the state it would be at on 9am next Monday morning). There is no generic answer: what initialisation you need is 100% model-dependent (as is how easy/hard this is).
In particular, process models make this difficult because entities (agents) are expected to have flowed through the process up to the point they 'start' in. You can use things like extra initialisation-only Source/Enter blocks to 'inject' agents into the appropriate process points, but in most models it's not this easy: you will have all kinds of model state that needs to be made consistent with this (e.g., the agents flowing through the process might have attributes which have changed based on what's happened to them so far, so this would have to be made consistent).
That's why warm-up periods (letting the model run 'from empty' for a period until its state is qualitatively what you want as your starting point) is a common approach. Model snapshots can help you here (see Ben's answer) but they're not the only way of doing it. (You can also just 'reset' all your metrics/output gathering at the point when you determine the warm-up period has ended --- i.e., you are effectively establishing a new 'time zero' --- but, again, exactly what you need to do is 100% model dependent.)

Anylogic: How to set Service delay time depending on the resourceSet being used

Basically I've got a Service which can work with two alternatives of ResourceSets. Let's say, the Service would optimally work with one Doctor and one Nurse, but it is also possible to work with only one Doctor if a Nurse isn't available.
Now, assuming the Doctor works slower without a Nurse, the Service's delay time must depend upon the resourceSet being employed at the moment (Doctor+Nurse or Doctor). Any idea how can I program this?
You should also have in mind that my model has various Services in parallel working in the same way, it's not just only one Service line.
Thanks!
You're using Services but, to me, using the combination of Seize, Delay and Release gives you more flexibility.
What I've done is set the resource choice according to the image bellow:
It is important to have the nurses prior to the doctors in the first set (for some reason anylogic would opt for using only the doctor if otherwise - even with a nurse available).
Than, I would write this code:
Which means that if the agent was only able to seize one resource it will take longer (15 is just a random value).
In the delay block, I would set the processing time to agent.processTime
The topology I'm using is this:
Obviously this is a workaround and will not work for every case. You can always change the conditions you verify. I couldn't find a way to check which resource set was picked by the seize operation. If you're in a hurry this will do the trick.
Hope that helps,
Luís