2

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!

1 Answers1

1

I can think of two answers, one simplified but works in many cases, the other more advanced and probably more accurate:

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

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

Emile Zankoul
  • 2,161
  • 2
  • 6
  • 18
  • Emilie, thank you very much for your reply! I’ve tried to use suspend/resume functions in service block and set schedule for resource block (just like the second approach). However, in fact, agents that come in non-working hours leave by timeout. And actually they leave by timeout in non-working hours that is not right according to the model. Could you please kindly clarify, what I am doing wrong? – Kirill Nemkin Feb 12 '21 at 13:26
  • 1
    If you use schedules for resource blocks, you don't need to manually add suspend/resume functions, it is done automatically for you. I guess your issue is with task preemption. You need to specify what happens if in the middle of a service timeout, resource is no longer available. By default, task continues without the resource. In the service properties, tick "task may preempt" , choose "wait for original resource" or wtv makes sense to you and tick "auto suspend/resume agents". I guess that should solve it. – Emile Zankoul Feb 12 '21 at 13:41
  • Emilie, Excuse me, but I need clarification again because I could not build the model. The situation is that when resources are unavailable, timeout timer for incoming agents should be stopped until the moment when resources are available again. And for agents who arrive at the time of resource unavailability, timer of timeout should start from the moment when recourses are available. Now that rule does not work. Thank you very much in advance! – Kirill Nemkin Feb 15 '21 at 11:11
  • 1
    Check this sample model I did. Try experimenting with the inject button and observe the behavior of the service/resource. Isn't that the desired behavior? https://wetransfer.com/downloads/b00b6b9ddf885dcc162d1bc38e0cda4b20210215112201/c91477 – Emile Zankoul Feb 15 '21 at 11:22
  • I attach a modified model https://wetransfer.com/downloads/b74299105739897bd5624162b488378320210215124250/f5f382 It turns out that the agents leave by timeout (sink 1) This does not respond to the correct behavior – Kirill Nemkin Feb 15 '21 at 12:49
  • 1
    They leave by timeout because in the Service properties, you added a timeout of 8 hours which means regardless of resources, if an agent waits for 8 hours in the queue of the service, it will exit via the timeout port. Simply untick "Queue: exit on timeout" in the service properties under the Advanced tab. – Emile Zankoul Feb 15 '21 at 13:05
  • In the target model, I want to check the dependence of the influence of the reaction time and the number of resources. And I need a timeout parameter for this. That is, an agent who comes to service must be served for a certain amount of working hours ( which can be separated by several days), and if not, then leave by the timer – Kirill Nemkin Feb 15 '21 at 13:11
  • Timeout counts the time spent in the queue, not the time in spent in the delay (as you know the service includes both a queue and a delay). Is that what you want? Or you want total time (in queue + delay)? – Emile Zankoul Feb 15 '21 at 13:31
  • Yes, I need to consider the total time – Kirill Nemkin Feb 15 '21 at 13:35
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/228743/discussion-between-emile-zankoul-and-kirill-nemkin). – Emile Zankoul Feb 15 '21 at 13:36