예제 #1
0
 public override string ToString()
 {
     return("Bus Num: " + Id
            + " Cost: " + Cost
            + " Starts at: " + Constans.GetTimeFromNimutes(StartTime)
            + " Period: " + Period);
 }
예제 #2
0
        public override string ToString()
        {
            string stations = "";
            string buses    = "";

            foreach (var station in PassedStations)
            {
                stations += station.ToString() + " ";
            }
            foreach (var bus in PassedBuses)
            {
                buses += bus.ToString() + " ";
            }
            return("Way: " + Way
                   + " Stations: " + stations
                   + " Current Bus:  " + BusId
                   + " Starts: " + StartStation
                   + " Ends: " + EndStation
                   + " Starts at: " + Constans.GetTimeFromNimutes(StartTime)
                   + " Ends at: " + Constans.GetTimeFromNimutes(EndTime)
                   + " Cost: " + Cost);
        }
예제 #3
0
        public void SolutionResult()
        {
            List <Transaction> res = TaskBusFleet.Solution(GetStartStation(), GetEndStation(), GetStartTime()).ToList();

            if (res == null || res.Count != 2)
            {
                MessageBox.Show("Решение ошибочно или его нет!");
                return;
            }

            string timeRes = "Самый быстрый маршрут : ";

            timeRes += res[0].Way + res[0].EndStation.ToString();

            timeRes += " Время прибытия : " + Constans.GetTimeFromNimutes(res[0].EndTime);

            string costRes = "Самый дешёвый маршрут : ";

            costRes += res[1].Way + res[1].EndStation.ToString();

            costRes += " Цена поездки : " + res[1].Cost;
            listBox2.Items.Add(costRes);
            listBox2.Items.Add(timeRes);
        }