@@ -87,7 +87,10 @@ impl EgorServiceBuilder {
87
87
Xoshiro256Plus :: from_entropy ( )
88
88
} ;
89
89
EgorService {
90
- config : self . config . clone ( ) ,
90
+ config : EgorConfig {
91
+ xtypes : Some ( continuous_xlimits_to_xtypes ( xlimits) ) ,
92
+ ..self . config . clone ( )
93
+ } ,
91
94
solver : EgorSolver :: new ( self . config , xlimits, rng) ,
92
95
}
93
96
}
@@ -102,7 +105,10 @@ impl EgorServiceBuilder {
102
105
Xoshiro256Plus :: from_entropy ( )
103
106
} ;
104
107
EgorService {
105
- config : self . config . clone ( ) ,
108
+ config : EgorConfig {
109
+ xtypes : Some ( xtypes. to_vec ( ) ) ,
110
+ ..self . config . clone ( )
111
+ } ,
106
112
solver : EgorSolver :: new_with_xtypes ( self . config , xtypes, rng) ,
107
113
}
108
114
}
@@ -130,7 +136,11 @@ impl<SB: SurrogateBuilder> EgorService<SB> {
130
136
x_data : & ArrayBase < impl Data < Elem = f64 > , Ix2 > ,
131
137
y_data : & ArrayBase < impl Data < Elem = f64 > , Ix2 > ,
132
138
) -> Array2 < f64 > {
133
- self . solver . suggest ( x_data, y_data)
139
+ let xtypes = self . config . xtypes . as_ref ( ) . unwrap ( ) ;
140
+ let x_data = unfold_with_enum_mask ( xtypes, x_data) ;
141
+ let x = self . solver . suggest ( & x_data, y_data) ;
142
+ let x = cast_to_discrete_values ( xtypes, & x) ;
143
+ fold_with_enum_index ( xtypes, & x) . to_owned ( )
134
144
}
135
145
}
136
146
0 commit comments