<?xml version="1.0" encoding="UTF-8"?>
<SchedulingPeriod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xsi:noNamespaceSchemaLocation="SchedulingPeriod-3.0.xsd">
    <!--
    This is a template XML file for AutoRoster. This file can also be opened 
    with RosterViewer.
    
    Note that the top level elements (StartDate, EndDate, ShiftTypes, Contracts 
    etc) can be in any order and do not have to follow the order they are 
    defined here.
    -->                  
                  
    <!--=====================================================================-->
    <!--                       Planning Horizon                              -->
    <!--=====================================================================-->
    <!--
    The planning horizon is defined by a start date and an end date. The end 
    date is inclusive so below we are creating a four week planning horizon from
    4th June to 1st July.
    -->
    <StartDate>2012-06-04</StartDate>
    <EndDate>2012-07-01</EndDate>

    
    <!--=====================================================================-->
    <!--                          ShiftTypes                                 -->
    <!--=====================================================================-->
    <!--
    Here we define the shift types to be assigned. The only required information
    for each shift type is a unique ID. All the other elements (StartTime, 
    EndTime, AutoAllocate etc) within the <Shift> tag are optional.
    -->
    <ShiftTypes>
        <Shift ID="E">
            <Name>Early shift</Name>
            <Color>orange</Color>
            <TimeUnits>8</TimeUnits>
            <StartTime>07:00</StartTime>
            <EndTime>15:00</EndTime>
        </Shift>
        <Shift ID="L">
            <Name>Late shift</Name>
            <Color>skyblue</Color>
            <TimeUnits>8</TimeUnits>
            <StartTime>15:00</StartTime>
            <EndTime>23:00</EndTime>
        </Shift>
    </ShiftTypes>

    
    <!--=====================================================================-->
    <!--                        ShiftGroups (optional)                       -->
    <!--=====================================================================-->
    <!-- 
    Shifts can be placed in groups for some constraints. The groups are defined
    here. Below we define a group which contains all the shift types.
    -->
    <ShiftGroups>
        <ShiftGroup ID="ALL">
            <Shift>E</Shift>
            <Shift>L</Shift>
        </ShiftGroup>
    </ShiftGroups>

    
    <!--=====================================================================-->
    <!--                           Employees                                 -->
    <!--=====================================================================-->
    <!-- 
    Here we define the employees to be scheduled in the planning horizon. The
    only required information for each employee is a unique ID.
    -->
    <Employees>
        <Employee ID="A">
            <!-- 
            Since version 3.26 an employee can be assigned more than one 
            contract. If more than one contract is assigned to an employee then 
            all the constraints in each contract apply to the employee. 
            -->
            <ContractID>FullTime</ContractID>
        </Employee>
        <Employee ID="B">
            <ContractID>FullTime</ContractID>
            <!-- Skills can optionally be defined for each employee: -->
            <Skills>
                <Skill>Skill1</Skill>
                <Skill>Skill2</Skill>
            </Skills>
        </Employee>
    </Employees>

    
    <!--=====================================================================-->
    <!--                           Contracts                                 -->
    <!--=====================================================================-->
    <!--
    Contracts contain the constraints on each employee's work schedule. For
    example how many hours they should work, which shift types they can be
    assigned etc. 
    -->
    <Contracts>
    
        <Contract ID="FullTime">

            <Workload>
                <!-- 
                An example workload constraint which limits the employee to a 
                maximum of 168 hours work within this planning period
                -->
                <TimeUnits>
                    <Max>
                        <Count>168</Count>
                        <Weight function="quadratic">100</Weight>
                        <Label>Max 168 hours</Label>
                    </Max>
                </TimeUnits>
                
            </Workload>
            
            <!-- 
            A pattern match constraint shortcut which prevents the sequence 
            off-on-off.
            -->
            <MinSeq label="Min two consecutive working days" value="2" 
                    shift="ALL" weight="1000"/>
            
            <!-- 
            A pattern match constraint shortcut which prevents the sequence 
            on-off-on.
            -->
            <MinSeq label="Min two consecutive days off" value="2" shift="-" 
                    weight="1000"/>
            
            <!-- 
            A pattern match constraint shortcut which limits the employee to 
            five consecutive working days.
            -->
            <MaxSeq label="Max five consecutive working days" value="5" 
                    shift="ALL" weight="1000"/>
            
            <!--
            MinRestTime constraint. (This is a shortcut which internally 
            generates Pattern constraints which prevent patterns that would 
            violate this minimum rest time). 
            -->
            <MinRestTime label="At least ten hours rest after a shift" 
                         weight="10000">600</MinRestTime>
            
        </Contract>
        
    </Contracts>

    <!--=====================================================================-->
    <!--                        SkillGroups (optional)                       -->
    <!--=====================================================================-->
    <!-- 
    Employee skills can be placed in groups for some cover constraints. The 
    groups are defined here.
    -->
    <SkillGroups>
    
    </SkillGroups>
    
    <!--=====================================================================-->
    <!--                    CoverRequirements (optional)                     -->
    <!--=====================================================================-->
    <!--
    Here we define the number of shifts required on each day/date in the 
    planning period. Skills/SkillGroups and TimePeriods can also be used in the 
    cover constraints.
    -->
    <CoverRequirements>
        <DayOfWeekCover>
            <Day>Monday</Day>
            <Cover>
                <Shift>E</Shift>
                <Min weight="1000">1</Min>
                <Max weight="1000">1</Max>
            </Cover>
            <Cover>
                <Shift>L</Shift>
                <Min weight="1000">1</Min>
                <Max weight="1000">1</Max>
            </Cover>
        </DayOfWeekCover>
    </CoverRequirements>


    <!--=====================================================================-->
    <!--                    FixedAssignments (optional)                      -->
    <!--=====================================================================-->
    <!--
    FixedAssignments can be used to pre-assign shifts to employees. Any 
    assignments made here will not be changed by the solver. 
    -->
    <FixedAssignments>
        
        <Employee>
            <EmployeeID>A</EmployeeID>
            <Assign>
                <Shift>E</Shift>
                <Date>2012-06-14</Date>
            </Assign>
            <Assign>
                <Shift>E</Shift>
                <Date>2012-06-15</Date>
            </Assign>
        </Employee>

        <Employee>
            <EmployeeID>B</EmployeeID>
            <!-- Here we fix in place some days off for Employee B -->
            <Assign>
                <Shift>-</Shift> 
                <Date>2012-06-20</Date>
            </Assign>
            <Assign>
                <Shift>-</Shift>
                <Date>2012-06-21</Date>
            </Assign>
            <Assign>
                <Shift>-</Shift>
                <Date>2012-06-22</Date>
            </Assign>
        </Employee>

    </FixedAssignments>

    
    <!--=====================================================================-->
    <!--                          Rules (optional)                           -->
    <!--=====================================================================-->  
    <!-- 
    Rules can be used for more complex constraints that cannot be defined using
    CoverRequirements or Contracts.
    -->
    <Rules>
      
    </Rules>
    
    
    <!--=====================================================================-->
    <!--                     EmployeePairings (optional)                     -->
    <!--=====================================================================-->  
    <!-- 
    EmployeePairings can be used to ensure two or more employee work together 
    (or not).
    -->
    <EmployeePairings>
    
    </EmployeePairings>
    
    
    <!--=====================================================================-->
    <!--                       DayOffRequests (optional)                     -->
    <!--=====================================================================-->
    <!--
    Dates employees prefer not to work.
    -->
    <DayOffRequests>

    </DayOffRequests>

    
    <!--=====================================================================-->
    <!--                       DayOnRequests (optional)                      -->
    <!--=====================================================================-->
    <!--
    Dates employees prefer to work.
    -->
    <DayOnRequests>
    
    </DayOnRequests>

    
    <!--=====================================================================-->
    <!--                       ShiftOffRequests (optional)                   -->
    <!--=====================================================================-->
    <!--
    Dates employees prefer not to work particular shifts.
    -->
    <ShiftOffRequests>
    
    </ShiftOffRequests>

    
    <!--=====================================================================-->
    <!--                       ShiftOnRequests (optional)                    -->
    <!--=====================================================================-->
    <!--
    Dates employees prefer to work particular shifts.
    -->
    <ShiftOnRequests>
    
    </ShiftOnRequests>
    
    
</SchedulingPeriod>
