fix issues
This commit is contained in:
@@ -596,8 +596,12 @@ export class RatingEventFactory {
|
||||
startPosition: number,
|
||||
fieldStrength: number
|
||||
): number {
|
||||
// Handle edge cases where data might be inconsistent
|
||||
// If totalDrivers is less than position, use position as totalDrivers for calculation
|
||||
const effectiveTotalDrivers = Math.max(totalDrivers, position);
|
||||
|
||||
// Base score from position (reverse percentile)
|
||||
const positionScore = ((totalDrivers - position + 1) / totalDrivers) * 100;
|
||||
const positionScore = ((effectiveTotalDrivers - position + 1) / effectiveTotalDrivers) * 100;
|
||||
|
||||
// Bonus for positions gained
|
||||
const positionsGained = startPosition - position;
|
||||
|
||||
Reference in New Issue
Block a user