Beispiel #1
0
 public FullSchedule(FullSchedule schedule)
 {
     this.TempClass = new StudentsClassPosition(schedule.TempClass.Time, schedule.TempClass.ClassRoom);
     this.eStorage = schedule.eStorage;
     this.classesTable = new StudentsClass[schedule.classesTable.GetLength(0), schedule.classesTable.GetLength(1)];
     for (int timeIndex = 0; timeIndex < this.classesTable.GetLength(0); timeIndex++)
     {
         for (int classIndex = 0; classIndex < this.classesTable.GetLength(1); classIndex++)
         {
             this.classesTable[timeIndex, classIndex] = schedule.classesTable[timeIndex, classIndex];
         }
     }
 }
Beispiel #2
0
        string SClassPositionToString(StudentsClassPosition position)
        {
            string week = (Constants.GetWeekOfClass(position.Time) == 0 ? "Верхняя" : "Нижняя") + " неделя";
            int day = Constants.GetDayOfClass(position.Time);
            day = day >= Constants.DAYS_IN_WEEK ? day - Constants.DAYS_IN_WEEK : day;
            string dayString = ((DayOfWeek)(day + 1)).ToString();

            string time = "пара " + (Constants.GetTimeOfClass(position.Time) + 1).ToString();
            ClassRoom room = EStorage.ClassRooms[position.ClassRoom];
            string classRoom = room.Number + "/" + room.Housing;
            return week + ", " + dayString + ", " + time + ", " + classRoom;
        }
Beispiel #3
0
        void Logger_StartInstallClass(StudentsClass sClass, StudentsClassPosition[] positionsForClass, int[] fines)
        {
            logger.Trace("Попытка установки пары " + sClass.Name + " " + TeatherNameToString(sClass));
            logger.Trace("----- Доступны позиции для установки (" + Array.FindAll<int>(fines, f => f != Constants.BLOCK_FINE).Length + "):");
            string positionsString = "\n";
            for (int positionIndex = 0; positionIndex < positionsForClass.Length; positionIndex++)
            {
                if(fines[positionIndex] != Constants.BLOCK_FINE)
                {
                    positionsString += ((positionIndex + 1).ToString() + ". " + SClassPositionToString(positionsForClass[positionIndex]) + ", штраф: " + fines[positionIndex] + "\n");

                }
            }
            logger.Trace(positionsString);
        }
Beispiel #4
0
 void Logger_ClassInstalled(StudentsClass sClass, StudentsClassPosition position, int indexInList, int listLength, int fine)
 {
     logger.Trace("----- Выбрана позиция: " + SClassPositionToString(position) + ", штраф: " + fine);
     logger.Info("Пара <" + sClass.Name + " " + TeatherNameToString(sClass) +
                 "> установлена (" + (indexInList + 1) + "/" + listLength + ")");
 }
Beispiel #5
0
 int GetSumFine(StudentsClassPosition position, IFactor[] factors, FullSchedule scheduleForCreateTemp, StudentsClass sClass)
 {
     FullSchedule schedule = new FullSchedule(scheduleForCreateTemp);
     schedule.SetClass(sClass, position);
     int fine = 0;
     int resultFine = position.Fine;
     for (int factorIndex = 0; factorIndex < factors.Length; factorIndex++)
     {
         fine = factors[factorIndex].GetFineOfAddedClass(schedule, EStorage);
         if (fine != Constants.BLOCK_FINE)
         {
             resultFine += fine;
         }
         else
         {
             return Constants.BLOCK_FINE;
         }
     }
     return resultFine;
 }
Beispiel #6
0
 public void SetClass(StudentsClass sClass, StudentsClassPosition position)
 {
     classesTable[position.Time, position.ClassRoom] = sClass;
     TempClass = position;
 }