Esempio n. 1
0
 /// <summary>
 /// Method to store road statistics object in the network statistics
 /// </summary>
 /// <param name="_r">Instance of RoadStatistics object</param>
 public void addRoadStatistics(RoadStatistics _r)
 {
     roadStats.Add(_r);
 }
Esempio n. 2
0
        /// <summary>
        /// Gets statistics of the road
        /// </summary>
        public RoadStatistics getStatistics()
        {
            if(avgComputed == false)
            {
                avgComputed = true;
                computeStatistics();
            }
            Console.WriteLine("Total Vehicles Arrived = " + totalVehiclesArrived);
            Console.WriteLine("Total Vehicles Departed (from Platoon obj) = " + totalNumVehicles);
            Console.WriteLine("Total Platoons Arrived = " + totalPlatoonArrivals);
            Console.WriteLine("Total Platoons Departed = " + totalPlatoonDepartures);

            Console.WriteLine("Avg Platoon Size = {0} Vehicles", avgPlatoonSize);

            Console.WriteLine("Avg. Transit Time = " + avgTransitTime);
            Console.WriteLine("Avg. Wait Time = " + avgWaitTime);
            Console.WriteLine("Avg. Journey Time = " + avgJourneyTime);
            Console.WriteLine("Avg. Dist Traveled = " + avgDistTraveled);

            Console.WriteLine("Number of times platoons could not be created = " + numTimesPlatoonNotCreated);
            RoadStatistics rs = new RoadStatistics(totalVehiclesArrived, totalNumVehicles, totalPlatoonArrivals, totalPlatoonDepartures, totalTransitTime, totalWaitTime, totalJourneyTime, totalDistanceTraveled);
            return rs;
        }