FBSim Core
A library for american football simulation
Overview
In its initial iteration, this crate provides utilities for simulating american football leagues at the box score level. It is based on the four regression models derived in this repository.
Usage
Adding via Cargo
To add the package to your project, run the following from your project directory.
Box score simulator
To simulate a game using the box score simulator, one might replicate the following example. Note that FootballTeam and BoxScore both derive the serde Serialize and Deserialize traits and thus may be instantiated from JSON.
use BoxScoreSimulator;
use FootballTeam;
// Instantiate the simulator
let my_box_score_sim = new;
// Instantiate the home and away team
let home_team = from_properties.unwrap;
let away_team = from_properties.unwrap;
// Instantiate an RNG and simulate
let mut rng = thread_rng;
let my_box_score = my_box_score_sim.sim.unwrap;
println!;