forked from Maxluli/RustyPropagation
working version
remove const no need for RwLock as we don't use mut in thread \o/
This commit is contained in:
+11
-1
@@ -12,8 +12,18 @@ mod prelude {
|
||||
}
|
||||
|
||||
use prelude::*;
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
struct Args {
|
||||
/// Number of threads
|
||||
#[clap(short, long, default_value_t = 1)]
|
||||
threads: usize,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
|
||||
let term = Term::stdout();
|
||||
term.write_line("********** Rusty Propagation (Console) 2022 **********")
|
||||
.expect("Oops Looks like we have a problem here...");
|
||||
@@ -29,7 +39,7 @@ fn main() {
|
||||
let mut counter: u32 = 0;
|
||||
loop {
|
||||
counter += 1;
|
||||
stats = population.propagate_new();
|
||||
stats = population.propagate_new(Some(args.threads));
|
||||
//population.display();
|
||||
println!(
|
||||
"Normal: {} Infecteds: {} Immunes: {} Deads: {}",
|
||||
|
||||
Reference in New Issue
Block a user