Schedule Restricted Elements
Schedule Restricted Elements may be specified using the language proposed in
B. Leban, D. McDonald, and D.R. Forster. A representation for collections of temporal intervals. In Proceedings of the 5th International Conference on Artificial Intelligence (AAAI'86), volume 86, pages 367--371, 1986.
Download
A schedule is described by a calender expression. A calender expression has the following syntax (in EBNF)
calendarExpression := (slicing "/")? basicCalender (dicingOperator ( basicCalender | "(" calenderExpression ")" ))?; slicing := "the" | "any " <integer> | "-"?<integer> | "["<integer> ("," <integer>)*"]" | "["<integer> "-" <integer>"]"; dicingOperator := ":" dicingOP ":" | "." dicingOP "."; dicingOP := "during" | "overlaps"; basicCalender := "SECONDS" | "MINUTES" | "HOURS" | "DAYS" | "WEEKS" | "MONTHS" | "YEARS";
For example, expression [1-5]/DAYS :during: WEEKS
denotes the first 5 days of each week, i.e., from Mondays till Fridays.
Basic Calendars
The basic calendars serve as a basis for constructing collections of time points using the available operators. The following basic calendars a defined by default:SECONDS
MINUTES
HOURS
DAYS
WEEKS
MONTHS
YEAR
Operators
New collections can be built by combining other collections using operators. Thereby the basic calendars serve as a basis for this construction. There are two types of operators: Slicing and DicingSlicing
The slicing operators provide means of selecting intervals from collections of intervals, for example, to select the first interval of a collection.
- Single Selection: one of
the
select the only element in the collectionany <integer>
select any i-th element of each interval of the collection<integer>
select the i-th element of the collection
- Interval Selection:
[<integer> - <integer>]
select the range from the element denote by first integer to the element denoted by the second integer from the collection - Set Selection:
[<integer>(, <integer>)*]
select the given elements
[9-16]
applied to hours denotes the time from 08:00:00am till 15:59.59pm. In turn, the 1st day of the week is Monday.
Dicing
The dicing operators provide means of generating collections from intervals, for example, to break a collection of intervals into smaller intervals.
A dicing operator takes an order 1 collection as its left argument, an interval as its right argument and produces an order 1 collection as a result. A dicing operator can also take a collection as the right argument, in which case it operates on each interval in that collection.
For each relational operator (R
) there are two dicing operators: strict (:R:
) and relaxed (.R.
). The effect of a strict dicing operator is to break up t
into pieces according to C
. An illustrative example occurs when C
is a calendar. The expression Weeks :overlaps:
(January-1986)
will break up the month on the boundaries of the weeks, i.e., it will give those weeks or parts of weeks that overlap the month. The
effect of a relaxed dicing operator is to select intervals from C
that have the appropriate relation with t
. Thus Weeks .overlaps. (January-1986)
will break up the month in the same way as above, but for the weeks at the beginning
and end of the month it will give the entire week (including that part not overlapping the month). In contrast, Weeks :during: (January-1986)
will give
only the weeks that are completely contained in the month.
Available Dicing Operators:
during
overlaps
- More to come...
Examples
Exression | English |
---|---|
1/DAYS :during: WEEKS |
Mondays (i.e., first day of each week). |
[1-5]/DAYS :during: WEEKS |
The first 5 days of each week, i.e., from Monday to Friday of each week |
[9-16]/HOURS :during: ([1-5]/DAYS :during: WEEKS) |
8am till 4pm from Monday till Friday. |