Example #1
0
        public expectedArrivalEndStation initTram(int i, int j, string[][] rates)
        {
            if (String.IsNullOrWhiteSpace(rates[i][j]))
            {
                return(initTram(i, (j + 1), rates));
            }
            else
            {
                Tram t = new Tram(i);

                //get all departures
                for (int k = j; k < rates[0].Length; k++)
                {
                    if (String.IsNullOrWhiteSpace(rates[i][k]))
                    {
                        //nothing..
                    }
                    else
                    {
                        string   str         = rates[i][k];
                        int      h           = int.Parse(str.Substring(0, 2));
                        int      m           = int.Parse(str.Substring(3, 2));
                        int      s           = int.Parse(str.Substring(6, 2));
                        TimeSpan tmpTimespan = (new TimeSpan(0, h, m, s, 0));
                        if (rates[0][k] == "Vertrektijd CS")
                        {
                            t.departures.Enqueue(new DepartureEndStation(tmpTimespan, d.centraal, t));
                        }
                        else if (rates[0][k] == "Vertrektijd P&R")
                        {
                            t.departures.Enqueue(new DepartureEndStation(tmpTimespan, d.uithof, t));
                        }
                    }
                }
                //return event
                TimeSpan desiredArrival     = TimeSpan.FromMinutes(t.departures.Peek().eventTime.TotalMinutes - 3);
                expectedArrivalEndStation a = new expectedArrivalEndStation(desiredArrival, t.departures.Peek().departureStation, t);
                return(a);
            }
        }
Example #2
0
 public arrivalEndStation(TimeSpan arrivalTime, EndStation arrivalStation, Tram tram)
 {
     this.eventTime      = arrivalTime;
     this.arrivalStation = arrivalStation;
     this.tram           = tram;
 }
Example #3
0
 public departureSubStation(TimeSpan departTime, SubStation departureSation, Tram tram)
 {
     this.eventTime        = departTime;
     this.tram             = tram;
     this.departureStation = departureSation;
 }
Example #4
0
 public arrivalSubStation(TimeSpan eta, SubStation arrivalStation, Tram tram)
 {
     this.eventTime      = eta;
     this.arrivalStation = arrivalStation;
     this.tram           = tram;
 }
Example #5
0
 public expectedArrivalEndStation(TimeSpan eta, EndStation arrivalStation, Tram tram)
 {
     this.eventTime      = eta;
     this.arrivalStation = arrivalStation;
     this.tram           = tram;
 }
Example #6
0
 public DepartureEndStation(TimeSpan departTime, EndStation departureStation, Tram tram)
 {
     this.eventTime        = departTime;
     this.tram             = tram;
     this.departureStation = departureStation;
 }