Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     laneProperties     = gameObject.GetComponent <LaneProperties>();
     motorwayManager    = GameObject.FindWithTag("MotorwayManager");
     motorwayStats      = motorwayManager.GetComponent <MotorwayStats>();
     motorwayParameters = motorwayManager.GetComponent <Parameters>();
     motorwayTiming     = motorwayManager.GetComponent <MotorwayTiming>();
 }
    // Start is called before the first frame update
    void Start()
    {
        motorwayManager = GameObject.FindWithTag("MotorwayManager");
        parameters      = motorwayManager.GetComponent <Parameters>();
        motorwayTiming  = motorwayManager.GetComponent <MotorwayTiming>();

        if (parameters.duration == 0)
        {
            timeTitleText.text = "Elapsed Time";
        }
        else
        {
            timeTitleText.text = "Remaining Time";
        }
    }
Example #3
0
    public void GetStats()
    {
        motorwayManager = GameObject.FindWithTag("MotorwayManager");
        motorwayTiming  = motorwayManager.GetComponent <MotorwayTiming>();
        motorwayStats   = motorwayManager.GetComponent <MotorwayStats>();

        eastVehicleArrivals = motorwayStats.eastVehicleArrivals;
        westVehicleArrivals = motorwayStats.westVehicleArrivals;

        eastVehicleDepartures = motorwayStats.eastVehicleDepartures;
        westVehicleDepartures = motorwayStats.westVehicleDepartures;

        eastAverageSpeeds = motorwayStats.eastAverageSpeeds;
        westAverageSpeeds = motorwayStats.westAverageSpeeds;

        eastVehicleNums = motorwayStats.eastVehicleNums;
        westVehicleNums = motorwayStats.westVehicleNums;

        eastArrivalRates = motorwayStats.eastArrivalRates;
        westArrivalRates = motorwayStats.westArrivalRates;

        eastDepartureRates = motorwayStats.eastDepartureRates;
        westDepartureRates = motorwayStats.westDepartureRates;

        eastAverageArrivalRate = AverageFloatList(eastArrivalRates);
        westAverageArrivalRate = AverageFloatList(westArrivalRates);

        eastAverageDepartureRate = AverageFloatList(eastDepartureRates);
        westAverageDepartureRate = AverageFloatList(westDepartureRates);

        eastAverageSpeed = AverageFloatList(eastAverageSpeeds);
        westAverageSpeed = AverageFloatList(westAverageSpeeds);

        eastAverageVehicleNum = AverageIntList(eastVehicleNums);
        westAverageVehicleNum = AverageIntList(westVehicleNums);
    }