Skip to content

Commit

Permalink
make compatible with other features
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperCodec committed May 15, 2024
1 parent 945ea4a commit 0717843
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,21 @@ struct PerformanceStats {

const OUTPUT_FILE_NAME: &'static str = "fitness-plot.svg";
const GENS: usize = 100;

fn main() -> Result<(), Box<dyn Error>> {
#[cfg(not(feature = "rayon"))]
let mut rng = rand::thread_rng();

let performance_stats = Arc::new(Mutex::new(Vec::with_capacity(GENS)));
let ng = PlottingNG { performance_stats: performance_stats.clone(), actual_ng: division_pruning_nextgen };

let mut sim = GeneticSim::new(
#[cfg(not(feature = "rayon"))]
Vec::gen_random(&mut rng, 100),

#[cfg(feature = "rayon")]
Vec::gen_random(100),

fitness,
ng,
);
Expand Down

0 comments on commit 0717843

Please sign in to comment.