Finished underwelming propagation
This commit is contained in:
+16
-3
@@ -20,11 +20,24 @@ fn main() {
|
||||
|
||||
|
||||
let disease = Disease::new(20,10,5,String::from("Covid 44"));
|
||||
let mut population = Population::new(20,10,5,30,30,disease);
|
||||
let mut population = Population::new(20,10,5,300,300,disease);
|
||||
//population.change_disease(disease);
|
||||
println!("Before Filling");
|
||||
population.display();
|
||||
//population.display();
|
||||
population.generate();
|
||||
println!("After Filling");
|
||||
population.display();
|
||||
//population.display();
|
||||
println!("After Propagation");
|
||||
let mut stats: [i32;4] = [0,0,0,0];
|
||||
let mut counter:u32 = 0;
|
||||
loop{
|
||||
counter += 1;
|
||||
stats=population.propagate();
|
||||
//population.display();
|
||||
println!("Infecteds: {} Immunes: {} Deads: {}",stats[1],stats[2],stats[3]);
|
||||
if stats[1] == 0 {break;}
|
||||
}
|
||||
println!("Propagation finished in {} steps",counter);
|
||||
//population.display();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user