Fmt.
This commit is contained in:
@@ -101,11 +101,13 @@ fn criterion_benchmark(c: &mut Criterion) {
|
||||
.filter(|&(n, _)| n % 2 == 1)
|
||||
.map(|(_, wrapper)| wrapper)
|
||||
.take(5),
|
||||
).map(|(a, b)| a.individual.mate(&b.individual))
|
||||
)
|
||||
.map(|(a, b)| a.individual.mate(&b.individual))
|
||||
.map(|individual| Wrapper {
|
||||
individual,
|
||||
fitness: None,
|
||||
}).for_each(|wrapper| {
|
||||
})
|
||||
.for_each(|wrapper| {
|
||||
population.push(wrapper);
|
||||
});
|
||||
|
||||
@@ -120,7 +122,8 @@ fn criterion_benchmark(c: &mut Criterion) {
|
||||
individual,
|
||||
fitness: None,
|
||||
}
|
||||
}).collect_into_vec(population);
|
||||
})
|
||||
.collect_into_vec(population);
|
||||
|
||||
// Add all parents again.
|
||||
population.extend(parents.iter().cloned());
|
||||
|
||||
@@ -87,11 +87,13 @@ fn main() {
|
||||
.filter(|&(n, _)| n % 2 == 1)
|
||||
.map(|(_, wrapper)| wrapper)
|
||||
.take(5),
|
||||
).map(|(a, b)| a.individual.mate(&b.individual))
|
||||
)
|
||||
.map(|(a, b)| a.individual.mate(&b.individual))
|
||||
.map(|individual| Wrapper {
|
||||
individual,
|
||||
fitness: None,
|
||||
}).for_each(|wrapper| {
|
||||
})
|
||||
.for_each(|wrapper| {
|
||||
population.push(wrapper);
|
||||
});
|
||||
|
||||
@@ -106,7 +108,8 @@ fn main() {
|
||||
individual,
|
||||
fitness: None,
|
||||
}
|
||||
}).collect_into_vec(population);
|
||||
})
|
||||
.collect_into_vec(population);
|
||||
|
||||
// Add all parents again.
|
||||
population.extend(parents.iter().cloned());
|
||||
|
||||
@@ -88,7 +88,8 @@ where
|
||||
.map(|individual| Wrapper {
|
||||
individual,
|
||||
fitness: None,
|
||||
}).for_each(|wrapper| {
|
||||
})
|
||||
.for_each(|wrapper| {
|
||||
population.push(wrapper);
|
||||
});
|
||||
|
||||
@@ -139,7 +140,8 @@ where
|
||||
.map(|individual| Wrapper {
|
||||
individual,
|
||||
fitness: None,
|
||||
}).collect_into_vec(&mut population);
|
||||
})
|
||||
.collect_into_vec(&mut population);
|
||||
|
||||
ParSimulation { population }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user