Skip to content

Commit

Permalink
test algorithm update
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebRose committed Jan 16, 2025
1 parent a399934 commit c09480d
Showing 1 changed file with 45 additions and 41 deletions.
86 changes: 45 additions & 41 deletions managers/GameplanManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,9 @@ func MassUpdateGameplanSchemesTEST(off, def string) {
offensiveSchemes := GetOffensiveDefaultSchemes()
defensiveSchemes := GetDefensiveDefaultSchemes()
for _, team := range teams {
if team.ID > 194 {
continue
}
teamID := strconv.Itoa(int(team.ID))
gp := GetGameplanTESTByTeamID(teamID)
gp.UpdateSchemes(off, def)
Expand Down Expand Up @@ -2177,17 +2180,18 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
player := arch + " " + pos
isGoodFit := CheckPlayerFits(player, goodFits)
isBadFit := CheckPlayerFits(player, badFits)
bonus := 5

// Add to QB List
if pos == "QB" || pos == "RB" || pos == "FB" || pos == "ATH" {
score := 0
if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}
if pos == "QB" {
score += 100
score += 75
} else if pos == "ATH" && (arch == "Triple-Threat" || arch == "Field General") {
score += 50
}
Expand All @@ -2213,9 +2217,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
score += 50
}
if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += ((cp.Speed + cp.Agility + cp.Strength + cp.Carrying) / 4)
Expand All @@ -2239,9 +2243,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}
score += ((cp.Strength + cp.Carrying + cp.PassBlock + cp.RunBlock) / 4)

Expand All @@ -2264,9 +2268,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.5) + int(float64(cp.RunBlock)*0.125) + int(float64(cp.PassBlock)*0.125) + int(float64(cp.Catching)*0.125) + int(float64(cp.Strength)*0.125)
Expand All @@ -2289,9 +2293,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.4) +
Expand Down Expand Up @@ -2321,9 +2325,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.7) +
Expand Down Expand Up @@ -2357,9 +2361,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 30
score += bonus
} else if isBadFit && !isGoodFit {
score -= 30
score -= bonus
}

score += int(float64(cp.Overall)*0.7) +
Expand All @@ -2386,15 +2390,15 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
if pos == "C" {
score += 100
} else if pos == "OG" {
score += 25
score += 15
} else if pos == "ATH" && (arch == "Lineman") {
score += 50
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.7) +
Expand Down Expand Up @@ -2425,9 +2429,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.7) +
Expand Down Expand Up @@ -2465,9 +2469,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.7) +
Expand Down Expand Up @@ -2502,9 +2506,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.6) +
Expand Down Expand Up @@ -2546,9 +2550,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.6) +
Expand Down Expand Up @@ -2583,9 +2587,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.5) +
Expand Down Expand Up @@ -2619,9 +2623,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.5) +
Expand Down Expand Up @@ -2655,9 +2659,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += int(float64(cp.Overall)*0.5) +
Expand All @@ -2678,7 +2682,7 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

// Add to P list
if pos == "K" || pos == "P" || pos == "QB" || pos == "ATH" {
if pos == "K" || pos == "P" || pos == "ATH" {
score := 0
if pos == "P" {
score += 100
Expand All @@ -2689,9 +2693,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += cp.PuntAccuracy + cp.PuntPower
Expand All @@ -2706,7 +2710,7 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

// Add to K list (Field Goal)
if pos == "K" || pos == "P" || pos == "QB" || pos == "ATH" {
if pos == "K" || pos == "P" || pos == "ATH" {
score := 0
if pos == "K" {
score += 100
Expand All @@ -2717,9 +2721,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}
score += cp.KickAccuracy + cp.KickPower
dcpObj := structs.DepthChartPositionDTO{
Expand All @@ -2732,7 +2736,7 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

// FG List
if pos == "K" || pos == "P" || pos == "QB" || pos == "ATH" {
if pos == "K" || pos == "P" || pos == "ATH" {
score := 0
if pos == "K" {
score += 100
Expand All @@ -2743,9 +2747,9 @@ func ReAlignCollegeDepthChartTEST(db *gorm.DB, teamID string, gp structs.College
}

if isGoodFit && !isBadFit {
score += 50
score += bonus
} else if isBadFit && !isGoodFit {
score -= 50
score -= bonus
}

score += cp.KickAccuracy + cp.KickPower
Expand Down

0 comments on commit c09480d

Please sign in to comment.