@@ -319,12 +319,7 @@ impl WasmStepResult {
319319/// Interactive evolution optimizer for human-in-the-loop optimization
320320#[ wasm_bindgen]
321321pub struct InteractiveOptimizer {
322- iga : InteractiveGA <
323- RealVector ,
324- TournamentSelection ,
325- SbxCrossover ,
326- PolynomialMutation ,
327- > ,
322+ iga : InteractiveGA < RealVector , TournamentSelection , SbxCrossover , PolynomialMutation > ,
328323 rng : rand:: rngs:: StdRng ,
329324}
330325
@@ -456,8 +451,11 @@ impl InteractiveOptimizer {
456451 termination_reason : None ,
457452 } ,
458453 StepResult :: Complete ( result) => {
459- let best_candidates: Vec < WasmCandidate > =
460- result. best_candidates . iter ( ) . map ( WasmCandidate :: from) . collect ( ) ;
454+ let best_candidates: Vec < WasmCandidate > = result
455+ . best_candidates
456+ . iter ( )
457+ . map ( WasmCandidate :: from)
458+ . collect ( ) ;
461459 WasmStepResult {
462460 result_type : StepResultType :: Complete ,
463461 request : None ,
@@ -477,7 +475,9 @@ impl InteractiveOptimizer {
477475 #[ wasm_bindgen( js_name = provideRatings) ]
478476 pub fn provide_ratings ( & mut self , ratings : & [ f64 ] ) -> Result < ( ) , JsValue > {
479477 if ratings. len ( ) % 2 != 0 {
480- return Err ( JsValue :: from_str ( "Ratings array must have even length (id, rating pairs)" ) ) ;
478+ return Err ( JsValue :: from_str (
479+ "Ratings array must have even length (id, rating pairs)" ,
480+ ) ) ;
481481 }
482482
483483 let ratings_vec: Vec < ( CandidateId , f64 ) > = ratings
@@ -593,7 +593,10 @@ fn convert_request(request: &EvaluationRequest<RealVector>) -> WasmEvaluationReq
593593 ..
594594 } => WasmEvaluationRequest {
595595 request_type : RequestType :: Pairwise ,
596- candidates : vec ! [ WasmCandidate :: from( candidate_a) , WasmCandidate :: from( candidate_b) ] ,
596+ candidates : vec ! [
597+ WasmCandidate :: from( candidate_a) ,
598+ WasmCandidate :: from( candidate_b) ,
599+ ] ,
597600 select_count : 1 ,
598601 scale_min : 0.0 ,
599602 scale_max : 1.0 ,
0 commit comments