<?xml version="1.0" encoding="UTF-8"?> 
<ScheduleSolver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				xsi:noNamespaceSchemaLocation="ScheduleSolver-1.0.xsd"> 
        
    <!--
    This is a template XML file for ScheduleSolver. This file can also be opened 
    with RosterViewer.
    
    Note that the top level elements (StartDate, EndDate, Shifts, Employees 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. Below we define a seven day planning horizon from 7th
    October to 13th October.
    -->
    <StartDate>2018-10-07</StartDate>
	<EndDate>2018-10-13</EndDate>
        
    <!--=====================================================================-->
    <!--                             Tasks                                   -->
    <!--=====================================================================-->
    <!--
    The shifts to be assigned.
    -->
    <Shifts>
		<Shift ID="L1">
			<Start>2018-10-07T12:00:00</Start>
			<End>2018-10-07T20:00:00</End>
			<Weight>1000000</Weight>
		</Shift>
		<Shift ID="N1">
			<Start>2018-10-07T08:00:00</Start>
			<End>2018-10-08T06:00:00</End>
			<Weight>1000000</Weight>
		</Shift>
		<Shift ID="E1">
			<Start>2018-10-07T06:00:00</Start>
			<End>2018-10-07T14:00:00</End>
			<Weight>1000000</Weight>
		</Shift>
	</Shifts>
    
    <!--=====================================================================-->
    <!--                           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="0">
			<ContractID>C1</ContractID>
			<ContractID>C2</ContractID>
		</Employee>
		<Employee ID="1">
			<ContractID>C2</ContractID>
		</Employee>
		<Employee ID="2">
			<ContractID>C2</ContractID>
		</Employee>
		<Employee ID="3">
			<ContractID>C2</ContractID>
		</Employee>
		<Employee ID="4">
			<ContractID>C2</ContractID>
		</Employee>
	</Employees>
    
    <!--=====================================================================-->
    <!--                         ShiftTypes (optional)                       -->
    <!--=====================================================================-->
    <!--
    Shifts can be categorized into general types based on their start and finish
    times. The ShiftTypes can then be used in constraint such "as assign at most 
    three night shifts for each employee".
    -->
    <ShiftTypes>

    </ShiftTypes>

    <!--=====================================================================-->
    <!--                        ShiftGroups (optional)                       -->
    <!--=====================================================================-->
    <!-- 
    Shift Types can be placed in groups for some constraints. The groups are 
    defined here.
    -->
    <ShiftGroups>

    </ShiftGroups>
    
    <!--=====================================================================-->
    <!--                           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="C1">
			<ShiftLengths>
				<Min>
					<Length>360</Length>
					<Label>Min 6h shifts</Label>
					<Weight function="Linear">1</Weight>
				</Min>
				<Max>
					<Length>750</Length>
					<Label>Max 12.5h shifts</Label>
				</Max>
			</ShiftLengths>
		</Contract>
		
		<Contract ID="C2">
			<MultipleShiftsPerDay/>
			<MinRestTime>660</MinRestTime>
			<MinRestInPeriod start="2018-10-07T00:00:00" 
						     end="2018-10-14T00:00:00" 
						     label="An unbroken rest period of 45 hours every week">2700</MinRestInPeriod>
			<DailyRest dayStart="03:00" 
			           label="Min 11 hours continuous rest in 24hrs">660</DailyRest>
			<ShiftLengths>
				<Min>
					<Length>510</Length>
					<Label>Min 8.5h shifts</Label>
					<Weight function="Linear">1</Weight>
				</Min>
				<Max>
					<Length>750</Length>
					<Label>Max 12.5h shifts</Label>
				</Max>
			</ShiftLengths>
			<Workload>
				<TimeUnits>
					<PeriodStart>2018-10-07</PeriodStart>
					<PeriodEnd>2018-10-13</PeriodEnd>
					<Max>
						<Count>2550</Count>
						<Label>Max 42.5 hrs</Label>
					</Max>
				</TimeUnits>
			</Workload>
		</Contract>
		
	</Contracts>

    <!--=====================================================================-->
    <!--                    FixedAssignments (optional)                      -->
    <!--=====================================================================-->
    <!--
    FixedAssignments can be used to pre-assign shifts to employees. Any 
    assignments made here must be in a solution. 
    -->
    <FixedAssignments>
		<Employee ID="0">
			<NoShift>
				<Start>2018-10-07T08:00</Start>
				<End>2018-10-08T12:30</End>
			</NoShift>
			<NoShift>
				<Start>2018-10-09T14:00</Start>
				<End>2018-10-13T19:00</End>
			</NoShift>
		</Employee>
		<Employee ID="1">
			<NoShift>
				<Start>2018-10-07T08:00</Start>
				<End>2018-10-13T19:00</End>
			</NoShift>
			<Shift ID="N1"/>
			<NotShift ID="E1"/>
		</Employee>
	</FixedAssignments>

    <!--=====================================================================-->
    <!--                          Requests (optional)                        -->
    <!--=====================================================================-->
    <!--
    Dates employees prefer not to work.
    Dates employees prefer to work.
    Dates employees prefer not to work particular shifts.
    Dates employees prefer to work particular shifts.
    -->
    <Requests>

    </Requests>

</ScheduleSolver>
