@@ -103,6 +103,10 @@ pub(crate) fn to_specs(py: Python, xlimits: Vec<Vec<f64>>) -> PyResult<PyObject>
103
103
/// Infill criteria to decide best next promising point.
104
104
/// Can be either InfillStrategy.EI, InfillStrategy.WB2 or InfillStrategy.WB2S.
105
105
///
106
+ /// cstr_strategy (ConstraintStrategy enum)
107
+ /// Constraint management either use the mean value or upper bound
108
+ /// Can be either ConstraintStrategy.MeanValue or ConstraintStrategy.UpperTrustedBound.
109
+ ///
106
110
/// q_points (int > 0):
107
111
/// Number of points to be evaluated to allow parallel evaluation of the function under optimization.
108
112
///
@@ -170,6 +174,7 @@ pub(crate) struct Egor {
170
174
pub regression_spec : RegressionSpec ,
171
175
pub correlation_spec : CorrelationSpec ,
172
176
pub infill_strategy : InfillStrategy ,
177
+ pub cstr_strategy : ConstraintStrategy ,
173
178
pub q_points : usize ,
174
179
pub par_infill_strategy : ParInfillStrategy ,
175
180
pub infill_optimizer : InfillOptimizer ,
@@ -209,6 +214,7 @@ impl Egor {
209
214
regr_spec = RegressionSpec :: CONSTANT ,
210
215
corr_spec = CorrelationSpec :: SQUARED_EXPONENTIAL ,
211
216
infill_strategy = InfillStrategy :: Wb2 ,
217
+ cstr_strategy = ConstraintStrategy :: Mv ,
212
218
q_points = 1 ,
213
219
par_infill_strategy = ParInfillStrategy :: Kb ,
214
220
infill_optimizer = InfillOptimizer :: Cobyla ,
@@ -234,6 +240,7 @@ impl Egor {
234
240
regr_spec : u8 ,
235
241
corr_spec : u8 ,
236
242
infill_strategy : InfillStrategy ,
243
+ cstr_strategy : ConstraintStrategy ,
237
244
q_points : usize ,
238
245
par_infill_strategy : ParInfillStrategy ,
239
246
infill_optimizer : InfillOptimizer ,
@@ -265,6 +272,7 @@ impl Egor {
265
272
regression_spec : RegressionSpec ( regr_spec) ,
266
273
correlation_spec : CorrelationSpec ( corr_spec) ,
267
274
infill_strategy,
275
+ cstr_strategy,
268
276
q_points,
269
277
par_infill_strategy,
270
278
infill_optimizer,
@@ -461,6 +469,13 @@ impl Egor {
461
469
}
462
470
}
463
471
472
+ fn cstr_strategy ( & self ) -> egobox_ego:: ConstraintStrategy {
473
+ match self . cstr_strategy {
474
+ ConstraintStrategy :: Mv => egobox_ego:: ConstraintStrategy :: MeanValue ,
475
+ ConstraintStrategy :: Utb => egobox_ego:: ConstraintStrategy :: UpperTrustedBound ,
476
+ }
477
+ }
478
+
464
479
fn qei_strategy ( & self ) -> egobox_ego:: QEiStrategy {
465
480
match self . par_infill_strategy {
466
481
ParInfillStrategy :: Kb => egobox_ego:: QEiStrategy :: KrigingBeliever ,
@@ -519,6 +534,7 @@ impl Egor {
519
534
doe : Option < & Array2 < f64 > > ,
520
535
) -> egobox_ego:: EgorConfig {
521
536
let infill_strategy = self . infill_strategy ( ) ;
537
+ let cstr_strategy = self . cstr_strategy ( ) ;
522
538
let qei_strategy = self . qei_strategy ( ) ;
523
539
let infill_optimizer = self . infill_optimizer ( ) ;
524
540
@@ -536,6 +552,7 @@ impl Egor {
536
552
egobox_moe:: CorrelationSpec :: from_bits ( self . correlation_spec . 0 ) . unwrap ( ) ,
537
553
)
538
554
. infill_strategy ( infill_strategy)
555
+ . cstr_strategy ( cstr_strategy)
539
556
. q_points ( self . q_points )
540
557
. qei_strategy ( qei_strategy)
541
558
. infill_optimizer ( infill_optimizer)
0 commit comments