We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9599ef6 commit a0d23ffCopy full SHA for a0d23ff
1 file changed
src/optimization/mod.rs
@@ -1,5 +1,5 @@
1
use rand::RngCore;
2
-use std::fmt;
+use std::{fmt, marker::PhantomData};
3
4
/// Defines how candidate parameters behave within the genetic algorithm.
5
pub trait Genome: Clone + Send + Sync + Sized {
@@ -161,6 +161,7 @@ where
161
{
162
config: GeneticOptimizerConfig,
163
evaluator: E,
164
+ phantom: PhantomData<G>,
165
}
166
167
impl<G, E> GeneticOptimizer<G, E>
@@ -170,7 +171,11 @@ where
170
171
172
/// Create a new optimizer.
173
pub fn new(config: GeneticOptimizerConfig, evaluator: E) -> Self {
- Self { config, evaluator }
174
+ Self {
175
+ config,
176
+ evaluator,
177
+ phantom: PhantomData,
178
+ }
179
180
181
/// Execute the optimization run and return the best candidate discovered.
0 commit comments