AnyLogic
Expand
Font size

Schedule exceptions

Schedules having duration types with mapping to the calendar (Week and Days/Weeks) may have exceptions — particular time intervals when the value defined by this schedule should have other values, differing from the ones defined in the schedule.

Schedule may have unlimited number of exceptions.

Exceptional intervals may have any duration — e.g. a half an hour in some particular day, or the whole day of the year (or even several days in succession).

Exceptions are defined in the Exceptions section of the Properties view of the schedule. In general you will need to define both start and end dates and times for each particular interval. But since frequently exceptions are exactly one day long, AnyLogic supports special simplified definition mode for this case, named All day. In this mode you only specify particular days you want to make exceptions but do not have to define start and end times for each exceptional interval.

National holidays

The most frequent use case of “all day” exceptions are national holidays. In case your schedule defines a work timetable for some resources and you want to consider days off caused by national holidays, you can declare holidays as exceptions and set zero value or off status (depending on the schedule’s Type) for them. This will lead to considering these days as days off further to regular days off.

Below you can see an example. Please note that the Annually checkbox is selected in all table rows since all these holidays are celebrated annually and there is no need to specify them separately for each year you plan to simulate.

Workday transfers

Other frequently met case — workday transfers caused by national holidays. There are some countries (Russia, Ukraine, etc.) where workdays are transferred to days off. For instance, when a holiday falls on Tuesday, a day off is transferred from Saturday to Monday so that citizens will have three days off (Su Mo Tu) in succession. To define workday transfers, you need to declare the days off that will become workdays as the exceptions and set a non-zero value or on status (depending on the schedule’s Type) for them.

While holidays can be easily defined by picking the required days in the All day mode, you cannot define workday transfers in the same simple way. The reason is that you will have not only to mention all these days, but also define the work timetable for the days that became workdays and this certainly requires specifying Start and End times for each exceptional interval.

You can see the following workday transfer defined in the given example. In 2013 the Victory Day is celebrated on Thursday, May, 9. So, the day off is transferred from Sunday, May, 12 to Friday, May, 10.

Let’s assume that this schedule defines that some resources work regularly from 10 AM till 6 PM. As you can see, we have defined those particular intervals for the day off that was made the workday due to transfers.

Please note that the checkbox Annually is cleared since the transfer pattern is specific for each particular year.

Other use cases

You can also use exceptions for modeling less trivial tasks like the demand boost in the New Year’s and Christmas Eve, or extension of the shop staff in those days.

To define exceptions for a schedule

  1. Go to the Exceptions section of the schedule properties.

  2. If you want to define day-long exceptional intervals, select the checkbox All day. If some intervals have other duration, leave this checkbox cleared.
  3. Define the required number of intervals in the table below. Each interval is defined in the separate row of the table. To add one more row, click the button to the right of the table. Then define the interval duration.
  4. If the All day option is chosen, all exceptions in the table are day-long, so you should only specify the required day in the Day cell of this table row using the date chooser.

  5. If some exceptional intervals have other duration, do not choose the All day option. In this case you will have to define start and end date and times of the exceptional interval in the Start and End cells correspondingly using the date chooser.

  6. If you want the defined exception to occur annually in the specified day, leave the checkbox in the Annually cell selected. Otherwise, if you want it to occur only in the specified year, clear it.
  7. Type the value corresponding to this particular interval, in the Value cell (the type of the value here is the same you have chosen in the Type group of buttons in the general properties of this schedule).
  8. Add more exceptional intervals in the same way by repeating steps 4-7.

Finally, you can preview the resulting schedule on the Preview properties section of the schedule. Just navigate to the days that contain exceptional intervals and make sure that these intervals are defined correctly.

How can we improve this article?