|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Xml format for AutoRoster problem instances
This document describes the data format used for AutoRoster problem instances.
As well as being read by the rostering engine, the data format can also
be read by Roster Booster.
The data format is an XML based format and so can be created and edited using any text
editor. An xml aware editor is recommended to allow the data to be validated
against the format's schema as it is edited.
Many XML editors also provide other useful features such as tag suggestion
and auto-completion.
The data required to describe an employee scheduling problem instance can be split into five main sections:
Examples of instances modelled using the format can be found in the example
instances section. See also the FAQs for examples of how to model some of the more common constraints.
The root element of the document. Attributes
Elements SchedulingPeriod contains a sequence of child elements in the following order:
Example <?xml version="1.0" encoding="UTF-8"?> <SchedulingPeriod ID="Example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SchedulingPeriod-3.0.xsd"> <StartDate>2009-04-05</StartDate> <EndDate>2009-04-30</EndDate> <ShiftTypes> <Shift ID="E"> <Label>E</Label> <Color>#66FF00</Color> <StartTime>07:00:00</StartTime> <EndTime>14:45:00</EndTime> </Shift> </ShiftTypes> <Contracts> <Contract ID="A"> <Patterns> <Match> <Max> <Count>10</Count> <Weight>1000</Weight> <Label>Max 10 E shifts</Label> </Max> <Pattern> <Shift>E</Shift> </Pattern> </Match> </Patterns> </Contract> </Contracts> <Employees> <Employee ID="A"> <ContractID>A</ContractID> </Employee> </Employees> <CoverRequirements> <DayOfWeekCover> <Day>Saturday</Day> <Cover> <Shift>E</Shift> <Min>2</Min> </Cover> </DayOfWeekCover> </CoverRequirements> </SchedulingPeriod> Skills can be placed in groups for use in cover constraints. Parents : SchedulingPeriod Attributes NoneElements SkillGroups contains zero or more <SkillGroup> elements.
Example <SkillGroups> <SkillGroup ID="AorB"> <Skill>A</Skill> <Skill>B</Skill> </SkillGroup> </SkillGroups> A group of skills. Parents : SkillGroups Attributes
Elements SkillGroup contains one or more <Skill> elements.
Example
<SkillGroup ID="123">
<Skill>1</Skill>
<Skill>2</Skill>
<Skill>3</Skill>
</SkillGroup>
ShiftTypes contains the definitions of the different shifts to be assigned in the scheduling period. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more <Shift> elements.
Example <ShiftTypes> <Shift ID="N"> <Label>N</Label> <Color>LightBlue</Color> <Name>Night</Name> <StartTime>18:00:00</StartTime> <EndTime>06:00:00</EndTime> </Shift> <Shift ID="E"> <Label>E</Label> <Color>LightGreen</Color> <Name>Evening</Name> <StartTime>12:00:00</StartTime> <EndTime>20:00:00</EndTime> </Shift> <Shift ID="D"> <Label>D</Label> <Color>Yellow</Color> <Name>Day</Name> <StartTime>06:00:00</StartTime> <EndTime>16:00:00</EndTime> </Shift> <Shift ID="O"> <Label>O</Label> <Color>Red</Color> <Name>Other work</Name> <StartTime>06:00:00</StartTime> <EndTime>18:00:00</EndTime> <AutoAllocate>false</AutoAllocate> </Shift> </ShiftTypes> A specific shift type. For example a night shift. Parents : ShiftTypes Attributes
Elements Shift contains the following child elements in any order:
Example
<Shift ID="E">
<Label>E</Label>
<Color>#66FF00</Color>
<Name>Early</Name>
<StartTime>07:00:00</StartTime>
<EndTime>14:45:00</EndTime>
<TimeUnits>75</TimeUnits>
</Shift>
Resources contains resource ID's and integer values. Resource values may also be specified to be used only on certain days in the planning period. Parents : Shift Attributes NoneElements Resources contains zero or more <Resource> elements.
Example <Shift ID="D1"> <TimePeriods> <TimePeriod><Start>08:30:00</Start><End>15:30:00</End></TimePeriod> <TimePeriod><Start>17:30:00</Start><End>22:30:00</End></TimePeriod> </TimePeriods> <Resources> <Resource ID="ShiftUnits">2</Resource> <Resource ID="TimeUnits">10</Resource> </Resources> </Shift> Resource contains an ID attribute and a NonNegativeDouble value. A resource value may also be specified to be used only on certain days in the planning period using the attributes below. If none of these attributes are used then the resource value applies to all days in the planning period. Parents : Resources Attributes
Element Each <Resource> element is a NonNegativeDouble defining the quantity/value for this resource.
Example <Shift ID="D1"> <Resources> <Resource ID="TimeUnits">8</Resource> <Resource ID="TimeUnits" DayOfWeek="Monday">12</Resource> <Resource ID="R1" Date="2010-09-14">100</Resource> <Resource ID="R1" Date="2010-09-15">100</Resource> <Resource ID="R1" Date="2010-09-16">100</Resource> </Resources> </Shift> Shift types can be placed in groups which are used in some constraints. Parents : SchedulingPeriod Attributes NoneElements ShiftGroups contains zero or more <ShiftGroup> elements.
Example <ShiftGroups> <ShiftGroup ID="N"> <Shift>N1</Shift> <Shift>N2</Shift> </ShiftGroup> <ShiftGroup ID="L"> <Shift>L1</Shift> <Shift>L2</Shift> <Shift>L3</Shift> </ShiftGroup> <ShiftGroup ID="E"> <Shift>E1</Shift> <Shift>E2</Shift> <Shift>E3</Shift> </ShiftGroup> </ShiftGroups> A group of shift types. Parents : ShiftGroups Attributes
Elements ShiftGroup contains one or more <Shift> elements.
Example
<ShiftGroup ID="EN">
<Shift>E</Shift>
<Shift>N</Shift>
</ShiftGroup>
Contracts contain the constraints on the employees' work schedules. Parents : SchedulingPeriod Attributes NoneElements Contracts contains zero or more <Contract> elements.
Example <Contracts> <Contract ID="A"> <Workload> <TimeUnits> <Max> <Count>1500</Count> <Weight>100</Weight> <Label>Max 150 hours</Label> </Max> </TimeUnits> </Workload> <Patterns> <Match> <Max> <Count>0</Count> <Weight>1000</Weight> <Label>No N-E</Label> </Max> <Pattern> <ShiftGroup>N</ShiftGroup> <ShiftGroup>E</ShiftGroup> </Pattern> </Match> <Match> <Max> <Count>0</Count> <Weight>1000</Weight> <Label>No N-L</Label> </Max> <Pattern> <ShiftGroup>N</ShiftGroup> <ShiftGroup>L</ShiftGroup> </Pattern> </Match> </Patterns> </Contract> </Contracts> The working preferences and requirements (constraints) for each employee assigned this contract. Parents : Contracts Attributes
Elements Contract may contain zero or more of the following elements in any order.
Example <Contract ID="A"> <Workload> <TimeUnits> <Max> <Count>1500</Count> <Weight>100</Weight> <Label>Max 150 hours</Label> </Max> </TimeUnits> </Workload> <Patterns> <Match> <Max> <Count>0</Count> <Weight>1000</Weight> <Label>No N-E</Label> </Max> <Pattern> <ShiftGroup>N</ShiftGroup> <ShiftGroup>E</ShiftGroup> </Pattern> </Match> <Match> <Max> <Count>0</Count> <Weight>1000</Weight> <Label>No N-L</Label> </Max> <Pattern> <ShiftGroup>N</ShiftGroup> <ShiftGroup>L</ShiftGroup> </Pattern> </Match> </Patterns> </Contract> This constraint is used to model the requirements of min/max total time units (or any other resource) between any two dates in the planning period. Each shift has an associated number of time units (and other resources) (see ShiftTypes). Parents : Contract Attributes NoneElements Workload contains one or more <TimeUnits> elements.
Example
<Workload>
<TimeUnits>
<Max>
<Count>1500</Count>
<Weight>100</Weight>
<Label>Max 150 hours for the total planning period</Label>
</Max>
</TimeUnits>
</Workload>
TimeUnits specifies a minimum and/or maximum total number of time units (or other resource) that can be assigned to the employee between any two dates in the planning period. The dates can be specified using the day number in the planning horizon or actual dates. The first day in the planning period is day zero. Parents : Workload Attributes NoneElements Workload contains a <Min> and/or a <Max> element (in either order) followed by <RegionStart> or <RegionStartDate> (both are optional) followed by <RegionEnd> or <RegionEndDate> (both are optional) followed by <ShiftGroup> (optional) followed by <Resource> (optional). The default start day is day zero if <RegionStart> and <RegionStartDate> are omitted. The default end day is the last day in the planning horizon if <RegionEnd> and <RegionEndDate> are omitted.
Example
<TimeUnits>
<Max>
<Count>750</Count>
<Weight>100</Weight>
<Label>Max 75 hours in two weeks</Label>
</Max>
<RegionStart>0</RegionStart>
<RegionEnd>13</RegionEnd>
</TimeUnits>
Specifies a minimum value for a constraint.
Parents : TimeUnits Attributes NoneElements Min contains the following elements in any order.
Example
<Min>
<Count>1</Count>
<Weight function="Quadratic">1000</Weight>
</Min>
Specifies a maximum value for a constraint.
Parents : TimeUnits Attributes NoneElements Max contains the following elements in any order.
Example
<Max>
<Count>1</Count>
<Weight function="Quadratic">1000</Weight>
</Max>
Specifies a minimum value for a constraint.
Parents : Match Attributes NoneElements Min contains the following elements in any order.
Example
<Min>
<Count>1</Count>
<Weight function="Quadratic">1000</Weight>
</Min>
Specifies a maximum value for a constraint.
Parents : Match Attributes NoneElements Max contains the following elements in any order.
Example
<Max>
<Count>1</Count>
<Weight function="Quadratic">1000</Weight>
</Max>
This is a general and flexible constraint which can model a wide variety of requirements on the employee's schedule. Parents : Contract Attributes NoneElements Patterns contains one or more <Match> elements.
Example
<Patterns>
<Match>
<Max>
<Count>18</Count>
<Weight>1000</Weight>
<Label>Max 18 shifts</Label>
</Max>
<Pattern>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
<Match>
<Max>
<Count>4</Count>
<Weight>1000</Weight>
<Label>Max 4 nights</Label>
</Max>
<Pattern>
<Shift>N</Shift>
</Pattern>
</Match>
<Match>
<Max>
<Count>0</Count>
<Weight>10</Weight>
<Label>Min 2 consecutive free shifts</Label>
</Max>
<Pattern>
<Start>0</Start>
<Shift>-</Shift>
<ShiftGroup>All</ShiftGroup>
</Pattern>
<Pattern>
<ShiftGroup>All</ShiftGroup>
<Shift>-</Shift>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
<Match>
<Max>
<Count>0</Count>
<Weight>1000</Weight>
<Label>Max 6 consecutive days on</Label>
</Max>
<Pattern>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
<Match>
<Max>
<Count>0</Count>
<Weight>100</Weight>
<Label>Complete weekends</Label>
</Max>
<Pattern>
<StartDay>Saturday</StartDay>
<ShiftGroup>All</ShiftGroup>
<Shift>-</Shift>
</Pattern>
<Pattern>
<StartDay>Saturday</StartDay>
<Shift>-</Shift>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
<Match>
<Max>
<Count>0</Count>
<Weight>1000</Weight>
<Label>No night shift before a free weekend</Label>
</Max>
<Pattern>
<StartDay>Friday</StartDay>
<Shift>N</Shift>
<Shift>-</Shift>
<Shift>-</Shift>
</Pattern>
</Match>
<Match>
<Max>
<Count>0</Count>
<Weight>1000</Weight>
<Label>At least two free days after a night shift</Label>
</Max>
<Pattern>
<Shift>N</Shift>
<Shift>-</Shift>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
</Patterns>
Match specifies a minimum and/or maximum total number of matches of particular sequences of shifts (patterns) between any two dates in the planning period. The dates can be specified using the day number in the planning horizon or actual dates (the first day in the horizon is day zero). A pattern is only matched if it is found entirely between the start and end date. A pattern is specified using a regular expression which matches one of the following for each day in the pattern :
A pattern can optionally also include a start day or date which restricts the pattern to starting on that day. Many scheduling requirements can be modelled using this constraint. Examples of the different requirements that can be modelled using this constraint can be found in the example instances. Parents : Patterns Attributes NoneElements Match contains a <Min> and/or a <Max> element (in either order) followed by <RegionStart> or <RegionStartDate> (both are optional) followed by <RegionEnd> or <RegionEndDate> (both are optional) followed by one or more <Pattern> elements. The default start day is day zero if <RegionStart> and <RegionStartDate> are omitted. The default end day is the last day in the planning horizon if <RegionEnd> and <RegionEndDate> are omitted.
Example
<Match>
<Max>
<Count>2</Count>
<Weight>1000</Weight>
<Label>Max 2 consecutive working weekends</Label>
</Max>
<RegionStart>5</RegionStart>
<RegionEnd>20</RegionEnd>
<Pattern>
<StartDay>Saturday</StartDay>
<ShiftGroup>All</ShiftGroup>
<Shift>-</Shift>
</Pattern>
<Pattern>
<StartDay>Saturday</StartDay>
<Shift>-</Shift>
<ShiftGroup>All</ShiftGroup>
</Pattern>
<Pattern>
<StartDay>Saturday</StartDay>
<ShiftGroup>All</ShiftGroup>
<ShiftGroup>All</ShiftGroup>
</Pattern>
</Match>
Pattern is a regular expression for matching sequences of shift types and days off in an employee's schedule. Parents : Patterns Attributes NoneElements Pattern contains any number of <Start>, <StartDay>, <StartDate>, <Starts> and <StartExcludes> elements (all optional) followed by one or more of the elements : <Shift>, <NotShift>, <ShiftGroup>, <NotGroup> (in any order). If none of <Start>, <StartDay>, <StartDate>, <Starts> or <StartExcludes> are used then the pattern will be matched when it starts on any day in the planning period.
Example <Match> <Max> <Count>3</Count> <Weight>1000</Weight> <Label>Max 3 Sundays</Label> </Max> <Pattern> <StartDay>Sunday</StartDay> <ShiftGroup>All</ShiftGroup> </Pattern> </Match> Conditional constraints can be used to model rules of the form IF Condition1 satisfied THEN Condition2 must be satisfied. Condition1 and Condition2 and boolean logic expressions made up of boolean variables and 'AND' and 'OR' operators. The boolean variables are linked to Workload and Patterns constraints and are assigned the values true or false depending on whether their underlying constraint is satisfied. Parents : Contract Attributes NoneElements Conditionals contains one or more <Conditional> elements.
Example <Contract ID="Example"> <Workload> <TimeUnits> <Min> <Count>750</Count> <Var>Over75hrsWks1_2</Var> <Label>75 hours or more over week1 and week2</Label> </Min> <RegionStart>0</RegionStart> <RegionEnd>13</RegionEnd> </TimeUnits> <TimeUnits> <Min> <Count>750</Count> <Var>Over75hrsWks3_4</Var> <Label>75 hours or more over week3 and week4</Label> </Min> <RegionStart>14</RegionStart> <RegionEnd>27</RegionEnd> </TimeUnits> </Workload> <Patterns> <Match> <Min> <Count>1</Count> <Var>Nights</Var> <Label>Min 1 Night</Label> </Min> <Pattern><ShiftGroup>N</ShiftGroup></Pattern> </Match> <Match> <Max> <Count>0</Count> <Var>NoEDs</Var> <Label>Max zero E or D</Label> </Max> <Pattern><ShiftGroup>E</ShiftGroup></Pattern> <Pattern><ShiftGroup>D</ShiftGroup></Pattern> </Match> <Match> <Max> <Count>5</Count> <Var>Max5Nights</Var> <Label>Max 5 N</Label> </Max> <Pattern><ShiftGroup>N</ShiftGroup></Pattern> </Match> <Match> <Max> <Count>4</Count> <Var>Max4Early</Var> <Label>Max 4 E</Label> </Max> <Pattern><ShiftGroup>E</ShiftGroup></Pattern> </Match> <Match> <Min> <Count>10</Count> <Var>Min10DaysOff</Var> <Label>Min 10 days off</Label> </Min> <Pattern><Shift>-</Shift></Pattern> </Match> <Match> <Min> <Count>3</Count> <Var>3Weekends</Var> <Label>At least three weekends</Label> </Min> <Pattern> <StartDay>Saturday</StartDay> <ShiftGroup>All</ShiftGroup> <Shift>-</Shift> </Pattern> <Pattern> <StartDay>Saturday</StartDay> <Shift>-</Shift> <ShiftGroup>All</ShiftGroup> </Pattern> <Pattern> <StartDay>Saturday</StartDay> <ShiftGroup>All</ShiftGroup> <ShiftGroup>All</ShiftGroup> </Pattern> </Match> </Patterns> <Conditionals> <Conditional> <Label>If at least one night shift then no early or day shifts (nights only or early and days only)</Label> <If>Nights</If> <Then>NoEDs</Then> <Weight>10000</Weight> </Conditional> <Conditional> <Label>If 75+ hours over week one and two and 75+ hours over week three and four then no more than five night shifts</Label> <If>Over75hrsWks1_2 AND Over75hrsWks3_4</If> <Then>Max5Nights</Then> <Weight>1000</Weight> </Conditional> <Conditional> <Label>If three weekends worked then at least ten days off and max four early shifts or max five nights</Label> <If>3Weekends</If> <Then>Max5Nights OR (Min10DaysOff AND Max4Early)</Then> <Weight>100</Weight> </Conditional> </Conditionals> </Contract> A conditional constraint. See Conditionals for more information. Parents : Conditionals Attributes NoneElements Conditional contains a <Label> element (optional), followed by <If> and <Then> elements followed by a <Weight> element (optional). The <If> and <Then> elements are boolean logic expressions made up of boolean variables and the boolean operators 'AND' and 'OR'. The variables are defined in <Min> and <Max> elements of Workload and Patterns constraints. The variables will be true or false depending on whether their underlying constraint is satisfied or not. If the IF expression evaluates to true then the THEN expression must also evaluate to true otherwise the constraint is violated.
As in most programming languages, AND has higher precedence than OR (and both are
left associative). Parentheses can also be used to override the default precedence.
The AND and OR operators are also both case-insensitive (i.e. 'And', 'and', 'Or', 'or'
are all valid operators).
Example (See also Conditionals for more examples) <Conditionals> <Conditional> <If>Var1</If> <Then>Var2</Then> </Conditional> <Conditional> <If>Var1 AND Var2</If> <Then>Var3 OR Var4</Then> </Conditional> <Conditional> <If>(Var1 AND Var2) OR Var3</If> <Then>Var4</Then> </Conditional> <Conditional> <If>(Var1 AND Var2) OR (Var3 AND Var4)</If> <Then>Var5 AND (Var6 OR Var7 OR Var8) AND Var9</Then> </Conditional> </Conditionals> CellIndexes is used to specify a group of days in the planning period. Parents : Pattern, Pair, NotPair Attributes NoneElements Contains any number of <Cell>, <Date> and <DayOfWeek> elements in any order.
Example <Match> <Max><Count>2</Count><Weight>1000</Weight></Max> <Pattern> <Starts> <Cell>0</Cell> <Cell>2</Cell> <Cell>3</Cell> </Starts> <ShiftGroup>All</ShiftGroup> </Pattern> </Match> <Match> <Max><Count>4</Count><Weight>1000</Weight></Max> <Pattern> <StartExcludes> <Date>2010-08-13</Date> <DayOfWeek>Saturday</DayOfWeek> <DayOfWeek>Sunday</DayOfWeek> <Cell>27</Cell> </StartExcludes> <Shift>N</Shift><Shift>N</Shift><Shift>N</Shift> </Pattern> </Match> <Pair> <Label>If A has a shift then B should have the same shift. That is, If A has an E shift then B must have an E shift. If A has an L shift then B must have an L shift... (Only applies on days 0-4)</Label> <Weight>1000</Weight> <Cells> <Cell>0</Cell> <Cell>1</Cell> <Cell>2</Cell> <Cell>3</Cell> <Cell>4</Cell> </Cells> <Matches> <Match> <Assignment><Employee>A</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>N</Shift></Assignment> </Match> </Matches> </Pair> <Pair> <Label>If C has shift E then D should have shift E too (doesn't apply on Sundays or day 7)</Label> <Excludes> <DayOfWeek>Sunday</DayOfWeek> <Cell>7</Cell> </Excludes> <Matches> <Match> <Assignment><Employee>C</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>E</Shift></Assignment> </Match> </Matches> <Weight>1000</Weight> </Pair> The employees. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more Employee elements.
Example <Employees> <Employee ID="E1"> <ContractID>ContractA</ContractID> </Employee> <Employee ID="E2"> <ContractID>ContractB</ContractID> </Employee> <Employee ID="E3"> <ContractID>ContractB</ContractID> </Employee> </Employees> An employee in the roster. Parents : Employees Attributes
Elements Employee contains the following child elements in any order:
Example <Employee ID="ExampleEmployee"> <ContractID>C1</ContractID> <Skills> <Skill>Skill1</Skill> <Skill>Skill2</Skill> </Skills> </Employee> The skills, qualifications, experience, training, group etc this employee has/belongs to. Cover requirements may be specified by skill as well as shift type and time period. Parents : Employee Attributes NoneElements Skills contains one or more <Skill> elements.
Example <Skills> <Skill>Skill1</Skill> <Skill>Skill2</Skill> </Skills> When an employee is assigned to a shift (or works during a certain time period), the cover count for that shift (or time period) is increased by one. However, if necessary the cover count can be increased by a value other than one by defining new 'cover resource' values here and referencing the cover resource's ID in the Cover constraints. Parents : Employee Attributes NoneElements CoverResources contains one or more <CoverResource> elements.
Example <Employee ID="A"> <ContractID>A</ContractID> <CoverResources> <CoverResource ID="Facility1_00-06"> <Shift ID="1">6.0</Shift> <Shift ID="2">5.5</Shift> <Shift ID="3">6.2</Shift> </CoverResource> <CoverResource ID="Facility1_06-12"> <Shift ID="3">5.7</Shift> <Shift ID="4">6.5</Shift> </CoverResource> </CoverResources> </Employee> CoverResource contains one or more <Shift> elements to indicate how much to increase the cover count by when that shift is assigned to the employee. For each shift type that is not defined in a <CoverResource> the resource value for that shift type is assumed to be zero. Parents : CoverResources Attributes
Elements CoverResource contains one or more <Shift> elements.
Example <Employee ID="A"> <ContractID>A</ContractID> <CoverResources> <CoverResource ID="Facility1_00-06"> <Shift ID="1">6.0</Shift> <Shift ID="2">5.5</Shift> <Shift ID="3">6.2</Shift> </CoverResource> <CoverResource ID="Facility1_06-12"> <Shift ID="3">5.7</Shift> <Shift ID="4">6.5</Shift> </CoverResource> </CoverResources> </Employee> Rules is an alternative way of expressing and modelling the constraints that are modelled using <Contracts>, <EmployeePairings> and <CoverRequirements>. Due to its flexibility it can also be used to create new, custom constraints. Parents : SchedulingPeriod Attributes NoneElements Rules contains zero or more <Rule> elements.
Example See Rule for examples. Parents : Rules A rule is a boolean expression relating to assignments in the roster which must evaluate to true in the solution. The expression can contain
Variables
A variable corresponds to an assignment in the roster and is specified using
three sets of square brackets: [][][]. In the solution the variable has the value 1 if the employee is assigned the shift type on the day index, otherwise the variable has the value 0.
In the first set of square brackets it is also possible to specify more than one
employee by separating each ID using a comma ','. Additionally, skill IDs can be
used which is equivalent to including all the employees with that skill. If more than one employee ID, day index and/or shift ID is used then for every matching assignment in the solution the variable's value is increased by one. For example: For the variable [A][0-2][D], if employee A was assigned a D shift on days 0, 1 and 2 then the variable's value would be 3. For the variable [A,B][0][D], if employees A and B both had D shifts on day 0 then the variable's value would be 2. For the variable [A][0-1][D,E], if employee A had an E shift on day 0 and a D shift on day 1 then the variable's value would be 2. Example rules where variables such as these could then be used include: [A][0-27][D] < 10 (Employee A must have less than 10 D shifts between days 0-27) [A,B][0][D] <= 1 (A and B cannot both work D shift on day zero) [A][0-6][D,E,N] < 1 (A cannot work shifts D, E or N on days 0-6) A fourth set of square brackets can also be added to the variable to specify that the variable's value is the sum of resource values for the shifts rather just the number of shifts. For example if a resource has been defined in the ShiftTypes called TimeUnits then the following rule could be defined: [A][0-27][AllShiftsGroup][TimeUnits] le 144 (Less than 144 hours work for employee A) Conditional Expressions
A rule can take the form of a single boolean expression as in the examples above Functions Rules can also contain any number of inbuilt mathematical functions (e.g. abs, ceil, floor, max, min, pow, round, sign). See Rule functions. Violations and Penalties If the rule evaluates to false in a solution (i.e. it is a violation) then the penalty for the solution is increased by the value specified by the penalty attribute. The penalty attribute has the same syntax and uses the same operators as the rule expressions and it may also contain variables. The only difference is that it must be a numerical expression. That is, is must evaluate to a numerical value. If the penalty evaluates to a value less than zero then it assigned the value zero (in other words, negative penalties are not allowed). See also: Operators, precedence and associativity. Attributes
Example <Rules> <Rule penalty="1000" label="A total of more than 5 E shifts must be assigned to GroupA"> [GroupA][0-27][E] gt 5 </Rule> <Rule penalty="(([GroupB][0][N] - 3) * ([GroupB][0][N] - 3)) * 100" label="Max 3 N shifts assigned to GroupB on day zero (quadratic penalty)"> [GroupB][0][N] le 3 </Rule> <Rule penalty="((([A][0-27][E] * 8) + ([A][0-27][L] * 8) + ([A][0-27][N] * 12)) - 144) * 1000" label="Less than 144 hours work for employee A"> (([A][0-27][E] * 8) + ([A][0-27][L] * 8) + ([A][0-27][N] * 12)) le 144 </Rule> <Rule penalty="1000" label="If A has E and L shifts then they must have zero N shifts"> if [A][0-27][E] ge 1 and [A][0-27][L] ge 1 then [A][0-27][N] le 0 </Rule> <Rule penalty="10" label="If A works a shift from GroupX on day zero then B and C must not work a shift from GroupY on day one"> if [A][0][GroupX] ne 0 then [B,C][1][GroupY] eq 0 </Rule> <Rule penalty="abs(10 - [A][0-27][D]) * 1000" label="Assign exactly 10 D shifts to employee A (linear penalty function)"> [A][0-27][D] eq 10 </Rule> </Rules> This is used to model constraints such as two or more employees must work certain shifts at the same time. Or oppositely, two or more employees must not work certain shifts at the same time. Parents : SchedulingPeriod Attributes NoneElements EmployeePairings contains zero or more of the following elements in any order.
Example <EmployeePairings> <Pair> <Label>If A has a shift then B should have the same shift. That is, If A has an E shift then B must have an E shift. If A has an L shift then B must have an L shift. If A has an N shift then B must have an N shift.</Label> <Weight>1000</Weight> <Matches> <Match> <Assignment><Employee>A</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>N</Shift></Assignment> </Match> </Matches> </Pair> <Pair> <Label>If C has a shift then D should have the same shift (only applies on day zero)</Label> <Matches> <Match> <Assignment><Employee>C</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>C</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>C</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>N</Shift></Assignment> </Match> </Matches> <Cell>0</Cell> <Weight>1000</Weight> </Pair> <Pair> <Label> If E1 works a shift from group S1 then E2 must work a shift from group UPG_1_4_7_8. If E1 works a shift from group S7 then E2 must work a shift from group UPG_1_4_7. If E1 works a shift from group S8 then E2 must work a shift from group UPG_2_5_8 or work a shift from group UPG_3_6 on day+1. If E1 works a shift from group S3 then E2 must work a shift from group UPG_6 or work a shift from group S8 on day-1. If E1 works a shift from group S6 then E2 must work a shift from group UPG_3 or work a shift from group S8 on day-1. (E2 should work shifts which overlap with E1's shifts by at least two hours). </Label> <Matches> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S1</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>UPG_1_4_7_8</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S7</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>UPG_1_4_7</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S8</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>UPG_2_5_8</ShiftGroup> <ShiftGroup offset="1">UPG_3_6</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S3</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>UPG_6</ShiftGroup> <ShiftGroup offset="-1">S8</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S6</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>UPG_3</ShiftGroup> <ShiftGroup offset="-1">S8</ShiftGroup></Assignment> </Match> </Matches> <Weight>250</Weight> </Pair> <Pair> <Label> If E1 works a shift S1 then E2 must work a shift from group G2 and E3 must work a shift from group G3 or shift S1 </Label> <Matches> <Match> <Assignment><Employee>E1</Employee><Shift>S1</Shift></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>G2</ShiftGroup></Assignment> <Assignment><Employee>E3</Employee><ShiftGroup>G3</ShiftGroup><Shift>S1</Shift></Assignment> </Match> </Matches> <Weight>250</Weight> </Pair> <NotPair> <Label>If X has a shift then Y should NOT have the same shift That is, If X has an E shift then B must NOT have an E shift. If X has an L shift then B must NOT have an L shift. If X has an N shift then B must NOT have an N shift.</Label> <Matches> <Match> <Assignment><Employee>X</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>X</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>X</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>N</Shift></Assignment> </Match> </Matches> <Weight>1000</Weight> </NotPair> <NotPair> <Label> A violation occurs if : E1 has a shift from group S1 AND (E2 has shift from group S2 or has a shift from S2b on day-1) AND E3 has a shift from S3 AND E4 has a shift from S4. Or a violation occurs if : If E1 has a shift from shift group S5 and E2 has a shift from group S6 on the same day. </Label> <Matches> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S1</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>S2</ShiftGroup> <ShiftGroup offset="-1">S2b</ShiftGroup></Assignment> <Assignment><Employee>E3</Employee><ShiftGroup>S3</ShiftGroup></Assignment> <Assignment><Employee>E4</Employee><ShiftGroup>S4</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S5</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>S6</ShiftGroup></Assignment> </Match> </Matches> <Weight>250</Weight> </NotPair> </EmployeePairings> If the employee in the first <Assignment> in each <Match> works a specified shift then
the other employee(s) in the <Match> must work their specified shift(s) on the
same day or optionally on an offset day (i.e. day -2, -1, +1 etc).
Parents : EmployeePairings Attributes NoneElements Pair contains <Label>, <Cell>, <Cells>, <Excludes>, <Matches> and <Weight> elements in any order. All are optional except <Matches>. If none of <Cell>, <Cells> or <Excludes> are used then the constraint applies to all days in the scheduling period.
Example (See also EmployeePairings for more examples) <EmployeePairings> <Pair> <Label>If A has a shift then B should have the same shift. That is, If A has an E shift then B must have an E shift. If A has an L shift then B must have an L shift. If A has an N shift then B must have an N shift.</Label> <Weight>1000</Weight> <Matches> <Match> <Assignment><Employee>A</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>A</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>B</Employee><Shift>N</Shift></Assignment> </Match> </Matches> </Pair> </EmployeePairings> If the employee in the first <Assignment> in each <Match> works a specified shift then
the other employee(s) in the <Match> must NOT work their specified shift(s)
on the same day or optionally on an offset day (i.e. day -2, -1, +1 etc).
Parents : EmployeePairings Attributes NoneElements NotPair contains <Label>, <Cell>, <Cells>, <Excludes>, <Matches> and <Weight> elements in any order. All are optional except <Matches>. If none of <Cell>, <Cells> or <Excludes> are used then the constraint applies to all days in the scheduling period.
Example (See also EmployeePairings for more examples) <EmployeePairings> <NotPair> <Label>If X has a shift then Y should NOT have the same shift That is, If X has an E shift then B must NOT have an E shift. If X has an L shift then B must NOT have an L shift. If X has an N shift then B must NOT have an N shift.</Label> <Matches> <Match> <Assignment><Employee>X</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>X</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>X</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>Y</Employee><Shift>N</Shift></Assignment> </Match> </Matches> <Weight>1000</Weight> </NotPair> </EmployeePairings> Matches contains employee-to-shift assignments which must or must not be made for two or more employees on the same day (or offset days). Attributes NoneElements Matches contains one or more <Match> elements.
Example <EmployeePairings> <NotPair> <Label> A violation occurs if : E1 has a shift from group S1 AND (E2 has shift from group S2 or has a shift from S2b on day-1) AND E3 has a shift from S3 Or a violation occurs if : If E1 has a shift from shift group S5 and E2 has shift S6 on the same day or shift S7 on the next day. </Label> <Matches> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S1</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>S2</ShiftGroup> <ShiftGroup offset="-1">S2b</ShiftGroup></Assignment> <Assignment><Employee>E3</Employee><ShiftGroup>S3</ShiftGroup></Assignment> </Match> <Match> <Assignment><Employee>E1</Employee><ShiftGroup>S5</ShiftGroup></Assignment> <Assignment><Employee>E2</Employee><Shift>S6</Shift> <Shift offset="1">S7</Shift></Assignment> </Match> </Matches> <Weight>250</Weight> </NotPair> </EmployeePairings> A set of employee-to-shift assignments to be matched
in an EmployeePairing constraint.
Parents : Matches Attributes NoneElements Match contains at least one <Assignment> element.
Example <EmployeePairings> <Pair> <Label>If C has a shift then D should have the same shift (only applies on day zero)</Label> <Matches> <Match> <Assignment><Employee>C</Employee><Shift>E</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>E</Shift></Assignment> </Match> <Match> <Assignment><Employee>C</Employee><Shift>L</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>L</Shift></Assignment> </Match> <Match> <Assignment><Employee>C</Employee><Shift>N</Shift></Assignment> <Assignment><Employee>D</Employee><Shift>N</Shift></Assignment> </Match> </Matches> <Cell>0</Cell> <Weight>1000</Weight> </Pair> </EmployeePairings> An employee-to-shift or employee-to-shift group assignment. The assignment is matched if the employee works one of the shifts in the <Shift> or <ShiftGroup> tags. If the <Shift> or <ShiftGroup> contains an offset attribute then the assignment is matched if the employee works the specified shift on the day offset relative to the other assignments. For example, if the offset is -1 then this assignment must be on the day before the other assignments. If the offset is +2 then the assignment must be two days after the other assignments etc. Parents : Match Attributes NoneElements Assignment contains an <Employee> element followed by one or more <Shift> and/or <ShiftGroup> elements.
Example <EmployeePairings> <Pair> <Label> If E1 works a shift S1 then E2 must work a shift from group G2 and E3 must work a shift from group G3 or shift S1 </Label> <Matches> <Match> <Assignment><Employee>E1</Employee><Shift>S1</Shift></Assignment> <Assignment><Employee>E2</Employee><ShiftGroup>G2</ShiftGroup></Assignment> <Assignment><Employee>E3</Employee><ShiftGroup>G3</ShiftGroup> <Shift>S1</Shift></Assignment> </Match> </Matches> <Weight>250</Weight> </Pair> </EmployeePairings> The minimum and maximum numbers of employees covering shifts/time periods during the scheduling period. Parents : SchedulingPeriod Attributes NoneElements CoverRequirements contains zero or more of the following elements in any order.
The minimum and maximum numbers of employees covering shifts/time periods on a specific week day. Parents : CoverRequirements Attributes NoneElements DayOfWeekCover contains one <Day> element followed by one or more Cover> elements.
Example
<DayOfWeekCover>
<Day>Friday</Day>
<Cover>
<ShiftGroup>N</ShiftGroup>
<Min>4</Min>
</Cover>
<Cover>
<Skill>Skilled</Skill>
<ShiftGroup>N</ShiftGroup>
<Min weight="100">1</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Na</Shift>
<Min>1</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Nb</Shift>
<Min>1</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Nc</Shift>
<Min>1</Min>
</Cover>
<Cover>
<ShiftGroup>D</ShiftGroup>
<Min>10</Min>
<Max>11</Max>
</Cover>
<Cover>
<Skill>Skilled</Skill>
<ShiftGroup>D</ShiftGroup>
<Min weight="100">1</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Da</Shift>
<Min>2</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Db</Shift>
<Min>2</Min>
</Cover>
<Cover>
<SkillGroup>SkilledOrSecondYear</SkillGroup>
<Shift>Dc</Shift>
<Min>2</Min>
</Cover>
<Cover>
<Shift>Da</Shift>
<Min>3</Min>
<Max weight="10">4</Max>
</Cover>
<Cover>
<Shift>Db</Shift>
<Min>3</Min>
<Max weight="10">4</Max>
</Cover>
<Cover>
<Shift>Dc</Shift>
<Min>3</Min>
<Max weight="10">4</Max>
</Cover>
</DayOfWeekCover>
The minimum and maximum numbers of employees covering shifts/time periods on a specific date in the scheduling horizon. Parents : CoverRequirements Attributes NoneElements DateSpecificCover contains <Date>, <Day> or <Cell> element followed by one or more <Cover> elements.
Example
<DateSpecificCover>
<Date>1996-11-26</Date>
<Cover>
<ShiftGroup>D</ShiftGroup>
<Min weight="1000">12</Min>
<Max weight="1000">16</Max>
</Cover>
<Cover>
<Shift>Da</Shift>
<Min>4</Min>
<Max>6</Max>
</Cover>
<Cover>
<Shift>Db</Shift>
<Min>4</Min>
<Max>6</Max>
</Cover>
<Cover>
<Shift>Dc</Shift>
<Min>4</Min>
<Max>6</Max>
</Cover>
</DateSpecificCover>
The min and/or max numbers of employees
(optionally with certain skills) covering shifts or time periods. Parents : DayOfWeekCover , DateSpecificCover Attributes NoneElements Cover contains a <Skill> or <SkillGroup> element (both optional) followed by a <TimePeriod>, <Shift> or <ShiftGroup> element followed by <Min> and/or <Max> (both optional) followed by a <Label> element (optional) and a <CoverResource> element (optional).
Example
<DayOfWeekCover>
<Day>Saturday</Day>
<Cover>
<Shift>E</Shift>
<Min>2</Min>
<Max>5</Max>
</Cover>
<Cover>
<Skill>EyeTrained</Skill>
<Shift>E</Shift>
<Min weight="100">1</Min>
</Cover>
<Cover>
<Shift>L</Shift>
<Min>1</Min>
<Max>4</Max>
</Cover>
<Cover>
<Skill>EyeTrained</Skill>
<Shift>L</Shift>
<Min weight="100">1</Min>
</Cover>
<Cover>
<Shift>N</Shift>
<Min>1</Min>
<Max>3</Max>
</Cover>
<Cover>
<Skill>EyeTrained</Skill>
<Shift>N</Shift>
<Min weight="100">1</Min>
</Cover>
</DayOfWeekCover>
TimePeriods contains zero or more <TimePeriod> elements. Parents : Shift Attributes NoneElements TimePeriods contains zero or more <TimePeriod> elements.
Example <Shift ID="D1"> <Label>D1</Label> <TimePeriods> <TimePeriod><Start>08:30:00</Start><End>13:30:00</End></TimePeriod> <TimePeriod><Start>17:30:00</Start><End>22:30:00</End></TimePeriod> </TimePeriods> </Shift> A time period in the day. Parents : TimePeriods Attributes NoneElements TimePeriod contains two child elements in any order:
Example <TimePeriod> <Start>15:30:00</Start> <End>19:30:00</End> </TimePeriod> A time period in the day. Parents : Cover Attributes
Elements TimePeriod contains two child elements in any order:
Example <TimePeriod> <Start>15:30:00</Start> <End>19:30:00</End> </TimePeriod> Requests for days off during the planning period (that is, days without a shift) for each employee. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more DayOff elements.
Example <DayOffRequests> <DayOff weight="1000"> <EmployeeID>A</EmployeeID> <Date>2007-01-03</Date> </DayOff> <DayOff weight="1000"> <EmployeeID>A</EmployeeID> <Date>2007-01-04</Date> </DayOff> <DayOff weight="10"> <EmployeeID>B</EmployeeID> <Date>2007-01-20</Date> </DayOff> </DayOffRequests> A request for a day off. Parents : DayOffRequests Attributes
Elements DayOff contains an <EmployeeID> element followed by a <Date> or <Day> or <Cell> element.
Example <DayOffRequests> <DayOff weight="1"> <EmployeeID>A</EmployeeID> <Date>2007-02-05</Date> </DayOff> <DayOff weight="1"> <EmployeeID>A</EmployeeID> <Date>2007-02-06</Date> </DayOff> </DayOffRequests> Employee requests for days they want to be working on. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more DayOn elements.
Example <DayOnRequests> <DayOn weight="1000"> <EmployeeID>X</EmployeeID> <Date>2007-01-03</Date> </DayOn> <DayOn weight="1000"> <EmployeeID>X</EmployeeID> <Date>2007-01-04</Date> </DayOn> <DayOn weight="10"> <EmployeeID>Y</EmployeeID> <Date>2007-01-20</Date> </DayOn> </DayOnRequests> A request for a day to be working on. Parents : DayOnRequests Attributes
Elements DayOn contains an <EmployeeID> element followed by a <Date> or <Day> or <Cell> element.
Example <DayOnRequests> <DayOn weight="1000"> <EmployeeID>X</EmployeeID> <Date>2007-01-03</Date> </DayOn> <DayOn weight="1000"> <EmployeeID>X</EmployeeID> <Date>2007-01-04</Date> </DayOn> <DayOn weight="10"> <EmployeeID>Y</EmployeeID> <Date>2007-01-20</Date> </DayOn> </DayOnRequests> Requests for no shifts of a certain type on certain days in the planning period for each employee. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more ShiftOff elements.
Example <ShiftOffRequests> <ShiftOff weight="5"> <Shift>Early</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-05</Date> </ShiftOff> <ShiftOff weight="5"> <Shift>Early</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-06</Date> </ShiftOff> <ShiftOff weight="5"> <Shift>Night</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-05</Date> </ShiftOff> <ShiftOff weight="5"> <Shift>Night</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-06</Date> </ShiftOff> </ShiftOffRequests> A request for a shift off. Parents : ShiftOffRequests Attributes
Elements ShiftOff contains a <Shift> element followed by an <EmployeeID> element followed by a <Date> or <Day> or <Cell> element.
Example <ShiftOffRequests> <ShiftOff weight="5"> <Shift>Early</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-05</Date> </ShiftOff> <ShiftOff weight="5"> <Shift>Early</Shift> <EmployeeID>ExampleEmployee</EmployeeID> <Date>2007-02-06</Date> </ShiftOff> </ShiftOffRequests> Requests for shifts of a certain type on certain days in the planning period for each employee. Parents : SchedulingPeriod Attributes NoneElements Contains zero or more ShiftOn elements.
Example <ShiftOnRequests> <ShiftOn weight="1"> <ShiftGroupID>Early</ShiftGroupID> <EmployeeID>E1</EmployeeID> <Date>2007-02-05</Date> </ShiftOn> <ShiftOn weight="1"> <ShiftGroupID>Late</ShiftGroupID> <EmployeeID>E2</EmployeeID> <Date>2007-02-06</Date> </ShiftOn> <ShiftOn weight="1"> <Shift>L</Shift> <EmployeeID>E3</EmployeeID> <Date>2007-02-07</Date> </ShiftOn> </ShiftOnRequests> A request for shift(s) on a specific day in the scheduling period. Parents : ShiftOnRequests Attributes
Elements ShiftOn contains either a <Shift> element or a <ShiftGroupID> element or a <ShiftGroup> element followed by an <EmployeeID> element and a <Date> or a <Day> or a <Cell> element.
Example <ShiftOnRequests> <ShiftOn weight="1"> <ShiftGroupID>Early</ShiftGroupID> <EmployeeID>E1</EmployeeID> <Date>2007-02-05</Date> </ShiftOn> <ShiftOn weight="1"> <ShiftGroupID>Late</ShiftGroupID> <EmployeeID>E2</EmployeeID> <Date>2007-02-06</Date> </ShiftOn> <ShiftOn weight="1"> <Shift>L</Shift> <EmployeeID>E3</EmployeeID> <Date>2007-02-07</Date> </ShiftOn> </ShiftOnRequests> A group of shift types. Parents : ShiftOn Attributes NoneElements ShiftGroup contains one or more <Shift> elements.
Example
<ShiftGroup>
<Shift>E</Shift>
<Shift>N</Shift>
</ShiftGroup>
These are shift assignments (or day off assignments) which must be in the solution. Parents : SchedulingPeriod Attributes NoneElements FixedAssignments contains zero or more <Employee> elements.
Example <FixedAssignments> <Employee> <EmployeeID>A01</EmployeeID> <Assign> <Shift>O</Shift> <Date>2009-05-04</Date> </Assign> <Assign> <Shift>O</Shift> <Date>2009-05-05</Date> </Assign> </Employee> <Employee> <EmployeeID>A07</EmployeeID> <Assign> <Shift>O</Shift> <Date>2009-05-04</Date> </Assign> </Employee> </FixedAssignments> These are shift assignments (or days off) which must be in an employee's schedule in the solution. Parents : FixedAssignments Attributes NoneElements Employee contains an <EmployeeID> element followed by zero or more <Assign> elements.
Example <FixedAssignments> <Employee> <EmployeeID>2</EmployeeID> <Assign> <Shift>V</Shift> <Date>2003-01-06</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-07</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-08</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-09</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-10</Date> </Assign> </Employee> </FixedAssignments> A shift assignment (or day off). Parents : Employee Attributes NoneElements Assign contains a <Shift> element followed by a <Date> or a <Day> or a <Cell> element.
Example <FixedAssignments> <Employee> <EmployeeID>2</EmployeeID> <Assign> <Shift>V</Shift> <Date>2003-01-06</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-07</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-08</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-09</Date> </Assign> <Assign> <Shift>V</Shift> <Date>2003-01-10</Date> </Assign> </Employee> </FixedAssignments> Boolean is one of the values {true, false, 1, 0}. Date must be in the format : YYYY-MM-DD. ID is a string which can contain only the characters A to Z (upper and lower case), 0 to 9, period (.) and underscore (_). NonNegativeDouble is a number greater than or equal to zero which may also be fractional. That is, it can have a decimal component. For example 0, 1, 1.333, 1.5, 10.25, 1000 are all valid values. NonNegativeInteger is a whole number greater than or equal to zero (e.g. 0,1,2,..). Integer is a positive or negative whole number (e.g. ..,-2,-1,0,1,2,..). The + sign is optional for positive numbers. E.g. 1 and +1 are both valid values. Time must be in the format : hh:mm:ss.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 2012 Staff Roster Solutions