Example #1
0
        static internal int GetRacePosition(Driver driver, Car car, Divisions division, int ct)
        {
            int   position = 1;
            float sd       = Constants.sd;

            float rPerformance = (80 - 0.03f * driver.GetOA() - 0.18f * car.GetCarLevel())
                                 / (1f + 0.033f * ct / 100);
            float rOpPerformance = (80 - 0.03f * SpHelper.GetAvgOA(division) - 0.18f * SpHelper.GetAvgCarLevel(division))
                                   / (1f + 0.033f * SpHelper.GetAvgCT(division) / 100);

            position = (int)(40 - 39 * Classes.Maths.NormalDistribution.GetCumulativeDistribution(rPerformance, rOpPerformance, sd));

            position = AssurePositionWithinLimits(position);

            return(position);
        }
Example #2
0
        static internal int GetQualPosition(Classes.Driver driver, Classes.Car car, Classes.Divisions division)
        {
            int   position = 1;
            float sd       = Constants.sd;

            float qPerformance   = 80 - 0.03f * driver.GetOA() - 0.18f * car.GetCarLevel();
            float qOpPerformance = 80 - 0.03f * SpHelper.GetAvgOA(division) - 0.18f * SpHelper.GetAvgCarLevel(division);

            position = (int)(40 - 39 * Classes.Maths.NormalDistribution.GetCumulativeDistribution(qPerformance, qOpPerformance, sd));

            position = AssurePositionWithinLimits(position);

            return(position);
        }