Exemple #1
0
 public DepartureEndStation(TimeSpan departTime, EndStation departureStation, Tram tram)
 {
     this.eventTime        = departTime;
     this.tram             = tram;
     this.departureStation = departureStation;
 }
Exemple #2
0
 public expectedArrivalEndStation(TimeSpan eta, EndStation arrivalStation, Tram tram)
 {
     this.eventTime      = eta;
     this.arrivalStation = arrivalStation;
     this.tram           = tram;
 }
Exemple #3
0
        public static void updateAverageDepartureDelay(TimeSpan actualDeparture, TimeSpan scheduleDeparture, EndStation station)
        {
            double delay = (actualDeparture - scheduleDeparture).TotalSeconds;

            if (station.stationNumber == 1)
            {
                if (delay > maxDepartureDelayC)
                {
                    maxDepartureDelayC = delay;
                }
                if (delay > 0)
                {
                    averageDelayTimeC = (averageDelayTimeC * numberOfTramsC + delay) / (numberOfTramsC + 1);
                    if (delay > 60)
                    {
                        numOfCriticalDelayedtramsC++;
                    }
                }
                numberOfTramsC++;
            }
            else
            {
                if (delay > maxDepartureDelayU)
                {
                    maxDepartureDelayU = delay;
                }
                if (delay > 0)
                {
                    averageDelayTimeU = (averageDelayTimeU * numberOfTramsU + delay) / (numberOfTramsU + 1);
                    if (delay > 60)
                    {
                        numOfCriticalDelayedtramsU++;
                    }
                }
                numberOfTramsU++;
            }
        }