Skip to content

Commit

Permalink
chore(jssp): disable population diversity estimation (#428)
Browse files Browse the repository at this point in the history
<!-- If applicable - remember to add the PR to the EA Rust project (ONLY
IF THERE IS NO LINKED ISSUE) -->

## Description

Right now this mechanism is either not working or the solver is really
bad.
This needs to be tested, however using this right now is pointless.
  • Loading branch information
kkafar authored Oct 9, 2023
1 parent 436b8e2 commit da6d8ed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/jssp/problem/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ impl JsspProbe {
Self {}
}

// TODO: This has either been not working as expected or the solver runs so bad.
// TODO: Verify whether the diversity is better on other problems
fn estimate_pop_diversity(population: &[JsspIndividual]) -> f64 {
population
.iter()
Expand Down Expand Up @@ -42,7 +44,9 @@ impl Probe<JsspIndividual> for JsspProbe {
metadata: &ecrs::ga::GAMetadata,
population: &[JsspIndividual],
) {
let diversity = JsspProbe::estimate_pop_diversity(population);
// TODO: As this metric is useless right now I'm disabling it temporarily
// let diversity = JsspProbe::estimate_pop_diversity(population);
let diversity = 0.0;
info!(target: "csv", "diversity,0,0,{},{diversity}\npopgentime,{}", population.len(), metadata.pop_gen_dur.unwrap().as_millis());
}

Expand All @@ -57,7 +61,9 @@ impl Probe<JsspIndividual> for JsspProbe {
}

fn on_new_generation(&mut self, metadata: &ecrs::ga::GAMetadata, generation: &[JsspIndividual]) {
let diversity = JsspProbe::estimate_pop_diversity(generation);
// TODO: As this metric is useless right now I'm disabling it temporarily
// let diversity = JsspProbe::estimate_pop_diversity(generation);
let diversity = 0.0;
info!(
target: "csv",
"diversity,{},{},{},{diversity}",
Expand Down

0 comments on commit da6d8ed

Please sign in to comment.