FBSim Core
A library for american football simulation
Overview
Provides utilities for simulating american football games and leagues. It is based on various statistical models derived in repositories
Play-by-play sim
Here is a quick example of simulating a play-by-play game between two teams.
use GameContext;
use GameSimulator;
use FootballTeam;
// Instantiate the home and away teams, game context
let home_team = new;
let away_team = new;
let context = new;
// Instantiate the rng, simulator, and simulate the game
let mut rng = thread_rng;
let sim = new;
let = sim.sim.unwrap;
// Print the game log
println!;
println!;
Final score sim
There is also a less in-depth simulator that produces a final score given two teams. Here is a quick example of its usage.
use FinalScoreSimulator;
use FootballTeam;
// Instantiate the home and away teams
let home_team = new;
let away_team = new;
// Instantiate the rng, simulator, and simulate the game
let mut rng = thread_rng;
let sim = new;
let final_score = sim.sim.unwrap;
// Print the final score
println!;
Installing
To add the package to your project, run the following from your project directory.