Beispiel #1
0
        public bool Equals(TourTime other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(other.Index == Index);
        }
Beispiel #2
0
        public static void InitializeTourTimes()
        {
            if (Times != null)
            {
                return;
            }

            Times = new TourTime[TOTAL_TOUR_TIMES];

            int alternativeIndex = 0;

            for (int arrivalPeriodIndex = 0; arrivalPeriodIndex < DayPeriod.SmallDayPeriods.Length; arrivalPeriodIndex++)
            {
                for (int departurePeriodIndex = arrivalPeriodIndex; departurePeriodIndex < DayPeriod.SmallDayPeriods.Length; departurePeriodIndex++)
                {
                    TourTime time = new TourTime(alternativeIndex, DayPeriod.SmallDayPeriods[arrivalPeriodIndex], DayPeriod.SmallDayPeriods[departurePeriodIndex]);

                    Times[alternativeIndex++] = time;
                }
            }
        }