private DtoToSchedulingBenchmarkModelMapper(SchedulingPeriod schedulingPeriod) { _schedulingPeriod = schedulingPeriod ?? throw new ArgumentNullException(nameof(schedulingPeriod)); _dayOffs = MapDayOffs(); _shiftOffRequests = MapShiftOffRequests(); _shiftOnRequests = MapShiftOnRequests(); _contracts = MapContracts(); }
public SchedulingIpContext MapToSolver(SchedulingPeriod schedulingPeriod) { Map(schedulingPeriod); CreateConstraints(); MapObjective(); return(scheduleContext); }
//Constructor public ScheduleEvaluator(SchedulingPeriod inputData) { sp = inputData; nrShiftTypes = sp.ShiftTypes.Shift.Count; DateTime startDate = Convert.ToDateTime(sp.StartDate); DateTime endDate = Convert.ToDateTime(sp.EndDate); nrOfDaysInPeriod = endDate.Day - startDate.Day + 1; numTimeUnits = nrOfDaysInPeriod * nrShiftTypes; }
private void Map(SchedulingPeriod schedulingPeriod) { MapShiftTypes(schedulingPeriod.ShiftTypes); MapPersons(schedulingPeriod.Employees); MapContracts(schedulingPeriod.Contracts); MapShifts(schedulingPeriod.CoverRequirements); MapShiftOnRequests(schedulingPeriod.ShiftOnRequests); MapShiftOffRequests(schedulingPeriod.ShiftOffRequests); MapFixedAssignments(schedulingPeriod.FixedAssignments); MapExtraInfomraiton(); }
public Evalutador(SchedulingPeriod inputData) { //Data Initialization inputDataLocal = inputData; //var orderedShifts = inputDataLocal.ShiftTypes.Shift.OrderBy(x => DateTime.Parse(x.StartTime)).ThenBy(x => DateTime.Parse(x.EndTime)).ToList(); var orderedShifts = inputDataLocal.ShiftTypes.Shift.ToList(); orderedShifts.ForEach(shift => shiftTypesDict.Add(shift.ID, orderedShifts.IndexOf(shift))); numUnits = inputDataLocal.ShiftTypes.Shift.Count; DateTime startDate = Convert.ToDateTime(inputDataLocal.StartDate); DateTime endDate = Convert.ToDateTime(inputDataLocal.EndDate); numDays = endDate.Day - startDate.Day + 1; conditions = new List <Condition>(); firstSaturday = GetFirstSaturday(startDate, endDate); numWeekends = GetNumWeekends(firstSaturday, startDate, endDate); }
public static SchedulingBenchmarkModel MapToSchedulingBenchmarkModel(SchedulingPeriod schedulingPeriod) => new DtoToSchedulingBenchmarkModelMapper(schedulingPeriod).MapToSchedulingBenchmarkModel();
public void GlobalSetup() { _dto = SchedulingBenchmarkInstanceReader.FromXml(Instance); }
/// <summary> /// Evalutador overloaded constractor /// </summary> /// <param name="inputData"></param> /// <param name="nurseId"></param> public Evalutador(SchedulingPeriod inputData, int nurseId) : this(inputData) { scheduleEvaluator = new ScheduleEvaluator(inputDataLocal); conditions.Clear(); BuildConditionsList(nurseId); }