public ACOHandler(SchedulingPeriod inputData) { InputData = inputData; StartDate = DateTime.Parse(InputData.StartDate); EndDate = DateTime.Parse(InputData.EndDate); NurseNumber = inputData.Employees.Employee.Count; GenerationManager = new GenerationManager(InputData); Evaluator = new Evalutador(InputData); WParam = new double[inputData.Skills.Skill.Count]; for (int i = 0; i < inputData.Skills.Skill.Count; i++) { GradeIndex.Add(inputData.Skills.Skill.ElementAt(i), i); WParam[i] = i + 1; } var orderedShifts = inputData.ShiftTypes.Shift.ToList(); orderedShifts.ForEach(x => ShiftPatternIndex.Add(x.ID, orderedShifts.IndexOf(x))); for (int i = 0; i < EndDate.Subtract(StartDate).Days + 1; i++) { DayIndex[StartDate.AddDays(i).DayOfWeek.ToString()].Add(i); } InitiazeCoverRequirements(); }
public static SchedulingPeriod GetObjectDataFromText(string stringData) { XmlSerializer serializer = new XmlSerializer(typeof(SchedulingPeriod)); SchedulingPeriod result = null; using (TextReader reader = new StringReader(stringData)) { result = (SchedulingPeriod)serializer.Deserialize(reader); } return(result); }