use rand::Rng;
const MAXVAL:u32 =800000000; // total number of people in the model.
const RUNS:u32 =100000; // how many ticks will the simulation run?
const R0:f32 =3.0; // Number of people each infected person tries to infect per tick.
const R0INT:i32 = R0 as i32; //Integer version of R0. (Used to calculate infection probability when the R0 is not an integer.)
const R0FRACT:f32 = R0  R0INT as f32 ; //Remainder of R0 when integer value is subtracted. (Used to calculate infection probability when the R0 is not an integer.)
const ILENGTH:i32 =12; // Sets the time a person is immune after infection. (Currently 50 days.)
fn main() {
struct human {
// This is people.
sick :bool,
ifect : bool,
immune : i32 }
struct virun {
//This is a single geographic node made up of yummy people.
zombies : Vec,
maxloop : u32,
loops : u32,
totalsick : u32,
totalimmune : u32
}
// This is where the member functions go.
impl human{}
impl virun{
}
let mut runlist = virun
{ zombies : Vec::with_capacity(MAXVAL as usize) ,
maxloop : RUNS,
loops : 0,
totalsick : 0,
totalimmune :0};
runlist.loadhumans();
let mut rng = rand::thread_rng();
let tempxrand:f32 = rng.gen_range (0.0 .. 1.0);
runlist.zombies[0].ifect=true; //start the pandemic. (Your uncle Bob gets bitten by a zombie marmot from space.)
for lcounter in 0..runlist.maxloop {
println!("looping {}",lcounter);
runlist.totalsick=0;
runlist.totalimmune=0;
runlist.infectscan();
println!("End of day :{} Total Sick = {}. Total Immune = {} empty {}",lcounter, runlist.totalsick, runlist.totalimmune, MAXVAL  runlist.totalimmune);
}
}
