//1 //Layers.ReductionSteps.ReductionStep1.TryReduce(DirectoryManager.EssentialInforamtion1Directory + DirectoryManager.CreditDeterminerSavedName, DirectoryManager.EssentialInforamtion1Directory + DirectoryManager.CourseInformationSavedName, termNumberNow,out lst) /// <summary> /// /// </summary> /// <param name="curriculum">باید خصوصیات آن با توجه به credit و CourseInfo ذخیره شده ست شده باشد </param> /// <param name="currentTermNumber"></param> /// <returns></returns> public static List <Course> Reduce(MainCurriculum curriculum, int currentTermNumber, int cntPassedUnits) { List <SatelliteInformation> satList = curriculum.CreateNewSatelliteInformationList(); PopulateSatelliteInformation(curriculum, satList); return(ReduceStep1Helper(curriculum, satList, cntPassedUnits, currentTermNumber)); }
/// <summary> /// /// </summary> /// <param name="curriculum">updated curriculm provided by StudentHistoryServiceProvider.CreateNewCurriculmWithSpecificCreditAndFilledBySpecificCourseInforamtion() must be passed</param> /// <param name="takenCoursesId">id's of courses which you want to take and after it you want to know :=> curriculum is in valid state or not ? </param> /// <returns></returns> public static bool IsValidState(MainCurriculum curriculum, List <int> takenCoursesId) { bool[] takenCoursesArray = new bool[curriculum.Courses.Count]; takenCoursesId.ForEach(t => takenCoursesArray[t] = true); //------------------------------------------------------------------ bool o = PrerequisitesAndRequisitesRegarded(curriculum, takenCoursesArray, takenCoursesId); if (o == false) { return(false); } //------------------------------------------------------------------ var satList = curriculum.CreateNewSatelliteInformationList(); PopulateSatelliteInformationHelper(curriculum.Root, satList, curriculum, takenCoursesArray); return(IsValidState(curriculum, satList)); }