1 /*-------------------------------------------------------------------------------------*/
2 /* NOMAD - Nonlinear Optimization by Mesh Adaptive Direct search - version 3.7.2 */
3 /* */
4 /* Copyright (C) 2001-2015 Mark Abramson - the Boeing Company, Seattle */
5 /* Charles Audet - Ecole Polytechnique, Montreal */
6 /* Gilles Couture - Ecole Polytechnique, Montreal */
7 /* John Dennis - Rice University, Houston */
8 /* Sebastien Le Digabel - Ecole Polytechnique, Montreal */
9 /* Christophe Tribes - Ecole Polytechnique, Montreal */
10 /* */
11 /* funded in part by AFOSR and Exxon Mobil */
12 /* */
13 /* Author: Sebastien Le Digabel */
14 /* */
15 /* Contact information: */
16 /* Ecole Polytechnique de Montreal - GERAD */
17 /* C.P. 6079, Succ. Centre-ville, Montreal (Quebec) H3C 3A7 Canada */
18 /* e-mail: nomad@gerad.ca */
19 /* phone : 1-514-340-6053 #6928 */
20 /* fax : 1-514-340-5665 */
21 /* */
22 /* This program is free software: you can redistribute it and/or modify it under the */
23 /* terms of the GNU Lesser General Public License as published by the Free Software */
24 /* Foundation, either version 3 of the License, or (at your option) any later */
25 /* version. */
26 /* */
27 /* This program is distributed in the hope that it will be useful, but WITHOUT ANY */
28 /* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A */
29 /* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */
30 /* */
31 /* You should have received a copy of the GNU Lesser General Public License along */
32 /* with this program. If not, see <http://www.gnu.org/licenses/>. */
33 /* */
34 /* You can find information on the NOMAD software at www.gerad.ca/nomad */
35 /*-------------------------------------------------------------------------------------*/
36 /**
37 \file Parameters.cpp
38 \brief NOMAD parameters (implementation)
39 \author Sebastien Le Digabel
40 \date 2010-04-20
41 \see Parameters.hpp
42 */
43 #include "Parameters.hpp"
44 #include "Slave.hpp"
45 #include "XMesh.hpp"
46 #include "SMesh.hpp"
47
48 bool NOMAD::Parameters::_warning_has_been_displayed=false;
49
50 /*----------------------------------------*/
51 /* destructor */
52 /*----------------------------------------*/
~Parameters(void)53 NOMAD::Parameters::~Parameters ( void )
54 {
55 delete _std_signature;
56 delete_x0s();
57 reset_variable_groups();
58 }
59
60 /*----------------------------------------*/
61 /* initializations (private) */
62 /*----------------------------------------*/
init(void)63 void NOMAD::Parameters::init ( void )
64 {
65 // miscellaneous and algorithm parameters:
66 _to_be_checked = true;
67 _seed = 0;
68 // _seed = NOMAD::get_pid();
69 _max_eval = -1;
70 _max_sim_bb_eval = -1;
71 _max_bb_eval = -1;
72 _max_bbe_decided = false;
73 _max_time = -1;
74 _max_iterations = -1;
75 _max_cons_failed_it = -1;
76 _max_cache_memory = 2000;
77 _cache_save_period = 25;
78 _snap_to_bounds = true;
79 _stop_if_feasible = false;
80 _user_calls_enabled = true;
81 _asynchronous = true;
82 _stat_sum_target.clear();
83 _L_curve_target.clear();
84 _cache_file.clear();
85 _problem_dir.clear();
86 _tmp_dir.clear();
87
88 // F_TARGET:
89 reset_f_target();
90
91 // output files:
92 _add_seed_to_file_names = true;
93 _solution_file.clear();
94 _history_file.clear();
95
96 // NOMAD::Double static members:
97 set_EPSILON ( NOMAD::DEFAULT_EPSILON );
98 set_UNDEF_STR ( NOMAD::DEFAULT_UNDEF_STR );
99 set_INF_STR ( NOMAD::DEFAULT_INF_STR );
100
101 // Mesh:
102 _anisotropic_mesh = true;
103 _use_smesh = false;
104 _mesh_update_basis = 4;
105 _poll_update_basis = 2;
106 _mesh_coarsening_exponent = 1;
107 _mesh_refining_exponent =-1;
108 _initial_mesh_index = 0;
109 _min_poll_size_defined = false;
110 _initial_mesh_size.clear();
111 _initial_poll_size.clear();
112 _min_mesh_size.clear();
113 _min_poll_size.clear();
114
115 // Directions:
116 reset_directions ( );
117
118 // X0:
119 reset_X0();
120
121 // signature:
122 delete _std_signature;
123 _std_signature = NULL;
124
125 // variables:
126 _dimension = -1;
127 _nb_free_variables = -1;
128 _extended_poll_trigger = 0.1;
129 _relative_ept = true;
130 _extended_poll_enabled = true;
131 _bb_input_include_tag = false;
132 _bb_input_include_seed = false;
133 _bb_redirection = true;
134 _bb_input_type.clear();
135 _neighbors_exe.clear();
136 reset_bounds();
137 reset_scaling();
138 reset_fixed_variables();
139 reset_periodic_variables();
140 reset_variable_groups();
141
142 // Barrier:
143 _rho = 0.1;
144 _h_min = 0.0;
145 _h_max_0 = NOMAD::INF;
146 _h_norm = NOMAD::L2;
147 _has_constraints = false;
148 _has_EB_constraints = false;
149 _has_filter_constraints = false;
150 _barrier_type = NOMAD::EB;
151
152 // outputs:
153 _index_obj.clear();
154 _bb_exe.clear();
155 _bb_output_type.clear();
156 _index_cnt_eval = -1;
157 _index_stat_sum = -1;
158 _index_stat_avg = -1;
159
160 // surrogate:
161 _sgte_exe.clear();
162 _sgte_cache_file.clear();
163 _sgte_eval_sort = true;
164 _has_sgte = false;
165 _opt_only_sgte = false;
166 _sgte_cost = -1;
167 _sgte_max_eval = -1;
168
169 // MULTI-MADS:
170 _multi_nb_mads_runs = -1;
171 _multi_overall_bb_eval = -1;
172 _multi_use_delta_crit = false;
173 _multi_formulation = NOMAD::UNDEFINED_FORMULATION;
174 _multi_f_bounds.reset();
175
176 // model is not disabled
177 _disable_models=false;
178
179 // sort is not disabled
180 _disable_eval_sort=false;
181
182
183 // model search parameters:
184 _model_params.search1 = NOMAD::QUADRATIC_MODEL;
185 _model_params.search2 = NOMAD::NO_MODEL;
186
187 _model_params.search_proj_to_mesh = true;
188 _model_params.search_optimistic = true;
189 _model_params.search_max_trial_pts = 10;
190
191 // model ordering parameters:
192 _model_params.eval_sort = NOMAD::QUADRATIC_MODEL;
193 _model_params.eval_sort_cautious = false;
194
195 // quadratic model parameters:
196 _model_params.quad_radius_factor = 2.0;
197 _model_params.quad_use_WP = false;
198 _model_params.quad_min_Y_size = -1;
199 _model_params.quad_max_Y_size = 500;
200 _model_params.model_np1_quad_epsilon =0.01;
201
202 // TGP model parameters:
203 _model_params.tgp_mode = NOMAD::TGP_FAST;
204 _model_params.tgp_reuse_model = true;
205
206 // other searches:
207 _VNS_trigger.clear();
208 _speculative_search = true;
209 _VNS_search = false;
210 _LH_search_p0 = -1;
211 _LH_search_pi = -1;
212 _opportunistic_LH = true;
213 _opp_LH_is_defined = false;
214 _cache_search = false;
215 _opportunistic_cache_search = false;
216 _opp_CS_is_defined = false;
217
218 // opportunistic strategy:
219 _bb_max_block_size = 1;
220 _eval_points_as_block = false;
221 _opportunistic_eval = true;
222 _opportunistic_min_nb_success = -1;
223 _opportunistic_min_eval = -1;
224 _opportunistic_lucky_eval = false;
225 _opportunistic_min_f_imprvmt.clear();
226
227 // display:
228 _out.set_degrees ( NOMAD::NORMAL_DISPLAY );
229 #ifdef DEBUG
230 set_POINT_DISPLAY_LIMIT ( -1 );
231 #else
232 set_POINT_DISPLAY_LIMIT ( NOMAD::DEFAULT_POINT_DISPLAY_LIMIT );
233 #endif
234
235 _out.set_open_brace ( "{" );
236 _out.set_closed_brace ( "}" );
237
238 _display_stats.clear();
239 reset_stats_file();
240
241 _display_all_eval = false;
242 }
243
244 /*------------------------------------------------------------------*/
245 /* delete the list of x0 points: std::vector<NOMAD::Point *> _x0s */
246 /* (private) */
247 /*------------------------------------------------------------------*/
delete_x0s(void)248 void NOMAD::Parameters::delete_x0s ( void )
249 {
250 size_t x0n = _x0s.size();
251 for ( size_t i = 0 ; i < x0n ; ++i )
252 delete _x0s[i];
253 _x0s.clear();
254 }
255
256 /*----------------------------------------*/
257 /* reset parameter X0 */
258 /*----------------------------------------*/
reset_X0(void)259 void NOMAD::Parameters::reset_X0 ( void )
260 {
261 _to_be_checked = true;
262 delete_x0s();
263 _x0_cache_file.clear();
264 }
265
266 /*----------------------------------------*/
267 /* reset the directions */
268 /*----------------------------------------*/
reset_directions(void)269 void NOMAD::Parameters::reset_directions ( void )
270 {
271 _to_be_checked = true;
272 _direction_types.clear();
273 _sec_poll_dir_types.clear();
274 }
275
276 /*--------------------------------------------*/
277 /* check the display and file stats */
278 /*--------------------------------------------*/
check_display_stats(const std::list<std::string> & stats) const279 bool NOMAD::Parameters::check_display_stats
280 ( const std::list<std::string> & stats ) const
281 {
282 int var_index;
283 std::list<std::string>::const_iterator it , end = stats.end();
284 for ( it = stats.begin() ; it != end ; ++it ) {
285 if ( !it->empty() &&
286 NOMAD::Display::get_display_stats_type(*it) == NOMAD::DS_VAR ) {
287 ++it;
288 if ( !NOMAD::atoi ( *it , var_index ) ||
289 var_index < 0 ||
290 var_index >= _dimension ) {
291 return false;
292 }
293 }
294 }
295 return true;
296 }
297
298 /*--------------------------------------------*/
299 /* check a directory name (static, private) */
300 /*--------------------------------------------*/
check_directory(std::string & s)301 bool NOMAD::Parameters::check_directory ( std::string & s )
302 {
303 // step 1: remove spaces at the begining:
304 size_t i = 0 , ns = s.size();
305 while ( i < ns && s[i] == ' ' )
306 ++i;
307 std::string ss;
308 while ( i < ns )
309 ss.push_back(s[i++]);
310 if ( ss.empty() )
311 return false;
312 s = ss;
313
314 // step 2: replace '/' or '\' with DIR_SEP:
315 i = 0;
316 ns = s.size();
317 while ( i < ns ) {
318 if ( s[i] == '/' || s[i] == '\\' )
319 s[i] = NOMAD::DIR_SEP;
320 ++i;
321 }
322
323 // step 3: add DIR_SEP at the end:
324 if ( i >= 1 ) {
325 if (s[i-1] != NOMAD::DIR_SEP) {
326 s += NOMAD::DIR_SEP;
327 }
328 }
329 else {
330 s = ".";
331 s.push_back ( NOMAD::DIR_SEP );
332 }
333
334 return true;
335 }
336
337 /*---------------------------------------------------------------*/
338 /* interpretation of the Parameter_Entry for PERIODIC_VARIABLE */
339 /* (private) */
340 /*---------------------------------------------------------------*/
interpret_periodic_var(const NOMAD::Parameter_Entries & entries)341 void NOMAD::Parameters::interpret_periodic_var
342 ( const NOMAD::Parameter_Entries & entries )
343 {
344 int i , j , k;
345 std::list<std::string>::const_iterator it , end;
346 NOMAD::Parameter_Entry * pe = entries.find ( "PERIODIC_VARIABLE" );
347
348 while ( pe ) {
349
350 // just one variable index (can be '*' or a range of indexes 'i-j'):
351 if ( pe->get_nb_values() == 1 ) {
352
353 it = pe->get_values().begin();
354 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
355 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
356 "invalid parameter: PERIODIC_VARIABLE" );
357
358 for ( k = i ; k <= j ; ++k )
359 set_PERIODIC_VARIABLE (k);
360 }
361
362 // list of variable indexes:
363 else {
364 end = pe->get_values().end();
365 for ( it = pe->get_values().begin() ; it != end ; ++it ) {
366 if ( !NOMAD::atoi ( *it , i ) )
367 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
368 "invalid parameter: PERIODIC_VARIABLE" );
369 set_PERIODIC_VARIABLE (i);
370 }
371 }
372
373 pe->set_has_been_interpreted();
374 pe = pe->get_next();
375 }
376 }
377
378 /*------------------------------------------------------------*/
379 /* interpretation of the Parameter_Entry for VARIABLE_GROUP */
380 /* (private) */
381 /*------------------------------------------------------------*/
interpret_var_groups(const NOMAD::Parameter_Entries & entries)382 void NOMAD::Parameters::interpret_var_groups ( const NOMAD::Parameter_Entries & entries )
383 {
384 int i , j , k;
385 std::set<int> var_indexes;
386 std::list<std::string>::const_iterator it , end;
387 NOMAD::Parameter_Entry * pe = entries.find ( "VARIABLE_GROUP" );
388
389 while ( pe ) {
390
391 // just one variable index (can be '*' or a range of indexes 'i-j'):
392 if ( pe->get_nb_values() == 1 ) {
393
394 it = pe->get_values().begin();
395 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
396 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
397 "invalid parameter: VARIABLE_GROUP" );
398
399 for ( k = j ; k >= i ; --k )
400 var_indexes.insert(k);
401 }
402
403 // list of variable indexes:
404 else {
405 end = pe->get_values().end();
406 for ( it = pe->get_values().begin() ; it != end ; ++it ) {
407 if ( !NOMAD::atoi ( *it , i ) )
408 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
409 "invalid parameter: VARIABLE_GROUP" );
410 var_indexes.insert(i);
411 }
412 }
413
414 set_VARIABLE_GROUP ( var_indexes ,
415 _direction_types ,
416 _sec_poll_dir_types );
417
418 var_indexes.clear();
419
420 pe->set_has_been_interpreted();
421 pe = pe->get_next();
422 }
423 }
424
425 /*------------------------------------------------------*/
426 /* interpretation of the Parameter_Entry for bounds, */
427 /* fixed variables, and scaling (BFVS) */
428 /* (param_name = "LOWER_BOUND" or "UPPER_BOUND" */
429 /* "FIXED_VARIABLE" or "SCALING" ) */
430 /* (private) */
431 /*------------------------------------------------------*/
interpret_BFVS(const NOMAD::Parameter_Entries & entries,const std::string & param_name)432 void NOMAD::Parameters::interpret_BFVS ( const NOMAD::Parameter_Entries & entries ,
433 const std::string & param_name )
434 {
435 // param_name == LOWER_BOUND or UPPER_BOUND or FIXED_VARIABLE:
436 if ( param_name != "LOWER_BOUND" &&
437 param_name != "UPPER_BOUND" &&
438 param_name != "FIXED_VARIABLE" &&
439 param_name != "SCALING" )
440 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
441 "wrong use of Parameters::interpret_BFVS()" );
442
443 NOMAD::Parameter_Entry * pe = entries.find ( param_name );
444 std::list<std::string>::const_iterator it;
445 int i, j, k;
446 NOMAD::Double v;
447 std::string err;
448 std::string file_name;
449 std::ifstream fin;
450
451 while ( pe )
452 {
453
454 // file name or just one index:
455 if ( pe->get_nb_values() == 1 )
456 {
457
458 // special case for FIXED_VARIABLE without value
459 // (the value will be taken from x0, if unique):
460 if ( isdigit ( (*pe->get_values().begin())[0] ) ||
461 *pe->get_values().begin() == "*" )
462 {
463
464 if ( param_name[0] != 'F' )
465 {
466 err = "invalid parameter: " + param_name
467 + " - only one argument, which is not a file name";
468 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
469 }
470
471 if ( _x0s.size() != 1 || !_x0_cache_file.empty() )
472 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
473 "FIXED_VARIABLE with only a variable index and no unique x0" );
474
475 if ( !NOMAD::string_to_index_range ( *pe->get_values().begin() ,
476 i ,
477 j ,
478 &_dimension ) )
479 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
480 "invalid parameter: FIXED_VARIABLE" );
481
482 for ( k = i ; k <= j ; ++k )
483 set_FIXED_VARIABLE ( k , (*_x0s[0])[k] );
484 }
485
486
487 // file name:
488 else {
489
490 file_name = _problem_dir + *pe->get_values().begin();
491
492 fin.open ( file_name.c_str() );
493
494 if ( fin.fail() )
495 {
496 err = "invalid parameter: " + param_name +
497 " - could not open file \'" + file_name + "\'";
498 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
499 }
500
501 try {
502 switch ( param_name[0] ) {
503 case 'L':
504 _lb.reset ( _dimension );
505 fin >> _lb;
506 break;
507 case 'U':
508 _ub.reset ( _dimension );
509 fin >> _ub;
510 break;
511 case 'F':
512 _fixed_variables.reset ( _dimension );
513 fin >> _fixed_variables;
514 break;
515 case 'S':
516 _scaling.reset ( _dimension );
517 fin >> _scaling;
518 }
519 }
520 catch ( NOMAD::Point::Bad_Input & ) {
521 err = "invalid parameter: " + param_name +
522 " - could not read file \'" + file_name + "\'";
523 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
524 }
525
526 fin.close();
527 }
528 }
529
530 // vector form: all values on one row:
531 else if ( pe->get_nb_values() == _dimension + 2 ) {
532
533 if ( !pe->is_unique() ) {
534 err = "invalid parameter: " + param_name +
535 " - has been given in vector form with [] or () and is not unique";
536 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
537 }
538
539 it = pe->get_values().begin();
540
541 if ( *it != "[" && *it != "(" ) {
542 err = "invalid parameter: " + param_name +
543 " - error in vector form with () or []";
544 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
545 }
546
547 ++it;
548 for ( k = 0 ; k < _dimension ; ++k ) {
549 if ( !v.atof(*it) ) {
550 err = "invalid parameter: " + param_name;
551 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
552 }
553
554 ++it;
555 switch ( param_name[0] ) {
556 case 'L': set_LOWER_BOUND ( k , v );
557 break;
558 case 'U': set_UPPER_BOUND ( k , v );
559 break;
560 case 'F': set_FIXED_VARIABLE ( k , v );
561 break;
562 case 'S': set_SCALING ( k , v );
563 }
564 }
565
566 if ( *it != "]" && *it != ")" ) {
567 err = "invalid parameter: " + param_name +
568 " - error in vector form with () or []";
569 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
570 }
571
572 }
573
574 // indexed values:
575 else {
576
577 if ( pe->get_nb_values() != 2 ) {
578 err = "invalid parameter: " + param_name;
579 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
580 }
581
582 it = pe->get_values().begin();
583 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) ) {
584 err = "invalid parameter: " + param_name;
585 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
586 }
587 ++it;
588 if ( !v.atof(*it) ) {
589 err = "invalid parameter: " + param_name;
590 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
591 }
592
593 for ( k = j ; k >= i ; --k )
594 switch (param_name[0]) {
595 case 'L': set_LOWER_BOUND ( k, v );
596 break;
597 case 'U': set_UPPER_BOUND ( k, v );
598 break;
599 case 'F': set_FIXED_VARIABLE ( k, v );
600 break;
601 case 'S': set_SCALING ( k, v );
602 }
603 }
604 pe->set_has_been_interpreted();
605 pe = pe->get_next();
606 }
607 }
608
609 /*----------------------------------------------------------------*/
610 /* interpretation of the Parameter_Entry for F_TARGET (private) */
611 /*----------------------------------------------------------------*/
interpret_f_target(const NOMAD::Parameter_Entries & entries)612 void NOMAD::Parameters::interpret_f_target ( const NOMAD::Parameter_Entries & entries )
613 {
614 NOMAD::Double d;
615 std::list<std::string>::const_iterator it;
616 NOMAD::Parameter_Entry * pe = entries.find ( "F_TARGET" );
617
618 if ( pe )
619 {
620
621 if ( !pe->is_unique() )
622 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
623 "invalid parameter: F_TARGET not unique" );
624
625 it = pe->get_values().begin();
626
627 int nb_values = pe->get_nb_values();
628
629 // just one value: single-objective optimization:
630 if ( nb_values == 1 )
631 {
632
633 if ( !d.atof ( *it ) )
634 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
635 "invalid parameter: F_TARGET" );
636 set_F_TARGET (d);
637 }
638
639 // vector form: multi-objective optimization:
640 else
641 {
642
643 nb_values -= 2;
644
645 NOMAD::Point f_target ( nb_values );
646
647 if ( *it != "[" && *it != "(" )
648 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
649 "invalid parameter: F_TARGET - error in vector form with () or []" );
650
651 ++it;
652
653 for ( int k = 0 ; k < nb_values ; ++k )
654 {
655
656 if ( !d.atof ( *it ) )
657 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
658 "invalid parameter: F_TARGET" );
659 ++it;
660
661 f_target[k] = d;
662 }
663
664 if ( *it != "]" && *it != ")" )
665 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
666 "invalid parameter: F_TARGET - error in vector form with () or []" );
667
668 set_F_TARGET ( f_target );
669 }
670 pe->set_has_been_interpreted();
671 }
672 }
673
674 /*-------------------------------------------------------------*/
675 /* interpretation of the Parameter_Entry for mesh/poll sizes */
676 /* (private) */
677 /*-------------------------------------------------------------*/
interpret_mesh_sizes(const NOMAD::Parameter_Entries & entries,const std::string & param_name)678 void NOMAD::Parameters::interpret_mesh_sizes
679 ( const NOMAD::Parameter_Entries & entries ,
680 const std::string & param_name )
681 {
682 // param_name == "INITIAL_MESH_SIZE" or "INITIAL_MESH_SIZE" or "MIN_MESH_SIZE" or "MIN_POLL_SIZE":
683 if ( param_name != "INITIAL_POLL_SIZE" &&
684 param_name != "INITIAL_MESH_SIZE" &&
685 param_name != "MIN_MESH_SIZE" &&
686 param_name != "MIN_POLL_SIZE" )
687 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
688 "wrong use of Parameters::interpret_mesh_sizes()" );
689
690 int i , j , k;
691 NOMAD::Double v;
692 bool relative;
693 std::string err;
694 std::list<std::string>::const_iterator it;
695 NOMAD::Parameter_Entry * pe = entries.find ( param_name );
696
697 while ( pe )
698 {
699
700 // just one value:
701 if ( pe->get_nb_values() == 1 )
702 {
703
704 if ( !pe->is_unique() )
705 {
706 err = "invalid parameter: " + param_name
707 + " - has been given with just one value and is not unique";
708 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
709 }
710
711 if ( !v.relative_atof ( *pe->get_values().begin() , relative ) )
712 {
713 err = "invalid parameter: " + param_name;
714 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
715 }
716
717 if ( param_name[0] == 'I' && param_name[8] =='M')
718 set_INITIAL_MESH_SIZE ( v , relative );
719 else if ( param_name[0] == 'I' && param_name[8] =='P')
720 set_INITIAL_POLL_SIZE ( v , relative );
721 else if ( param_name[4] == 'M' )
722 set_MIN_MESH_SIZE ( v , relative );
723 else
724 set_MIN_POLL_SIZE ( v , relative );
725 }
726
727 // indexed form:
728 else if ( pe->get_nb_values() == 2 )
729 {
730
731 it = pe->get_values().begin();
732 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
733 {
734 err = "invalid parameter: " + param_name;
735 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
736 }
737 ++it;
738
739 if ( !v.relative_atof( *it , relative ) )
740 {
741 err = "invalid parameter: " + param_name;
742 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
743 }
744
745 for ( k = i ; k <= j ; ++k )
746 {
747 if ( param_name[0] == 'I' && param_name[8] =='M')
748 set_INITIAL_MESH_SIZE ( k , v , relative );
749 else if ( param_name[0] == 'I' && param_name[8] =='P')
750 set_INITIAL_POLL_SIZE ( k , v , relative );
751 else if ( param_name[4] == 'M' )
752 set_MIN_MESH_SIZE ( k , v , relative );
753 else
754 set_MIN_POLL_SIZE ( k , v , relative );
755 }
756 }
757
758 // vector form: all values on one row:
759 else if ( pe->get_nb_values() == _dimension + 2 )
760 {
761
762 if ( !pe->is_unique() ) {
763 err = "invalid parameter: " + param_name
764 + " - has been given in vector form with [] or () and is not unique";
765 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
766 }
767
768 it = pe->get_values().begin();
769
770 if ( *it != "[" && *it != "(" )
771 {
772 err = "invalid parameter: " + param_name +
773 " - error in vector form with () or []";
774 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
775 }
776
777 ++it;
778 for ( k = 0 ; k < _dimension ; ++k )
779 {
780 if ( !v.relative_atof ( *it , relative ) )
781 {
782 err = "invalid parameter: " + param_name;
783 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
784 }
785 ++it;
786 if ( param_name[0] == 'I' && param_name[8] =='M' )
787 set_INITIAL_MESH_SIZE ( k , v , relative );
788 if ( param_name[0] == 'I' && param_name[8] =='P' )
789 set_INITIAL_POLL_SIZE ( k , v , relative );
790 else if ( param_name[4] == 'M' )
791 set_MIN_MESH_SIZE ( k , v , relative );
792 else
793 set_MIN_POLL_SIZE ( k , v , relative );
794 }
795
796 if ( *it != "]" && *it != ")" )
797 {
798 err = "invalid parameter: " + param_name +
799 " - error in vector form with () or []";
800 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
801 }
802 }
803
804 else
805 {
806 err = "invalid parameter: " + param_name;
807 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
808 }
809
810 pe->set_has_been_interpreted();
811 pe = pe->get_next();
812 }
813 }
814
815 /*---------------------------------------------------------------------------------*/
816 /* interpretation of the Parameter_Entry for BB_INPUT_TYPE (private) */
817 /*---------------------------------------------------------------------------------*/
818 /* BB_INPUT_TYPE [ t1 t2 ... tn ] # blackbox input types (one type/variable) */
819 /* or BB_INPUT_TYPE i t # ti in { R , C , B , I } */
820 /* # or { Real , Cat , Bin , Int } */
821 /* or BB_INPUT_TYPE i-j t */
822 /*---------------------------------------------------------------------------------*/
interpret_bb_input_type(const NOMAD::Parameter_Entries & entries)823 void NOMAD::Parameters::interpret_bb_input_type
824 ( const NOMAD::Parameter_Entries & entries )
825 {
826 int i , j , k;
827 NOMAD::bb_input_type bbit;
828 std::list<std::string>::const_iterator it;
829 NOMAD::Parameter_Entry * pe = entries.find ( "BB_INPUT_TYPE" );
830
831 while ( pe ) {
832
833 // indexed form:
834 if ( pe->get_nb_values() == 2 ) {
835
836 it = pe->get_values().begin();
837 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
838 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
839 "invalid parameter: BB_INPUT_TYPE" );
840 ++it;
841 if ( !NOMAD::string_to_bb_input_type ( *it , bbit ) )
842 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
843 "invalid parameter: BB_INPUT_TYPE" );
844
845 for ( k = i ; k <= j ; ++k )
846 set_BB_INPUT_TYPE ( k , bbit );
847 }
848
849 // vector form: all values on one row:
850 else if ( pe->get_nb_values() == _dimension + 2 ) {
851
852 if ( !pe->is_unique() )
853 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
854 std::string ( "invalid parameter: BB_INPUT_TYPE " )
855 + " - has been given in vector form with [] or () and is not unique" );
856
857 it = pe->get_values().begin();
858
859 if ( *it != "[" && *it != "(" )
860 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
861 "invalid parameter: BB_INPUT_TYPE - error in vector form with () or []" );
862
863 ++it;
864 for ( k = 0 ; k < _dimension ; ++k ) {
865 if ( !NOMAD::string_to_bb_input_type ( *it , bbit ) )
866 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
867 "invalid parameter: BB_INPUT_TYPE" );
868 ++it;
869 set_BB_INPUT_TYPE ( k , bbit );
870 }
871
872 if ( *it != "]" && *it != ")" )
873 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
874 "invalid parameter: BB_INPUT_TYPE - error in vector form with () ot []" );
875 }
876
877 else
878 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
879 "invalid parameter: BB_INPUT_TYPE" );
880
881 pe->set_has_been_interpreted();
882 pe = pe->get_next();
883 }
884 }
885
886 /*------------------------------------------------*/
887 /* interpretation of the Parameter_Entry for x0 */
888 /* (private) */
889 /*------------------------------------------------*/
interpret_x0(const NOMAD::Parameter_Entries & entries)890 void NOMAD::Parameters::interpret_x0 ( const NOMAD::Parameter_Entries & entries )
891 {
892 NOMAD::Parameter_Entry * pe = entries.find ( "X0" );
893 std::list<std::string>::const_iterator it;
894 int i , j , k , l;
895 NOMAD::Double v;
896 NOMAD::Point tmp_x0;
897 std::vector<int> indexes;
898
899 while ( pe ) {
900
901 tmp_x0.reset ( _dimension );
902
903 // File name:
904 if ( pe->get_nb_values() == 1 )
905 set_X0 ( *pe->get_values().begin() );
906
907 // Vector form: all values on one row:
908 else if ( pe->get_nb_values() == _dimension + 2 ) {
909
910 it = pe->get_values().begin();
911
912 if ( *it != "[" && *it != "(" ) {
913
914 // particular case with n=1 and 3 entry values:
915 // example: X0 1 0 4.0 (first coordinate of the 2nd x0 point put to 4.0)
916 if ( _dimension == 1 ) {
917
918 it = pe->get_values().begin();
919
920 if ( !NOMAD::atoi ( *it , l ) )
921 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
922 "invalid parameter: X0" );
923
924 i = static_cast<int> ( indexes.size() );
925 if ( l > i )
926 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
927 "invalid parameter: X0" );
928 else if ( l == i ) {
929 l = static_cast<int> ( _x0s.size() );
930 indexes.push_back ( l );
931 set_X0 ( tmp_x0 );
932 }
933 else
934 l = indexes[l];
935
936 ++it;
937 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
938 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
939 "invalid parameter: X0" );
940
941 if ( i != 0 && j != 0 )
942 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
943 "invalid parameter: X0" );
944
945 ++it;
946 if ( !v.atof(*it) )
947 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
948 "invalid parameter: X0" );
949
950 (*_x0s[l])[0] = v;
951 }
952
953 else
954 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
955 "invalid parameter: X0 - error in vector form with () or []" );
956 }
957
958 else {
959
960 ++it;
961 for ( k = 0 ; k < _dimension ; ++k ) {
962 if ( !v.atof(*it) )
963 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
964 "invalid parameter: X0" );
965 ++it;
966 tmp_x0[k] = v;
967 }
968
969 if ( *it != "]" && *it != ")" )
970 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
971 "invalid parameter: X0 - error in vector form with () or []" );
972
973 set_X0 ( tmp_x0 );
974 }
975 }
976
977 // indexed values without x0 index (must be unique)
978 // (example: X0 0-5 1.0):
979 else if ( pe->get_nb_values() == 2 ) {
980
981 it = pe->get_values().begin();
982 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
983 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
984 ++it;
985 if ( !v.atof(*it) )
986 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
987
988 if ( indexes.empty() ) {
989 l = static_cast<int> ( _x0s.size() );
990 indexes.push_back ( l );
991 set_X0 ( tmp_x0 );
992 }
993 else
994 l = indexes[0];
995
996 for ( k = j ; k >= i ; --k )
997 (*_x0s[l])[k] = v;
998 }
999
1000 // indexed values with x0 index
1001 // example: X0 0 0-5 1.0 --> first x0 point
1002 // X0 1 0-5 2.0 --> 2nd x0 point
1003 else {
1004
1005 if ( pe->get_nb_values() != 3 )
1006 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
1007
1008 it = pe->get_values().begin();
1009
1010 if ( !NOMAD::atoi ( *it , l ) )
1011 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
1012
1013 i = static_cast<int> ( indexes.size() );
1014 if ( l > i )
1015 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
1016 else if ( l == i ) {
1017 l = static_cast<int> ( _x0s.size() );
1018 indexes.push_back ( l );
1019 set_X0 ( tmp_x0 );
1020 }
1021 else
1022 l = indexes[l];
1023
1024 ++it;
1025 if ( !NOMAD::string_to_index_range ( *it , i , j , &_dimension ) )
1026 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
1027
1028 ++it;
1029 if ( !v.atof(*it) )
1030 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: X0" );
1031
1032 for ( k = j ; k >= i ; --k )
1033 (*_x0s[l])[k] = v;
1034
1035 }
1036 pe->set_has_been_interpreted();
1037 pe = pe->get_next();
1038 }
1039 }
1040
1041 /*----------------------------------------*/
1042 /* read a parameters file */
1043 /*----------------------------------------*/
read(const std::string & param_file)1044 void NOMAD::Parameters::read ( const std::string & param_file )
1045 {
1046 // parameters will have to be checked:
1047 _to_be_checked = true;
1048
1049 // PROBLEM_DIR:
1050 // ------------
1051 _problem_dir.clear();
1052 size_t k = param_file.find_last_of ( NOMAD::DIR_SEP );
1053 if ( k < param_file.size() )
1054 _problem_dir = param_file.substr (0,k) + NOMAD::DIR_SEP;
1055 else
1056 _problem_dir = std::string(".") + NOMAD::DIR_SEP;
1057
1058 // open the parameters file:
1059 std::string err = "could not open parameters file \'" + param_file + "\'";
1060 std::ifstream fin;
1061 if ( NOMAD::check_read_file ( param_file ) ) {
1062 fin.open ( param_file.c_str() );
1063 if ( !fin.fail() )
1064 err.clear();
1065 }
1066 if ( !err.empty() ) {
1067 fin.close();
1068 throw NOMAD::Exception ( "Parameters.cpp" , __LINE__ , err );
1069 }
1070
1071 // the set of entries:
1072 NOMAD::Parameter_Entries entries;
1073
1074 // the file is read: fill the set 'entries' of Parameter_Entry:
1075 NOMAD::Parameter_Entry * pe;
1076 std::string s;
1077
1078 while ( fin.good() && !fin.eof() )
1079 {
1080
1081 s.clear();
1082
1083 getline ( fin , s );
1084
1085 if ( !fin.fail() && !s.empty() )
1086 {
1087 pe = new NOMAD::Parameter_Entry ( s );
1088 if ( pe->is_ok() )
1089 entries.insert ( pe ); // pe will be deleted by ~Parameter_Entries()
1090 else
1091 {
1092 if ( ( pe->get_name() != "" && pe->get_nb_values() == 0 ) ||
1093 pe->get_name() == "STATS_FILE" )
1094 {
1095 err = "invalid parameter: " + pe->get_name();
1096 delete pe;
1097 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
1098 }
1099 delete pe;
1100 }
1101 }
1102 }
1103
1104 // the file is closed:
1105 fin.close();
1106
1107 // entries display:
1108 #ifdef DEBUG
1109 if ( NOMAD::Slave::is_master() )
1110 _out << std::endl
1111 << NOMAD::open_block ( "parsing of \'" + param_file + "\'" )
1112 << entries
1113 << NOMAD::close_block();
1114 #endif
1115
1116 read(entries);
1117 }
1118
1119 /*----------------------------------------*/
1120 /* read a parameters file */
1121 /*----------------------------------------*/
read(const NOMAD::Parameter_Entries & entries)1122 void NOMAD::Parameters::read ( const NOMAD::Parameter_Entries & entries )
1123 {
1124
1125 // interpret and set the entries using SET methods:
1126 std::list<std::string>::const_iterator it , end;
1127 int i , j , m;
1128 NOMAD::Double d;
1129 NOMAD::Parameter_Entry * pe;
1130 std::string s;
1131 std::string err ;
1132
1133 /*----------------------------------------------*/
1134
1135 // EPSILON:
1136 // --------
1137 {
1138 pe = entries.find ( "EPSILON" );
1139 if ( pe )
1140 {
1141 if ( !pe->is_unique() )
1142 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1143 "invalid parameter: EPSILON not unique" );
1144 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
1145 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1146 "invalid parameter: EPSILON" );
1147 set_EPSILON (d);
1148 pe->set_has_been_interpreted();
1149 }
1150 }
1151
1152 // UNDEF_STR:
1153 // ----------
1154 pe = entries.find ( "UNDEF_STR" );
1155 if ( pe )
1156 {
1157 if ( !pe->is_unique() )
1158 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1159 "invalid parameter: UNDEF_STR not unique" );
1160 set_UNDEF_STR ( *(pe->get_values().begin()) );
1161 pe->set_has_been_interpreted();
1162 }
1163
1164 // INF_STR:
1165 // --------
1166 pe = entries.find ( "INF_STR" );
1167 if ( pe )
1168 {
1169 if ( !pe->is_unique() )
1170 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1171 "invalid parameter: INF_STR not unique" );
1172 set_INF_STR ( *(pe->get_values().begin()) );
1173 pe->set_has_been_interpreted();
1174 }
1175
1176 // ANISOTROPIC_MESH
1177 //-------------------
1178 {
1179 pe = entries.find ( "ANISOTROPIC_MESH" );
1180 if ( pe )
1181 {
1182 if ( !pe->is_unique() )
1183 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1184 "invalid parameter: ANISOTROPIC_MESH not unique" );
1185
1186 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1187 if ( pe->get_nb_values() != 1 || i == -1 )
1188 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1189 "invalid parameter: ANISOTROPIC_MESH" );
1190 set_ANISOTROPIC_MESH ( i == 1 );
1191 pe->set_has_been_interpreted();
1192
1193 }
1194 }
1195
1196 // POLL_UPDATE_BASIS:
1197 // ------------------
1198 {
1199 pe = entries.find ( "POLL_UPDATE_BASIS" );
1200 if ( pe )
1201 {
1202 if ( !pe->is_unique() )
1203 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1204 "invalid parameter: POLL_UPDATE_BASIS not unique" );
1205 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
1206 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1207 "invalid parameter: POLL_UPDATE_BASIS" );
1208 set_POLL_UPDATE_BASIS (d);
1209 pe->set_has_been_interpreted();
1210 }
1211 }
1212
1213
1214
1215 // MESH_UPDATE_BASIS:
1216 // ------------------
1217 {
1218 pe = entries.find ( "MESH_UPDATE_BASIS" );
1219 if ( pe )
1220 {
1221 if ( !pe->is_unique() )
1222 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1223 "invalid parameter: MESH_UPDATE_BASIS not unique" );
1224 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
1225 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1226 "invalid parameter: MESH_UPDATE_BASIS" );
1227 set_MESH_UPDATE_BASIS (d);
1228 pe->set_has_been_interpreted();
1229 }
1230 }
1231
1232 // INITIAL_MESH_INDEX:
1233 // -------------------
1234 {
1235 pe = entries.find ( "INITIAL_MESH_INDEX" );
1236 if ( pe )
1237 {
1238 if ( !pe->is_unique() )
1239 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1240 "invalid parameter: INITIAL_MESH_INDEX not unique" );
1241 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1242 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1243 "invalid parameter: INITIAL_MESH_INDEX" );
1244 pe->set_has_been_interpreted();
1245 set_INITIAL_MESH_INDEX (i);
1246 }
1247 }
1248
1249 // MESH_REFINING_EXPONENT:
1250 // -----------------------
1251 {
1252 pe = entries.find ( "MESH_REFINING_EXPONENT" );
1253 if ( pe )
1254 {
1255 if ( !pe->is_unique() )
1256 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1257 "invalid parameter: MESH_REFINING_EXPONENT not unique" );
1258 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1259 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1260 "invalid parameter: MESH_REFINING_EXPONENT" );
1261 pe->set_has_been_interpreted();
1262 set_MESH_REFINING_EXPONENT (i);
1263 }
1264 }
1265
1266 // MESH_COARSENING_EXPONENT:
1267 // -------------------------
1268 {
1269 pe = entries.find ( "MESH_COARSENING_EXPONENT" );
1270 if ( pe )
1271 {
1272 if ( !pe->is_unique() )
1273 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1274 "invalid parameter: MESH_COARSENING_EXPONENT not unique" );
1275 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1276 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1277 "invalid parameter: MESH_COARSENING_EXPONENT" );
1278 pe->set_has_been_interpreted();
1279 set_MESH_COARSENING_EXPONENT (i);
1280 }
1281 }
1282
1283 // USE_SMESH:
1284 // ---------------
1285 {
1286 pe = entries.find ( "USE_SMESH" );
1287 if ( pe )
1288 {
1289 if ( !pe->is_unique() )
1290 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1291 "invalid parameter: USE_SMESH not unique" );
1292 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1293 if ( pe->get_nb_values() != 1 || i == -1 )
1294 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1295 "invalid parameter: USE_SMESH" );
1296 set_USE_SMESH ( i == 1 );
1297 pe->set_has_been_interpreted();
1298 }
1299 }
1300
1301
1302 // POINT_DISPLAY_LIMIT:
1303 // --------------------
1304 {
1305 pe = entries.find ( "POINT_DISPLAY_LIMIT" );
1306 if ( pe ) {
1307 if ( !pe->is_unique() )
1308 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1309 "invalid parameter: POINT_DISPLAY_LIMIT not unique" );
1310 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1311 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1312 "invalid parameter: POINT_DISPLAY_LIMIT" );
1313 set_POINT_DISPLAY_LIMIT (i);
1314 pe->set_has_been_interpreted();
1315 }
1316 }
1317
1318 // DIMENSION:
1319 // ----------
1320 {
1321 pe = entries.find ( "DIMENSION" );
1322
1323 if ( !pe ) {
1324 if ( !pe && _dimension <= 0 )
1325 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1326 "invalid parameter: DIMENSION not defined" );
1327 }
1328 else {
1329 if ( !pe->is_unique() )
1330 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1331 "invalid parameter: DIMENSION not unique" );
1332
1333 int dim;
1334 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), dim) )
1335 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1336 "invalid parameter: DIMENSION" );
1337
1338 pe->set_has_been_interpreted();
1339
1340 set_DIMENSION ( dim );
1341 }
1342 }
1343
1344 // SNAP_TO_BOUNDS:
1345 // ---------------
1346 {
1347 pe = entries.find ( "SNAP_TO_BOUNDS" );
1348 if ( pe ) {
1349 if ( !pe->is_unique() )
1350 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1351 "invalid parameter: SNAP_TO_BOUNDS not unique" );
1352 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1353 if ( pe->get_nb_values() != 1 || i == -1 )
1354 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1355 "invalid parameter: SNAP_TO_BOUNDS" );
1356 set_SNAP_TO_BOUNDS ( i == 1 );
1357 pe->set_has_been_interpreted();
1358 }
1359 }
1360
1361 // MULTI-MADS:
1362 // -----------
1363 {
1364 // MULTI_OVERALL_BB_EVAL:
1365 pe = entries.find ( "MULTI_OVERALL_BB_EVAL" );
1366 if ( pe ) {
1367 if ( !pe->is_unique() )
1368 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1369 "invalid parameter: MULTI_OVERALL_BB_EVAL not unique" );
1370 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
1371 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1372 "invalid parameter: MULTI_OVERALL_BB_EVAL" );
1373 pe->set_has_been_interpreted();
1374 set_MULTI_OVERALL_BB_EVAL (i);
1375 }
1376
1377 // MULTI_NB_MADS_RUNS:
1378 pe = entries.find ( "MULTI_NB_MADS_RUNS" );
1379 if ( pe ) {
1380 if ( !pe->is_unique() )
1381 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1382 "invalid parameter: MULTI_NB_MADS_RUNS not unique" );
1383 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
1384 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1385 "invalid parameter: MULTI_NB_MADS_RUNS" );
1386 pe->set_has_been_interpreted();
1387 set_MULTI_NB_MADS_RUNS (i);
1388 }
1389
1390 // MULTI_USE_DELTA_CRIT:
1391 pe = entries.find ( "MULTI_USE_DELTA_CRIT" );
1392 if ( pe ) {
1393 if ( !pe->is_unique() )
1394 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1395 "invalid parameter: MULTI_USE_DELTA_CRIT not unique" );
1396 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1397 if ( pe->get_nb_values() != 1 || i == -1 )
1398 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1399 "invalid parameter: MULTI_USE_DELTA_CRIT" );
1400 pe->set_has_been_interpreted();
1401 set_MULTI_USE_DELTA_CRIT ( i == 1 );
1402 }
1403
1404 // MULTI_F_BOUNDS (f1_min, f2_min, f2_min, f2_max):
1405 pe = entries.find ( "MULTI_F_BOUNDS" );
1406 if ( pe ) {
1407 if ( !pe->is_unique() )
1408 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1409 "invalid parameter: MULTI_F_BOUNDS not unique" );
1410 if ( pe->get_nb_values() != 4 )
1411 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1412 "invalid parameter: MULTI_F_BOUNDS" );
1413 NOMAD::Point mfb ( 4 );
1414 it = pe->get_values().begin();
1415 for ( i = 0 ; i < 4 ; ++i ) {
1416 if ( !d.atof ( *it ) )
1417 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1418 "invalid parameter: MULTI_F_BOUNDS" );
1419 mfb[i] = d;
1420 ++it;
1421 }
1422 pe->set_has_been_interpreted();
1423 set_MULTI_F_BOUNDS ( mfb );
1424 }
1425
1426 // MULTI_FORMULATION:
1427 // ------------------
1428 {
1429 pe = entries.find ( "MULTI_FORMULATION" );
1430 if ( pe ) {
1431 if ( !pe->is_unique() )
1432 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1433 "invalid parameter: MULTI_FORMULATION not unique" );
1434 NOMAD::multi_formulation_type mft;
1435 if ( pe->get_nb_values() != 1 ||
1436 !NOMAD::string_to_multi_formulation_type
1437 ( *(pe->get_values().begin()) , mft ) )
1438 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1439 "Invalid parameter: MULTI_FORMULATION_TYPE" );
1440 pe->set_has_been_interpreted();
1441 set_MULTI_FORMULATION ( mft );
1442 }
1443 }
1444 }
1445
1446 // Models
1447 // --------------
1448 {
1449
1450
1451 // Disable models when explicitely requested
1452 pe = entries.find ( "DISABLE" );
1453 while ( pe )
1454 {
1455
1456 if ( pe->get_nb_values() != 1 )
1457 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1458 "invalid parameter: DISABLE" );
1459
1460 std::string smt = *(pe->get_values().begin());
1461 NOMAD::toupper(smt);
1462 if ( smt == "MODELS" )
1463 set_DISABLE_MODELS();
1464 else if ( smt == "EVAL_SORT" )
1465 set_DISABLE_EVAL_SORT();
1466 else
1467 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1468 "Invalid parameter: DISABLE MODELS. Only MODELS argument is accepted!" );
1469
1470
1471 pe->set_has_been_interpreted();
1472 pe = pe->get_next();
1473 }
1474
1475
1476
1477 // MODEL_SEARCH (can be entered one time or twice):
1478 int i_model_search = 1;
1479 bool b_model_search = false;
1480 pe = entries.find ( "MODEL_SEARCH" );
1481
1482 while ( pe ) {
1483
1484 if ( pe->get_nb_values() != 1 )
1485 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1486 "invalid parameter: MODEL_SEARCH" );
1487 if ( i_model_search == 3 )
1488 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1489 "invalid parameter: MODEL_SEARCH (cannot be entered more than twice" );
1490
1491 NOMAD::model_type mt;
1492 std::string smt = *(pe->get_values().begin());
1493 int imt = NOMAD::string_to_bool ( smt );
1494
1495 // entered as a boolean:
1496 if ( imt == 0 || imt == 1 ) {
1497 if ( b_model_search || i_model_search == 2 )
1498 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1499 "invalid parameter: MODEL_SEARCH (boolean argument can only be used once)" );
1500 b_model_search = true;
1501 set_MODEL_SEARCH ( imt == 1 );
1502 }
1503
1504 // entered as a model type:
1505 else {
1506
1507 if ( !NOMAD::string_to_model_type ( smt , mt ) )
1508 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1509 "invalid parameter: MODEL_SEARCH" );
1510
1511 set_MODEL_SEARCH ( i_model_search , mt );
1512 }
1513
1514 pe->set_has_been_interpreted();
1515 pe = pe->get_next();
1516 ++i_model_search;
1517 }
1518
1519 // MODEL_SEARCH_OPTIMISTIC:
1520 {
1521 pe = entries.find ( "MODEL_SEARCH_OPTIMISTIC" );
1522 if ( pe ) {
1523 if ( !pe->is_unique() )
1524 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1525 "invalid parameter: MODEL_SEARCH_OPTIMISTIC not unique" );
1526 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1527 if ( pe->get_nb_values() != 1 || i == -1 )
1528 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1529 "invalid parameter: MODEL_SEARCH_OPTIMISTIC" );
1530 set_MODEL_SEARCH_OPTIMISTIC ( i == 1 );
1531 pe->set_has_been_interpreted();
1532 }
1533 }
1534
1535 // MODEL_SEARCH_PROJ_TO_MESH:
1536 {
1537 pe = entries.find ( "MODEL_SEARCH_PROJ_TO_MESH" );
1538 if ( pe ) {
1539 if ( !pe->is_unique() )
1540 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1541 "invalid parameter: MODEL_SEARCH_PROJ_TO_MESH not unique" );
1542 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1543 if ( pe->get_nb_values() != 1 || i == -1 )
1544 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1545 "invalid parameter: MODEL_SEARCH_PROJ_TO_MESH" );
1546 set_MODEL_SEARCH_PROJ_TO_MESH ( i == 1 );
1547 pe->set_has_been_interpreted();
1548 }
1549 }
1550
1551 // MODEL_QUAD_RADIUS_FACTOR:
1552 {
1553 pe = entries.find ( "MODEL_QUAD_RADIUS_FACTOR" );
1554 if ( pe ) {
1555 if ( !pe->is_unique() )
1556 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1557 "invalid parameter: MODEL_QUAD_RADIUS_FACTOR not unique" );
1558 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
1559 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1560 "invalid parameter: MODEL_QUAD_RADIUS_FACTOR" );
1561 pe->set_has_been_interpreted();
1562 set_MODEL_QUAD_RADIUS_FACTOR ( d );
1563 }
1564 }
1565
1566 // MODEL_QUAD_USE_WP:
1567 {
1568 pe = entries.find ( "MODEL_QUAD_USE_WP" );
1569 if ( pe ) {
1570 if ( !pe->is_unique() )
1571 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1572 "invalid parameter: MODEL_QUAD_USE_WP not unique" );
1573 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1574 if ( pe->get_nb_values() != 1 || i == -1 )
1575 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1576 "invalid parameter: MODEL_QUAD_USE_WP" );
1577 set_MODEL_QUAD_USE_WP ( i == 1 );
1578 pe->set_has_been_interpreted();
1579 }
1580 }
1581
1582 // MODEL_QUAD_MAX_Y_SIZE:
1583 {
1584 pe = entries.find ( "MODEL_QUAD_MAX_Y_SIZE" );
1585 if ( pe ) {
1586 if ( !pe->is_unique() )
1587 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1588 "invalid parameter: MODEL_QUAD_MAX_Y_SIZE not unique" );
1589 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1590 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1591 "invalid parameter: MODEL_QUAD_MAX_Y_SIZE" );
1592 pe->set_has_been_interpreted();
1593 set_MODEL_QUAD_MAX_Y_SIZE (i);
1594 }
1595 }
1596
1597 // MODEL_QUAD_MIN_Y_SIZE:
1598 {
1599 pe = entries.find ( "MODEL_QUAD_MIN_Y_SIZE" );
1600 if ( pe ) {
1601
1602 if ( !pe->is_unique() )
1603 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1604 "invalid parameter: MODEL_QUAD_MIN_Y_SIZE not unique" );
1605
1606 if ( pe->get_nb_values() != 1 )
1607 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1608 "invalid parameter: MODEL_QUAD_MIN_Y_SIZE" );
1609
1610 s = *(pe->get_values().begin());
1611 NOMAD::toupper(s);
1612
1613 if ( s == "N+1" )
1614 i = -1;
1615 else if ( !NOMAD::atoi ( s , i ) )
1616 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1617 "invalid parameter: MODEL_QUAD_MIN_Y_SIZE" );
1618
1619 pe->set_has_been_interpreted();
1620 set_MODEL_QUAD_MIN_Y_SIZE (i);
1621 }
1622 }
1623
1624
1625 // MODEL_QUAD_HYPERCUBE_LOWER_LIM:
1626 {
1627 pe = entries.find ( "MODEL_NP1_QUAD_EPSILON" );
1628 if ( pe ) {
1629
1630 if ( !pe->is_unique() )
1631 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1632 "invalid parameter: MODEL_NP1_QUAD_EPSILON not unique" );
1633
1634 if ( pe->get_nb_values() != 1 )
1635 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1636 "invalid parameter: MODEL_NP1_QUAD_EPSILON" );
1637
1638 s = *(pe->get_values().begin());
1639 NOMAD::toupper(s);
1640 NOMAD::Double d;
1641 if ( !d.atof ( s) )
1642 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1643 "invalid parameter: MODEL_NP1_QUAD_EPSILON" );
1644
1645 pe->set_has_been_interpreted();
1646 set_MODEL_NP1_QUAD_EPSILON (d);
1647 }
1648 }
1649
1650 // MODEL_TGP_MODE:
1651 {
1652 pe = entries.find ( "MODEL_TGP_MODE" );
1653 if ( pe ) {
1654 if ( !pe->is_unique() )
1655 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1656 "invalid parameter: MODEL_TGP_MODE not unique" );
1657
1658 NOMAD::TGP_mode_type m;
1659 if ( pe->get_nb_values() != 1 ||
1660 !NOMAD::string_to_TGP_mode_type ( *(pe->get_values().begin()) , m ) )
1661 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1662 "Invalid parameter: MODEL_TGP_MODE" );
1663 pe->set_has_been_interpreted();
1664 set_MODEL_TGP_MODE ( m );
1665 }
1666 }
1667
1668 // MODEL_TGP_REUSE_MODEL:
1669 {
1670 pe = entries.find ( "MODEL_TGP_REUSE_MODEL" );
1671 if ( pe ) {
1672 if ( !pe->is_unique() )
1673 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1674 "invalid parameter: MODEL_TGP_REUSE_MODEL not unique" );
1675 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1676 if ( pe->get_nb_values() != 1 || i == -1 )
1677 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1678 "invalid parameter: MODEL_TGP_REUSE_MODEL" );
1679 set_MODEL_TGP_REUSE_MODEL ( i == 1 );
1680 pe->set_has_been_interpreted();
1681 }
1682 }
1683
1684 // MODEL_SEARCH_MAX_TRIAL_PTS:
1685 {
1686 pe = entries.find ( "MODEL_SEARCH_MAX_TRIAL_PTS" );
1687 if ( pe ) {
1688 if ( !pe->is_unique() )
1689 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1690 "invalid parameter: MODEL_SEARCH_MAX_TRIAL_PTS not unique" );
1691 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
1692 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1693 "invalid parameter: MODEL_SEARCH_MAX_TRIAL_PTS" );
1694 pe->set_has_been_interpreted();
1695 set_MODEL_SEARCH_MAX_TRIAL_PTS (i);
1696 }
1697 }
1698
1699 // MODEL_EVAL_SORT:
1700 {
1701 pe = entries.find ( "MODEL_EVAL_SORT" );
1702 if ( pe ) {
1703 if ( !pe->is_unique() )
1704 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1705 "invalid parameter: MODEL_EVAL_SORT not unique" );
1706 if ( pe->get_nb_values() != 1 )
1707 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1708 "invalid parameter: MODEL_EVAL_SORT" );
1709
1710 NOMAD::model_type mt;
1711 std::string smt = *(pe->get_values().begin());
1712 int imt = NOMAD::string_to_bool ( smt );
1713
1714 // entered as a boolean:
1715 if ( imt == 0 || imt == 1 )
1716 set_MODEL_EVAL_SORT ( imt == 1 );
1717
1718 // entered as a model type:
1719 else {
1720
1721 if ( !NOMAD::string_to_model_type ( smt , mt ) )
1722 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1723 "invalid parameter: MODEL_EVAL_SORT" );
1724 set_MODEL_EVAL_SORT ( mt );
1725 }
1726
1727 pe->set_has_been_interpreted();
1728 }
1729 }
1730
1731 // MODEL_EVAL_SORT_CAUTIOUS:
1732 {
1733 pe = entries.find ( "MODEL_EVAL_SORT_CAUTIOUS" );
1734 if ( pe ) {
1735 if ( !pe->is_unique() )
1736 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1737 "invalid parameter: MODEL_EVAL_SORT_CAUTIOUS not unique" );
1738 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1739 if ( pe->get_nb_values() != 1 || i == -1 )
1740 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1741 "invalid parameter: MODEL_EVAL_SORT_CAUTIOUS" );
1742 set_MODEL_EVAL_SORT_CAUTIOUS ( i == 1 );
1743 pe->set_has_been_interpreted();
1744 }
1745 }
1746 }
1747
1748 // SPECULATIVE_SEARCH:
1749 // -------------------
1750 {
1751 pe = entries.find ( "SPECULATIVE_SEARCH" );
1752 if ( pe ) {
1753 if ( !pe->is_unique() )
1754 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1755 "invalid parameter: SPECULATIVE_SEARCH not unique" );
1756 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1757 if ( pe->get_nb_values() != 1 || i == -1 )
1758 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1759 "invalid parameter: SPECULATIVE_SEARCH" );
1760 set_SPECULATIVE_SEARCH ( i == 1 );
1761 pe->set_has_been_interpreted();
1762 }
1763 }
1764
1765 // VNS_SEARCH:
1766 // -----------
1767 {
1768 pe = entries.find ( "VNS_SEARCH" );
1769 if ( pe ) {
1770 if ( !pe->is_unique() )
1771 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1772 "invalid parameter: VNS_SEARCH not unique" );
1773 if ( pe->get_nb_values() != 1 )
1774 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1775 "invalid parameter: VNS_SEARCH" );
1776
1777 s = *(pe->get_values().begin());
1778 i = NOMAD::string_to_bool ( s );
1779
1780 // entered as a real:
1781 if ( i == -1 || s == "1" ) {
1782 if ( !d.atof ( s ) )
1783 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1784 "invalid parameter: VNS_SEARCH" );
1785 set_VNS_SEARCH ( d );
1786 }
1787 // entered as a boolean:
1788 else
1789 set_VNS_SEARCH ( i == 1 );
1790
1791 pe->set_has_been_interpreted();
1792 }
1793 }
1794
1795 // CACHE_SEARCH:
1796 // -------------
1797 {
1798 pe = entries.find ( "CACHE_SEARCH" );
1799 if ( pe ) {
1800 if ( !pe->is_unique() )
1801 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1802 "invalid parameter: CACHE_SEARCH not unique" );
1803 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1804 if ( pe->get_nb_values() != 1 || i == -1 )
1805 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1806 "invalid parameter: CACHE_SEARCH" );
1807 set_CACHE_SEARCH ( i == 1 );
1808 pe->set_has_been_interpreted();
1809 }
1810 }
1811
1812 // LH_SEARCH:
1813 // ----------
1814 {
1815 pe = entries.find ( "LH_SEARCH" );
1816 if ( pe ) {
1817 if ( !pe->is_unique() )
1818 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1819 "invalid parameter: LH_SEARCH not unique" );
1820 if ( pe->get_nb_values() != 2 )
1821 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1822 "invalid parameter: LH_SEARCH" );
1823 it = pe->get_values().begin();
1824
1825 if ( !NOMAD::atoi (*it++ , i) || i < 0 )
1826 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1827 "invalid parameter: LH_SEARCH" );
1828
1829 if ( !NOMAD::atoi (*it , j) || j < 0 )
1830 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1831 "invalid parameter: LH_SEARCH" );
1832
1833 set_LH_SEARCH ( i , j );
1834 pe->set_has_been_interpreted();
1835 }
1836
1837 // OPPORTUNISTIC_LH:
1838 // -----------------
1839 {
1840 pe = entries.find ( "OPPORTUNISTIC_LH" );
1841 if ( pe ) {
1842 if ( !pe->is_unique() )
1843 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1844 "invalid parameter: OPPORTUNISTIC_LH not unique" );
1845 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1846 if ( pe->get_nb_values() != 1 || i == -1 )
1847 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1848 "invalid parameter: OPPORTUNISTIC_LH" );
1849 set_OPPORTUNISTIC_LH ( i == 1 );
1850 pe->set_has_been_interpreted();
1851 }
1852 }
1853 }
1854
1855 // OPPORTUNISTIC_CACHE_SEARCH:
1856 // ---------------------------
1857 {
1858 pe = entries.find ( "OPPORTUNISTIC_CACHE_SEARCH" );
1859 if ( pe ) {
1860 if ( !pe->is_unique() )
1861 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1862 "invalid parameter: OPPORTUNISTIC_CACHE_SEARCH not unique" );
1863 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1864 if ( pe->get_nb_values() != 1 || i == -1 )
1865 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1866 "invalid parameter: OPPORTUNISTIC_CACHE_SEARCH" );
1867 set_OPPORTUNISTIC_CACHE_SEARCH ( i == 1 );
1868 pe->set_has_been_interpreted();
1869 }
1870 }
1871
1872 // opportunistic strategy:
1873 // -----------------------
1874 {
1875
1876 // BB_MAX_BLOCK_SIZE
1877 pe = entries.find ( "BB_MAX_BLOCK_SIZE" );
1878 if ( pe ) {
1879 if ( !pe->is_unique() )
1880 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1881 "invalid parameter: BB_MAX_BLOCK_SIZE not unique" );
1882
1883 it = pe->get_values().begin();
1884
1885 if ( !NOMAD::atoi (*it++ , i) || i <= 0 )
1886 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1887 "invalid parameter: BB_MAX_BLOCK_SIZE" );
1888 set_BB_MAX_BLOCK_SIZE (i);
1889
1890 pe->set_has_been_interpreted();
1891 }
1892
1893
1894 // OPPORTUNISTIC_EVAL:
1895 pe = entries.find ( "OPPORTUNISTIC_EVAL" );
1896 if ( pe ) {
1897 if ( !pe->is_unique() )
1898 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1899 "invalid parameter: OPPORTUNISTIC_EVAL not unique" );
1900 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1901 if ( pe->get_nb_values() != 1 || i == -1 )
1902 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1903 "invalid parameter: OPPORTUNISTIC_EVAL" );
1904 set_OPPORTUNISTIC_EVAL ( i == 1 );
1905 pe->set_has_been_interpreted();
1906 }
1907
1908 // OPPORTUNISTIC_MIN_NB_SUCCESS:
1909 pe = entries.find ( "OPPORTUNISTIC_MIN_NB_SUCCESS" );
1910 if ( pe ) {
1911 if ( !pe->is_unique() )
1912 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1913 "invalid parameter: OPPORTUNISTIC_MIN_NB_SUCCESS not unique" );
1914 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
1915 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1916 "invalid parameter: OPPORTUNISTIC_MIN_NB_SUCCESS" );
1917 pe->set_has_been_interpreted();
1918 set_OPPORTUNISTIC_MIN_NB_SUCCESS (i);
1919 }
1920
1921 // OPPORTUNISTIC_MIN_EVAL:
1922 pe = entries.find ( "OPPORTUNISTIC_MIN_EVAL" );
1923 if ( pe ) {
1924 if ( !pe->is_unique() )
1925 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1926 "invalid parameter: OPPORTUNISTIC_MIN_EVAL not unique" );
1927 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
1928 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1929 "invalid parameter: OPPORTUNISTIC_MIN_EVAL" );
1930 pe->set_has_been_interpreted();
1931 set_OPPORTUNISTIC_MIN_EVAL (i);
1932 }
1933
1934 // OPPORTUNISTIC_MIN_F_IMPRVMT:
1935 pe = entries.find ( "OPPORTUNISTIC_MIN_F_IMPRVMT" );
1936 if ( pe ) {
1937 if ( !pe->is_unique() )
1938 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1939 "invalid parameter: OPPORTUNISTIC_MIN_F_IMPRVMT not unique" );
1940 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
1941 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1942 "invalid parameter: OPPORTUNISTIC_MIN_F_IMPRVMT" );
1943 pe->set_has_been_interpreted();
1944 set_OPPORTUNISTIC_MIN_F_IMPRVMT ( d );
1945 }
1946
1947 // OPPORTUNISTIC_LUCKY_EVAL:
1948 pe = entries.find ( "OPPORTUNISTIC_LUCKY_EVAL" );
1949 if ( pe ) {
1950 if ( !pe->is_unique() )
1951 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1952 "invalid parameter: OPPORTUNISTIC_LUCKY_EVAL not unique" );
1953 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
1954 if ( pe->get_nb_values() != 1 || i == -1 )
1955 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1956 "invalid parameter: OPPORTUNISTIC_LUCKY_EVAL" );
1957 set_OPPORTUNISTIC_LUCKY_EVAL ( i == 1 );
1958 pe->set_has_been_interpreted();
1959 }
1960 }
1961
1962 // Directions (DIRECTION_TYPE and SEC_POLL_DIR_TYPE):
1963 // --------------------------------------------------
1964 {
1965 NOMAD::direction_type dt;
1966
1967
1968 pe = entries.find ( "DIRECTION_TYPE" );
1969 while ( pe ) {
1970
1971 if ( !NOMAD::strings_to_direction_type ( pe->get_values() , dt ) )
1972 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1973 "invalid parameter: DIRECTION_TYPE" );
1974 set_DIRECTION_TYPE ( dt );
1975
1976
1977 pe->set_has_been_interpreted();
1978 pe = pe->get_next();
1979 }
1980
1981 pe = entries.find ( "SEC_POLL_DIR_TYPE" );
1982 while ( pe ) {
1983 if ( !NOMAD::strings_to_direction_type ( pe->get_values() , dt ) )
1984 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
1985 "invalid parameter: SEC_POLL_DIR_TYPE" );
1986 set_SEC_POLL_DIR_TYPE ( dt );
1987
1988 pe->set_has_been_interpreted();
1989 pe = pe->get_next();
1990 }
1991 }
1992
1993
1994 // MAX_ITERATIONS:
1995 // ---------------
1996 {
1997 pe = entries.find ( "MAX_ITERATIONS" );
1998 if ( pe ) {
1999 if ( !pe->is_unique() )
2000 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2001 "invalid parameter: MAX_ITERATIONS not unique" );
2002 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2003 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2004 "invalid parameter: MAX_ITERATIONS" );
2005 pe->set_has_been_interpreted();
2006 set_MAX_ITERATIONS (i);
2007 }
2008 }
2009
2010 // MAX_CONSECUTIVE_FAILED_ITERATIONS:
2011 // ----------------------------------
2012 {
2013 pe = entries.find ( "MAX_CONSECUTIVE_FAILED_ITERATIONS" );
2014 if ( pe ) {
2015 if ( !pe->is_unique() )
2016 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2017 "invalid parameter: MAX_CONSECUTIVE_FAILED_ITERATIONS not unique" );
2018 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2019 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2020 "invalid parameter: MAX_CONSECUTIVE_FAILED_ITERATIONS" );
2021 pe->set_has_been_interpreted();
2022 set_MAX_CONSECUTIVE_FAILED_ITERATIONS (static_cast<int>(d.value()));
2023 }
2024 }
2025
2026 // MAX_CACHE_MEMORY:
2027 // -----------------
2028 {
2029 pe = entries.find ( "MAX_CACHE_MEMORY" );
2030 if ( pe ) {
2031 if ( !pe->is_unique() )
2032 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2033 "invalid parameter: MAX_CACHE_MEMORY not unique" );
2034 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2035 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2036 "invalid parameter: MAX_CACHE_MEMORY" );
2037 pe->set_has_been_interpreted();
2038 set_MAX_CACHE_MEMORY (static_cast<float>(d.value()));
2039 }
2040 }
2041
2042 // MAX_EVAL:
2043 // ---------
2044 {
2045 pe = entries.find ( "MAX_EVAL" );
2046 if ( pe ) {
2047 if ( !pe->is_unique() )
2048 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2049 "invalid parameter: MAX_EVAL not unique" );
2050 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2051 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2052 "invalid parameter: MAX_EVAL" );
2053 pe->set_has_been_interpreted();
2054 set_MAX_EVAL (i);
2055 }
2056 }
2057
2058 // MAX_BB_EVAL:
2059 // ------------
2060 {
2061 pe = entries.find ( "MAX_BB_EVAL" );
2062 if ( pe ) {
2063 if ( !pe->is_unique() )
2064 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2065 "invalid parameter: MAX_BB_EVAL not unique" );
2066 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2067 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2068 "invalid parameter: MAX_BB_EVAL" );
2069 pe->set_has_been_interpreted();
2070 set_MAX_BB_EVAL (i);
2071 }
2072 }
2073
2074 // MAX_SIM_BB_EVAL:
2075 // ----------------
2076 {
2077 pe = entries.find ( "MAX_SIM_BB_EVAL" );
2078 if ( pe ) {
2079 if ( !pe->is_unique() )
2080 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2081 "invalid parameter: MAX_SIM_BB_EVAL not unique" );
2082 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2083 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2084 "invalid parameter: MAX_SIM_BB_EVAL" );
2085 pe->set_has_been_interpreted();
2086 set_MAX_SIM_BB_EVAL (i);
2087 }
2088 }
2089
2090 // MAX_SGTE_EVAL:
2091 // --------------
2092 {
2093 pe = entries.find ( "MAX_SGTE_EVAL" );
2094 if ( pe ) {
2095 if ( !pe->is_unique() )
2096 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2097 "invalid parameter: MAX_SGTE_EVAL not unique" );
2098 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
2099 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2100 "invalid parameter: MAX_SGTE_EVAL" );
2101 pe->set_has_been_interpreted();
2102 set_MAX_SGTE_EVAL (i);
2103 }
2104 }
2105
2106 // MAX_TIME:
2107 // ---------
2108 {
2109 pe = entries.find ( "MAX_TIME" );
2110 if ( pe ) {
2111 if ( !pe->is_unique() )
2112 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2113 "invalid parameter: MAX_TIME not unique" );
2114 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()), i) )
2115 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2116 "invalid parameter: MAX_TIME" );
2117
2118 pe->set_has_been_interpreted();
2119 set_MAX_TIME (i);
2120 }
2121 }
2122
2123 // STAT_SUM_TARGET:
2124 // ----------------
2125 {
2126 pe = entries.find ( "STAT_SUM_TARGET" );
2127 if ( pe ) {
2128 if ( !pe->is_unique() )
2129 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2130 "invalid parameter: STAT_SUM_TARGET not unique" );
2131 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2132 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2133 "invalid parameter: STAT_SUM_TARGET" );
2134 pe->set_has_been_interpreted();
2135 set_STAT_SUM_TARGET ( d );
2136 }
2137 }
2138
2139 // L_CURVE_TARGET:
2140 // ---------------
2141 {
2142 pe = entries.find ( "L_CURVE_TARGET" );
2143 if ( pe ) {
2144 if ( !pe->is_unique() )
2145 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2146 "invalid parameter: L_CURVE_TARGET not unique" );
2147 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2148 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2149 "invalid parameter: L_CURVE_TARGET" );
2150 pe->set_has_been_interpreted();
2151 set_L_CURVE_TARGET ( d );
2152 }
2153 }
2154
2155 // EXTENDED_POLL_TRIGGER:
2156 // ----------------------
2157 {
2158 pe = entries.find ( "EXTENDED_POLL_TRIGGER" );
2159 if ( pe ) {
2160 if ( !pe->is_unique() )
2161 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2162 "invalid parameter: EXTENDED_POLL_TRIGGER not unique" );
2163
2164 bool rel;
2165
2166 if ( pe->get_nb_values() != 1 ||
2167 !d.relative_atof ( *(pe->get_values().begin()) , rel ) )
2168 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2169 "invalid parameter: EXTENDED_POLL_TRIGGER" );
2170
2171 pe->set_has_been_interpreted();
2172 set_EXTENDED_POLL_TRIGGER ( d , rel );
2173 }
2174 }
2175
2176 // EXTENDED_POLL_ENABLED:
2177 // ----------------------
2178 {
2179 pe = entries.find ( "EXTENDED_POLL_ENABLED" );
2180 if ( pe ) {
2181 if ( !pe->is_unique() )
2182 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2183 "invalid parameter: EXTENDED_POLL_ENABLED not unique" );
2184 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2185 if ( pe->get_nb_values() != 1 || i == -1 )
2186 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2187 "invalid parameter: EXTENDED_POLL_ENABLED" );
2188 set_EXTENDED_POLL_ENABLED ( i == 1 );
2189 pe->set_has_been_interpreted();
2190 }
2191 }
2192
2193 // USER_CALLS_ENABLED:
2194 // -------------------
2195 {
2196 pe = entries.find ( "USER_CALLS_ENABLED" );
2197 if ( pe ) {
2198 if ( !pe->is_unique() )
2199 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2200 "invalid parameter: USER_CALLS_ENABLED not unique" );
2201 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2202 if ( pe->get_nb_values() != 1 || i == -1 )
2203 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2204 "invalid parameter: USER_CALLS_ENABLED" );
2205 set_USER_CALLS_ENABLED ( i == 1 );
2206 pe->set_has_been_interpreted();
2207 }
2208 }
2209
2210 // ASYNCHRONOUS:
2211 // -------------
2212 {
2213 pe = entries.find ( "ASYNCHRONOUS" );
2214 if ( pe ) {
2215 if ( !pe->is_unique() )
2216 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2217 "invalid parameter: ASYNCHRONOUS not unique" );
2218 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2219 if ( pe->get_nb_values() != 1 || i == -1 )
2220 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2221 "invalid parameter: ASYNCHRONOUS" );
2222 set_ASYNCHRONOUS ( i == 1 );
2223 pe->set_has_been_interpreted();
2224 }
2225 }
2226
2227 // RHO:
2228 // ----
2229 {
2230 pe = entries.find ( "RHO" );
2231 if ( pe ) {
2232 if ( !pe->is_unique() )
2233 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2234 "invalid parameter: RHO not unique" );
2235 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2236 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2237 "invalid parameter: RHO" );
2238 pe->set_has_been_interpreted();
2239 set_RHO(d);
2240 }
2241 }
2242
2243 // H_MIN:
2244 // ------
2245 {
2246 pe = entries.find ( "H_MIN" );
2247 if ( pe ) {
2248 if ( !pe->is_unique() )
2249 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2250 "invalid parameter: H_MIN not unique" );
2251 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2252 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2253 "invalid parameter: H_MIN" );
2254 pe->set_has_been_interpreted();
2255 set_H_MIN(d);
2256 }
2257 }
2258
2259 // H_MAX_0:
2260 // --------
2261 {
2262 pe = entries.find ( "H_MAX_0" );
2263 if ( pe ) {
2264 if ( !pe->is_unique() )
2265 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2266 "invalid parameter: H_MAX_0 not unique" );
2267 if ( pe->get_nb_values() != 1 || !d.atof ( *(pe->get_values().begin()) ) )
2268 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2269 "Invalid parameter: H_MAX_0" );
2270 pe->set_has_been_interpreted();
2271 set_H_MAX_0(d);
2272 }
2273 }
2274
2275 // H_NORM:
2276 // -------
2277 {
2278 pe = entries.find ( "H_NORM" );
2279 if ( pe ) {
2280 if ( !pe->is_unique() )
2281 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2282 "invalid parameter: H_NORM not unique" );
2283 NOMAD::hnorm_type hn = NOMAD::L2;
2284 if ( pe->get_nb_values() != 1 ||
2285 !NOMAD::string_to_hnorm_type ( *(pe->get_values().begin()) , hn ) )
2286 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2287 "Invalid parameter: H_NORM" );
2288 pe->set_has_been_interpreted();
2289 set_H_NORM ( hn );
2290 }
2291 }
2292
2293 // TMP_DIR:
2294 // --------
2295 {
2296 _tmp_dir.clear();
2297 pe = entries.find ( "TMP_DIR" );
2298 if ( pe ) {
2299 if ( !pe->is_unique() )
2300 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2301 "invalid parameter: TMP_DIR not unique" );
2302
2303 if ( pe->get_nb_values() != 1 )
2304 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2305 "invalid parameter: TMP_DIR" );
2306
2307 set_TMP_DIR ( *(pe->get_values().begin()) );
2308
2309 pe->set_has_been_interpreted();
2310 }
2311 }
2312
2313 // ADD_SEED_TO_FILE_NAMES:
2314 // -----------------------
2315 {
2316 pe = entries.find ( "ADD_SEED_TO_FILE_NAMES" );
2317 if ( pe ) {
2318 if ( !pe->is_unique() )
2319 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2320 "invalid parameter: ADD_SEED_TO_FILE_NAMES not unique" );
2321
2322 if ( pe->get_nb_values() != 1 )
2323 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2324 "invalid parameter: ADD_SEED_TO_FILE_NAMES" );
2325
2326 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2327 if ( pe->get_nb_values() != 1 || i == -1 )
2328 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2329 "invalid parameter: ADD_SEED_TO_FILE_NAMES" );
2330 set_ADD_SEED_TO_FILE_NAMES ( i == 1 );
2331 pe->set_has_been_interpreted();
2332 }
2333 }
2334
2335 // SOLUTION_FILE:
2336 // --------------
2337 {
2338 _solution_file.clear();
2339 pe = entries.find ( "SOLUTION_FILE" );
2340 if ( pe ) {
2341 if ( !pe->is_unique() )
2342 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2343 "invalid parameter: SOLUTION_FILE not unique" );
2344
2345 if ( pe->get_nb_values() != 1 )
2346 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2347 "invalid parameter: SOLUTION_FILE" );
2348 set_SOLUTION_FILE ( *(pe->get_values().begin()) );
2349 pe->set_has_been_interpreted();
2350 }
2351 }
2352
2353 // HISTORY_FILE:
2354 // -------------
2355 {
2356 _history_file.clear();
2357 pe = entries.find ( "HISTORY_FILE" );
2358 if ( pe ) {
2359 if ( !pe->is_unique() )
2360 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2361 "invalid parameter: HISTORY_FILE not unique" );
2362
2363 if ( pe->get_nb_values() != 1 )
2364 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2365 "invalid parameter: HISTORY_FILE" );
2366 set_HISTORY_FILE ( *(pe->get_values().begin()) );
2367 pe->set_has_been_interpreted();
2368 }
2369 }
2370
2371 // STATS_FILE:
2372 // -----------
2373 {
2374 pe = entries.find ( "STATS_FILE" );
2375 if ( pe ) {
2376
2377 if ( !pe->is_unique() )
2378 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2379 "invalid parameter: STATS_FILE not unique" );
2380
2381 end = pe->get_values().end();
2382 it = pe->get_values().begin();
2383 std::string file_name = *it;
2384 ++it;
2385
2386 std::list<std::string> ls;
2387 if (it!=end)
2388 {
2389 while ( it != end ) {
2390 ls.push_back(*it);
2391 ++it;
2392 }
2393 ls.resize(ls.size()-1);
2394 }
2395
2396 set_STATS_FILE ( file_name , ls );
2397 pe->set_has_been_interpreted();
2398 }
2399 }
2400
2401 // CACHE FILE:
2402 // -----------
2403 {
2404 _cache_file.clear();
2405 pe = entries.find ( "CACHE_FILE" );
2406 if ( pe ) {
2407 if ( !pe->is_unique() )
2408 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2409 "invalid parameter: CACHE_FILE not unique" );
2410 if ( pe->get_nb_values() != 1 )
2411 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2412 "invalid parameter: CACHE_FILE" );
2413 set_CACHE_FILE ( *(pe->get_values().begin()) );
2414 pe->set_has_been_interpreted();
2415 }
2416 }
2417
2418 // SGTE_CACHE FILE:
2419 // ----------------
2420 {
2421 _sgte_cache_file.clear();
2422 pe = entries.find ( "SGTE_CACHE_FILE" );
2423 if ( pe ) {
2424 if ( !pe->is_unique() )
2425 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2426 "invalid parameter: SGTE_CACHE_FILE not unique" );
2427 if ( pe->get_nb_values() != 1 )
2428 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2429 "invalid parameter: SGTE_CACHE_FILE" );
2430 set_SGTE_CACHE_FILE ( *(pe->get_values().begin()) );
2431 pe->set_has_been_interpreted();
2432 }
2433 }
2434
2435
2436 // CACHE_SAVE_PERIOD:
2437 // ------------------
2438 {
2439 pe = entries.find ( "CACHE_SAVE_PERIOD" );
2440 if ( pe ) {
2441 if ( !pe->is_unique() )
2442 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2443 "invalid parameter: CACHE_SAVE_PERIOD not unique" );
2444 if ( pe->get_nb_values() != 1 || !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2445 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2446 "invalid parameter: CACHE_SAVE_PERIOD" );
2447 set_CACHE_SAVE_PERIOD (i);
2448 pe->set_has_been_interpreted();
2449 }
2450 }
2451
2452 // SGTE_COST:
2453 // ----------
2454 {
2455 pe = entries.find ( "SGTE_COST" );
2456 if ( pe ) {
2457 if ( !pe->is_unique() )
2458 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2459 "invalid parameter: SGTE_COST not unique" );
2460 if ( pe->get_nb_values() != 1 ||
2461 !NOMAD::atoi (*(pe->get_values().begin()) , i) )
2462 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2463 "invalid parameter: SGTE_COST" );
2464 set_SGTE_COST (i);
2465 pe->set_has_been_interpreted();
2466 }
2467 }
2468
2469 // X0:
2470 // ---
2471 interpret_x0 ( entries );
2472
2473 // FIXED_VARIABLE:
2474 // ---------------
2475 interpret_BFVS ( entries , "FIXED_VARIABLE");
2476
2477 // LOWER_BOUND:
2478 // ------------
2479 interpret_BFVS ( entries , "LOWER_BOUND");
2480
2481 // UPPER_BOUND:
2482 // ------------
2483 interpret_BFVS ( entries , "UPPER_BOUND");
2484
2485 // SCALING:
2486 // --------
2487 interpret_BFVS ( entries , "SCALING" );
2488
2489 // BB_INPUT_TYPE:
2490 // --------------
2491 interpret_bb_input_type ( entries );
2492
2493 // F_TARGET:
2494 // ---------
2495 interpret_f_target ( entries );
2496
2497 // STOP_IF_FEASIBLE:
2498 // -----------------
2499 pe = entries.find ( "STOP_IF_FEASIBLE" );
2500 if ( pe ) {
2501 if ( !pe->is_unique() )
2502 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2503 "invalid parameter: STOP_IF_FEASIBLE not unique" );
2504 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2505 if ( pe->get_nb_values() != 1 || i == -1 )
2506 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2507 "invalid parameter: STOP_IF_FEASIBLE" );
2508 pe->set_has_been_interpreted();
2509 set_STOP_IF_FEASIBLE ( i == 1 );
2510 }
2511
2512 // BB_INPUT_INCLUDE_TAG:
2513 // ---------------------
2514 {
2515 pe = entries.find ( "BB_INPUT_INCLUDE_TAG" );
2516 if ( pe ) {
2517 if ( !pe->is_unique() )
2518 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2519 "invalid parameter: BB_INPUT_INCLUDE_TAG not unique" );
2520 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2521 if ( pe->get_nb_values() != 1 || i == -1 )
2522 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2523 "invalid parameter: BB_INPUT_INCLUDE_TAG" );
2524 set_BB_INPUT_INCLUDE_TAG ( i == 1 );
2525 pe->set_has_been_interpreted();
2526 }
2527 }
2528
2529 // BB_INPUT_INCLUDE_SEED:
2530 // ----------------------
2531 {
2532 pe = entries.find ( "BB_INPUT_INCLUDE_SEED" );
2533 if ( pe ) {
2534 if ( !pe->is_unique() )
2535 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2536 "invalid parameter: BB_INPUT_INCLUDE_SEED not unique" );
2537 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2538 if ( pe->get_nb_values() != 1 || i == -1 )
2539 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2540 "invalid parameter: BB_INPUT_INCLUDE_SEED" );
2541 set_BB_INPUT_INCLUDE_SEED ( i == 1 );
2542 pe->set_has_been_interpreted();
2543 }
2544 }
2545 // BB_REDIRECTION:
2546 // ---------------
2547 {
2548 pe = entries.find ( "BB_REDIRECTION" );
2549 if ( pe ) {
2550 if ( !pe->is_unique() )
2551 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2552 "invalid parameter: BB_REDIRECTION not unique" );
2553 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2554 if ( pe->get_nb_values() != 1 || i == -1 )
2555 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2556 "invalid parameter: BB_REDIRECTION" );
2557 set_BB_REDIRECTION ( i == 1 );
2558 pe->set_has_been_interpreted();
2559 }
2560 }
2561
2562 // INITIAL_POLL_SIZE, INITIAL_MESH_SIZE, MIN_MESH_SIZE, and MIN_POLL_SIZE:
2563 // ----------------------------------------------------
2564 interpret_mesh_sizes ( entries , "INITIAL_MESH_SIZE" );
2565 interpret_mesh_sizes ( entries , "INITIAL_POLL_SIZE" );
2566 interpret_mesh_sizes ( entries , "MIN_MESH_SIZE" );
2567 interpret_mesh_sizes ( entries , "MIN_POLL_SIZE" );
2568
2569 // BB_OUTPUT_TYPE:
2570 // ---------------
2571 {
2572 pe = entries.find ( "BB_OUTPUT_TYPE" );
2573
2574 if ( !pe ) {
2575 if ( _bb_output_type.empty() )
2576 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2577 "invalid parameter: BB_OUTPUT_TYPE not defined" );
2578 }
2579 else {
2580
2581 if ( !pe->is_unique() )
2582 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2583 "invalid parameter: BB_OUTPUT_TYPE not unique" );
2584
2585 m = pe->get_nb_values();
2586
2587 if ( m <= 0 )
2588 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2589 "invalid parameter: BB_OUTPUT_TYPE" );
2590
2591 NOMAD::bb_output_type cur;
2592 std::list<NOMAD::bb_output_type> bbot;
2593 i = 0;
2594 end = pe->get_values().end();
2595 for ( it = pe->get_values().begin() ; it != end ; ++it ) {
2596 if ( !NOMAD::string_to_bb_output_type ( *it , cur ) ) {
2597 err = "invalid parameter: BB_OUTPUT_TYPE (" + pe->get_name();
2598 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
2599 }
2600 bbot.push_back (cur);
2601 }
2602
2603 set_BB_OUTPUT_TYPE ( bbot );
2604
2605 pe->set_has_been_interpreted();
2606 }
2607 }
2608
2609 // NEIGHBORS_EXE:
2610 // --------------
2611 {
2612 _neighbors_exe.clear();
2613 pe = entries.find ( "NEIGHBORS_EXE" );
2614 if ( pe ) {
2615 if ( !pe->is_unique() )
2616 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2617 "invalid parameter: NEIGHBORS_EXE not unique" );
2618
2619 if ( pe->get_nb_values() != 1 )
2620 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2621 "invalid parameter: NEIGHBORS_EXE" );
2622 set_NEIGHBORS_EXE ( *(pe->get_values().begin()) );
2623 pe->set_has_been_interpreted();
2624 }
2625 }
2626
2627 // BB_EXE:
2628 // -------
2629 {
2630 pe = entries.find ( "BB_EXE" );
2631 if ( pe ) {
2632
2633 if ( !pe->is_unique() )
2634 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2635 "invalid parameter: BB_EXE not unique" );
2636
2637 m = pe->get_nb_values();
2638
2639 if ( m == 1 )
2640 set_BB_EXE ( *pe->get_values().begin() );
2641
2642 else {
2643
2644 if ( m != static_cast<int>(_bb_output_type.size()) )
2645 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2646 "invalid parameter: number of BB_EXE (>1) and corresponding BB_OUTPUT_TYPE must be the same." );
2647
2648 std::list<std::string> bbexe;
2649 end = pe->get_values().end();
2650 for ( it = pe->get_values().begin() ; it != end ; ++it )
2651 bbexe.push_back (*it);
2652
2653 set_BB_EXE ( bbexe );
2654 }
2655
2656 pe->set_has_been_interpreted();
2657 }
2658 }
2659
2660 // SGTE_EXE:
2661 // ---------
2662 {
2663 pe = entries.find ( "SGTE_EXE" );
2664 if ( pe ) {
2665
2666 std::string bb_exe_name , sgte_name;
2667
2668 if ( pe->get_nb_values() == 1 ) {
2669 if ( !pe->is_unique() )
2670 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2671 "invalid parameter: SGTE_EXE (with one arguement) not unique" );
2672 sgte_name = *pe->get_values().begin();
2673 }
2674
2675 else if ( pe->get_nb_values() == 2 ) {
2676 bb_exe_name = *pe->get_values().begin();
2677 sgte_name = *(++pe->get_values().begin());
2678 }
2679
2680 else
2681 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2682 "invalid parameter: SGTE_EXE" );
2683
2684 set_SGTE_EXE ( bb_exe_name , sgte_name );
2685 pe->set_has_been_interpreted();
2686 }
2687 }
2688
2689 // SGTE_EVAL_SORT:
2690 // ---------------
2691 {
2692 pe = entries.find ( "SGTE_EVAL_SORT" );
2693 if ( pe ) {
2694 if ( !pe->is_unique() )
2695 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2696 "invalid parameter: SGTE_EVAL_SORT not unique" );
2697 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2698 if ( pe->get_nb_values() != 1 || i == -1 )
2699 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2700 "invalid parameter: SGTE_EVAL_SORT" );
2701 set_SGTE_EVAL_SORT ( i == 1 );
2702 pe->set_has_been_interpreted();
2703 }
2704 }
2705
2706 // HAS_SGTE:
2707 // ---------
2708 {
2709 pe = entries.find ( "HAS_SGTE" );
2710 if ( pe ) {
2711 if ( !pe->is_unique() )
2712 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2713 "invalid parameter: HAS_SGTE not unique" );
2714 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2715 if ( pe->get_nb_values() != 1 || i == -1 )
2716 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2717 "invalid parameter: HAS_SGTE" );
2718 set_HAS_SGTE ( i == 1 );
2719 pe->set_has_been_interpreted();
2720 }
2721 }
2722
2723 // OPT_ONLY_SGTE:
2724 // --------------
2725 {
2726 pe = entries.find ( "OPT_ONLY_SGTE" );
2727 if ( pe ) {
2728 if ( !pe->is_unique() )
2729 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2730 "invalid parameter: OPT_ONLY_SGTE not unique" );
2731 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2732 if ( pe->get_nb_values() != 1 || i == -1 )
2733 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2734 "invalid parameter: OPT_ONLY_SGTE" );
2735 set_OPT_ONLY_SGTE ( i == 1 );
2736 pe->set_has_been_interpreted();
2737 }
2738 }
2739
2740 // DISPLAY_DEGREE:
2741 // ---------------
2742 {
2743 pe = entries.find ( "DISPLAY_DEGREE" );
2744 if ( pe ) {
2745 if ( !pe->is_unique() )
2746 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2747 "invalid parameter: DISPLAY_DEGREE not unique" );
2748 if ( pe->get_nb_values() != 1 ||
2749 !set_DISPLAY_DEGREE ( *(pe->get_values().begin()) ) )
2750 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2751 "invalid parameter: DISPLAY_DEGREE" );
2752 pe->set_has_been_interpreted();
2753 }
2754 }
2755
2756 // OPEN_BRACE:
2757 // -----------
2758 {
2759 pe = entries.find ( "OPEN_BRACE" );
2760 if ( pe ) {
2761 if ( !pe->is_unique() )
2762 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2763 "invalid parameter: OPEN_BRACE not unique" );
2764
2765 if ( pe->get_nb_values() != 1 )
2766 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2767 "invalid parameter: OPEN_BRACE" );
2768
2769 set_OPEN_BRACE ( *(pe->get_values().begin()) );
2770
2771 pe->set_has_been_interpreted();
2772 }
2773 }
2774
2775 // CLOSED_BRACE:
2776 // -------------
2777 {
2778 pe = entries.find ( "CLOSED_BRACE" );
2779 if ( pe ) {
2780 if ( !pe->is_unique() )
2781 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2782 "invalid parameter: CLOSED_BRACE not unique" );
2783
2784 if ( pe->get_nb_values() != 1 )
2785 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2786 "invalid parameter: CLOSED_BRACE" );
2787
2788 set_CLOSED_BRACE ( *(pe->get_values().begin()) );
2789
2790 pe->set_has_been_interpreted();
2791 }
2792 }
2793
2794 // DISPLAY_STATS:
2795 {
2796 pe = entries.find ( "DISPLAY_STATS" );
2797 if ( pe ) {
2798 if ( !pe->is_unique() )
2799 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2800 "invalid parameter: DISPLAY_STATS not unique" );
2801 std::list<std::string> ls;
2802 end = pe->get_values().end();
2803 for ( it = pe->get_values().begin() ; it != end ; ++it )
2804 ls.push_back ( *it );
2805 ls.resize ( ls.size()-1 );
2806 set_DISPLAY_STATS ( ls );
2807 pe->set_has_been_interpreted();
2808 }
2809 }
2810
2811 // DISPLAY_ALL_EVAL:
2812 // -----------------
2813 {
2814 pe = entries.find ( "DISPLAY_ALL_EVAL" );
2815 if ( pe ) {
2816 if ( !pe->is_unique() )
2817 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2818 "invalid parameter: DISPLAY_ALL_EVAL not unique" );
2819 i = NOMAD::string_to_bool ( *(pe->get_values().begin() ) );
2820 if ( pe->get_nb_values() != 1 || i == -1 )
2821 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2822 "invalid parameter: DISPLAY_ALL_EVAL" );
2823 set_DISPLAY_ALL_EVAL ( i == 1 );
2824 pe->set_has_been_interpreted();
2825 }
2826 }
2827
2828 // SEED:
2829 // -----
2830 {
2831 pe = entries.find ( "SEED" );
2832
2833 if ( pe )
2834 {
2835
2836 if ( !pe->is_unique() )
2837 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2838 "invalid parameter: SEED not unique" );
2839
2840 if ( pe->get_nb_values() != 1 )
2841 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2842 "invalid parameter: SEED" );
2843
2844 s = *(pe->get_values().begin());
2845 NOMAD::toupper(s);
2846
2847
2848 if ( s == "DIFF" )
2849 i = -1;
2850 else if ( !NOMAD::atoi ( s , i ) )
2851 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
2852 "invalid parameter: SEED" );
2853 set_SEED(i);
2854 pe->set_has_been_interpreted();
2855
2856
2857 }
2858 }
2859
2860 // VARIABLE_GROUP:
2861 // ---------------
2862 interpret_var_groups ( entries );
2863
2864 // PERIODIC_VARIABLE:
2865 // ------------------
2866 interpret_periodic_var ( entries );
2867
2868 /*----------------------------------------------*/
2869
2870 // check the non-interpreted parameters:
2871 pe = entries.find_non_interpreted();
2872 if ( pe ) {
2873 err = "invalid parameter: " + pe->get_name() + " - unknown";
2874 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
2875 }
2876
2877 // user must check the parameters with Parameters::check()
2878 }
2879
2880 /*---------------------------------------*/
2881 /* display */
2882 /*---------------------------------------*/
display(const NOMAD::Display & out) const2883 void NOMAD::Parameters::display ( const NOMAD::Display & out ) const
2884 {
2885 std::list<std::string>::const_iterator it;
2886
2887 if ( _to_be_checked ) {
2888 out << "parameters not checked" << std::endl;
2889 return;
2890 }
2891
2892 // problem directory:
2893 if ( !_problem_dir.empty() ) {
2894 out << "problem directory : " << _problem_dir << std::endl;
2895 if ( _tmp_dir != _problem_dir )
2896 out << "tmp directory : " << _tmp_dir << std::endl;
2897 }
2898
2899 // dimension:
2900 out << "dimension : n=" << _dimension << std::endl;
2901
2902 // bounds:
2903 if ( _lb.is_defined() ) {
2904 out << "lower bounds : ( ";
2905 _lb.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
2906 out << " )" << std::endl;
2907 }
2908 if ( _ub.is_defined() ) {
2909 out << "upper bounds : ( ";
2910 _ub.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
2911 out << " )" << std::endl;
2912 }
2913
2914 // scaling:
2915 if ( _scaling.is_defined() ) {
2916 out << "scaling : ( ";
2917 _scaling.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
2918 out << " )" << std::endl;
2919 }
2920
2921 // fixed variables:
2922 if ( _fixed_variables.is_defined() ) {
2923 out << "fixed variables : ( ";
2924 _fixed_variables.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
2925 out << " )" << std::endl;
2926 }
2927
2928 // back-box input types:
2929 if ( _bb_input_include_tag )
2930 out << "blackbox input files : include tag" << std::endl;
2931 if ( _bb_input_include_seed )
2932 out << "blackbox input files : include seed" << std::endl;
2933
2934 out << "blackbox input types : ";
2935 if ( get_signature()->all_continuous() )
2936 out << "all variables are continuous (R)" << std::endl;
2937 else
2938 out << "( " << _bb_input_type << " )" << std::endl;
2939
2940 // extended poll trigger:
2941 if ( get_signature()->has_categorical() ) {
2942 if ( _extended_poll_enabled ) {
2943 out << "extended poll trigger: " << _extended_poll_trigger;
2944 if ( _relative_ept )
2945 out << " (relative)";
2946 if ( !_neighbors_exe.empty() )
2947 out << std::endl << "neighbors executable : " << _neighbors_exe;
2948 }
2949 else
2950 out << "extended poll is disabled";
2951 out << std::endl;
2952 }
2953
2954 // periodic variables:
2955 if ( !_periodic_variables.empty() ) {
2956 out << "periodic variables : { ";
2957 for ( size_t k = 0 ; k < _periodic_variables.size() ; ++k )
2958 if ( _periodic_variables[k] )
2959 out << k << " ";
2960 out << "}" << std::endl;
2961 }
2962
2963 // variable groups:
2964 if ( _var_groups.size() > 1 ) {
2965 int i = 0;
2966 out.open_block ( "variable groups" );
2967 std::set<NOMAD::Variable_Group*,NOMAD::VG_Comp>::const_iterator
2968 it2 , end2 = _var_groups.end();
2969 for ( it2 = _var_groups.begin() ; it2 != end2 ; ++it2 )
2970 out << NOMAD::open_block ( "group #" + NOMAD::itos ( i++ ) )
2971 << **it2 << NOMAD::close_block();
2972 out.close_block();
2973 }
2974
2975 // blackbox outputs:
2976 {
2977 bool display_bb_exe = !_bb_exe.empty();
2978 bool display_sgte_exe = !_sgte_exe.empty();
2979 int m = static_cast<int>(_bb_output_type.size());
2980 int w = 1+int(log(static_cast<double>(m))/NOMAD::LOG10);
2981 it = _bb_exe.begin();
2982
2983 out.open_block ( "blackbox outputs (m=" + NOMAD::itos ( m ) + ")" );
2984 for ( int i = 0 ; i < m ; ++i ) {
2985 out << "#" << std::setw(w) << i << " " << std::setw(12) << _bb_output_type[i];
2986 if ( display_bb_exe ) {
2987 out << "\t" << *it;
2988 if ( display_sgte_exe )
2989 out << "\t" << get_sgte_exe(*it);
2990 ++it;
2991 }
2992 out << std::endl;
2993 }
2994 out.close_block();
2995 }
2996
2997 // signature (standard or extern):
2998 out << "signature : "
2999 << ( (_std_signature) ? "standard" : "extern" ) << std::endl;
3000
3001 // BB_REDIRECTION:
3002 if ( !_bb_redirection ) {
3003 out << "blackbox output redirection : ";
3004 out.display_yes_or_no ( _bb_redirection );
3005 out << std::endl;
3006 }
3007
3008 // surrogate:
3009 {
3010 out << "has surrogate : ";
3011 out.display_yes_or_no ( _has_sgte );
3012 out << std::endl;
3013 if ( _has_sgte ) {
3014
3015 // OPT_ONLY_SGTE:
3016 if ( _opt_only_sgte ) {
3017 out << "minimize only with surrogate : ";
3018 out.display_yes_or_no ( _opt_only_sgte );
3019 out << std::endl;
3020 }
3021
3022 // SGTE_EVAL_SORT:
3023 out << "sort trial points with surrogate: ";
3024 out.display_yes_or_no ( _sgte_eval_sort );
3025 out << std::endl;
3026
3027 // SGTE_COST:
3028 out << "surrogate cost : ";
3029 if ( _sgte_cost > 0 )
3030 out << _sgte_cost
3031 << " surrogate evaluations count as one bb evaluation" << std::endl;
3032 else
3033 out << "none" << std::endl;
3034 }
3035 }
3036
3037 // MULTI-MADS:
3038 if ( get_nb_obj() > 1 ) {
3039 out << "multi-MADS : [overall bb eval=";
3040 if ( _multi_overall_bb_eval >= 0 )
3041 out << _multi_overall_bb_eval;
3042 else
3043 out << "-";
3044 out << "] [nb MADS runs=";
3045 if ( _multi_nb_mads_runs >= 0 )
3046 out << _multi_nb_mads_runs;
3047 else
3048 out << "-";
3049 out << "] [use delta crit=";
3050 out.display_yes_or_no ( _multi_use_delta_crit );
3051 out << "]" << std::endl
3052 << " [formulation="
3053 << _multi_formulation << "]";
3054 if ( _multi_f_bounds.is_defined() ) {
3055 out << " [f_bounds=";
3056 _multi_f_bounds.display ( out , "," , -1 , -1 );
3057 out << "]";
3058 }
3059 out << std::endl;
3060 }
3061
3062 // barrier:
3063 if ( _has_constraints ) {
3064
3065 out << "barrier type : ";
3066 switch ( _barrier_type ) {
3067 case NOMAD::EB:
3068 out << "extreme" << std::endl;
3069 break;
3070 case NOMAD::PEB_P:
3071 case NOMAD::PB:
3072 out << "progressive" << std::endl;
3073 out << "prog. barrier trigger : " << _rho << std::endl;
3074 break;
3075 default:
3076 out << "filter" << std::endl;
3077 }
3078 out << "barrier h_min : " << _h_min << std::endl
3079 << "barrier initial h_max : " << _h_max_0 << std::endl;
3080 }
3081 if ( _has_filter_constraints )
3082 out << "barrier h_norm : " << _h_norm << std::endl;
3083
3084 // ADD_SEED_TO_FILE_NAMES:
3085 out << "add seed to output file names : ";
3086 out.display_yes_or_no ( _add_seed_to_file_names );
3087 out << std::endl;
3088
3089 // SOLUTION_FILE:
3090 out << "solution file : ";
3091 if ( !_solution_file.empty() )
3092 out << _solution_file << std::endl;
3093 else
3094 out << "none" << std::endl;
3095
3096 // HISTORY_FILE:
3097 out << "history file : ";
3098 if ( !_history_file.empty() )
3099 out << _history_file << std::endl;
3100 else
3101 out << "none" << std::endl;
3102
3103 // STATS_FILE:
3104 out << "stats file : ";
3105 if ( !_stats_file_name.empty() ) {
3106 out << "(" << _stats_file_name << ") ";
3107 std::list<std::string>::const_iterator end = _stats_file.end();
3108 for ( it = _stats_file.begin() ; it != end ; ++it ) {
3109 if ( it->empty() )
3110 out << " ";
3111 else
3112 out << *it;
3113 }
3114 out << std::endl;
3115 }
3116 else
3117 out << "none" << std::endl;
3118
3119 // CACHE_FILE:
3120 out << "cache file : ";
3121 if ( !_cache_file.empty() ) {
3122 out << _cache_file << std::endl;
3123 out << "cache save period : ";
3124 if ( _cache_save_period <= 0 )
3125 out << "never";
3126 else if ( _cache_save_period == 1 )
3127 out << "every iteration";
3128 else
3129 out << "every " << _cache_save_period << " iterations";
3130 out << std::endl;
3131 }
3132 else
3133 out << "none" << std::endl;
3134
3135 // surrogate cache file:
3136 if ( !_sgte_cache_file.empty() )
3137 out << "surrogate cache file : "
3138 << _sgte_cache_file << std::endl;
3139
3140 // X0:
3141 if ( _x0s.empty() && _x0_cache_file.empty() )
3142 out << "x0 : points in \'"
3143 << _cache_file << "\'" << std::endl;
3144 else {
3145 bool first = true;
3146 if ( !_x0_cache_file.empty() ) {
3147 if ( first ) {
3148 out << "x0 : ";
3149 first = false;
3150 }
3151 else
3152 out << " : ";
3153 out << _x0_cache_file;
3154 if ( _x0_cache_file != _cache_file )
3155 out << " (read only)";
3156 out << std::endl;
3157 }
3158 if ( !_x0s.empty() ) {
3159 size_t x0n = _x0s.size();
3160 for ( size_t k = 0 ; k < x0n ; ++k ) {
3161 if ( first ) {
3162 out << "x0 : ";
3163 first = false;
3164 }
3165 else
3166 out << " : ";
3167 out << "( ";
3168 _x0s[k]->display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
3169 out << " )" << std::endl;
3170 }
3171 }
3172 }
3173
3174 // directions:
3175 {
3176 std::set<NOMAD::direction_type>::const_iterator it , end = _direction_types.end();
3177 if ( _direction_types.size() == 1 )
3178 out << "directions : "
3179 << *_direction_types.begin() << std::endl;
3180 else {
3181 out << NOMAD::open_block ( "directions" );
3182 for ( it = _direction_types.begin() ; it != end ; ++it )
3183 out << *it << std::endl;
3184 out.close_block();
3185 }
3186 if ( _barrier_type == NOMAD::PB || _barrier_type == NOMAD::PEB_P ) {
3187 if ( _sec_poll_dir_types.empty() )
3188 out << "sec. poll dir. type: no secondary poll" << std::endl;
3189 else {
3190 if ( _sec_poll_dir_types.size() == 1 )
3191 out << "sec. poll dir. type: "
3192 << *_sec_poll_dir_types.begin() << std::endl;
3193 else {
3194 end = _sec_poll_dir_types.end();
3195 out << NOMAD::open_block ( "sec. poll dir. types" );
3196 for ( it = _sec_poll_dir_types.begin() ; it != end ; ++it )
3197 out << *it << std::endl;
3198 out.close_block();
3199 }
3200 }
3201 }
3202
3203 }
3204
3205 // mesh:
3206 {
3207 if ( get_use_smesh() )
3208 {
3209 out << NOMAD::open_block ( "smesh (isotropic)" );
3210 out << "mesh update basis : " << std::setw(3) << _mesh_update_basis << std::endl;
3211 }
3212 else
3213 {
3214 if ( get_anisotropic_mesh() )
3215 out << NOMAD::open_block ( "xmesh (anisotropic)" );
3216 else
3217 out << NOMAD::open_block ( "xmesh (isotropic)" );
3218 out << "poll update basis : " << std::setw(3) << _poll_update_basis << std::endl;
3219 }
3220 out << "coarsening exponent : " << std::setw(3) << _mesh_coarsening_exponent
3221 << std::endl
3222 << "refining exponent : " << std::setw(3) << _mesh_refining_exponent
3223 << std::endl
3224 << "initial mesh index : " << std::setw(3) << _initial_mesh_index << std::endl;
3225 out << "initial mesh size : ( ";
3226 _initial_mesh_size.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
3227 out << " )" << std::endl;
3228 out << "initial poll size : ( ";
3229 _initial_poll_size.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
3230 out << " )" << std::endl;
3231 if ( _min_mesh_size.is_defined() ) {
3232 out << "min mesh size : ( ";
3233 _min_mesh_size.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
3234 out << " )" << std::endl;
3235 }
3236 if ( _min_poll_size.is_defined() ) {
3237 out << "min poll size : ( ";
3238 _min_poll_size.display ( out , " " , 4 , NOMAD::Point::get_display_limit() );
3239 out << " )" << std::endl;
3240 }
3241 out.close_block();
3242 }
3243
3244 // ASYNCHRONOUS:
3245 #ifdef USE_MPI
3246 out << "asynchronous : ";
3247 out.display_yes_or_no ( _asynchronous );
3248 out << std::endl;
3249 #endif
3250
3251 // USER_CALLS_ENABLED:
3252 if ( !_user_calls_enabled )
3253 out << "user calls : disabled" << std::endl;
3254
3255 // SNAP_TO_BOUNDS:
3256 out << "snap to bounds : ";
3257 out.display_yes_or_no ( _snap_to_bounds );
3258 out << std::endl;
3259
3260 // opportunistic strategy:
3261 {
3262 out << "opportunistic evaluations : ";
3263 out.display_yes_or_no ( _opportunistic_eval );
3264 out << std::endl;
3265 if ( _opportunistic_eval ) {
3266 if ( _opportunistic_min_nb_success > 0 )
3267 out << "opportunistic min nb success : "
3268 << _opportunistic_min_nb_success << std::endl;
3269 if ( _opportunistic_min_eval > 0 )
3270 out << "opportunistic min nb eval : "
3271 << _opportunistic_min_eval << std::endl;
3272 if ( _opportunistic_min_f_imprvmt.is_defined() )
3273 out << "opportunistic min obj improvement: "
3274 << _opportunistic_min_f_imprvmt << "%"
3275 << std::endl;
3276 if ( _opportunistic_lucky_eval )
3277 out << "opportunistic lucky eval : "
3278 << _opportunistic_lucky_eval << std::endl;
3279 }
3280 }
3281
3282 // models:
3283 if (_disable_models)
3284 {
3285 out << NOMAD::open_block ( "models" );
3286 out << "models usage has been forcefully disabled: "
3287 << std::endl << NOMAD::close_block();
3288 }
3289 else
3290 {
3291 if ( _model_params.search1 != NOMAD::NO_MODEL ||
3292 _model_params.eval_sort != NOMAD::NO_MODEL )
3293 {
3294 out << NOMAD::open_block ( "models" );
3295 if ( _model_params.search1 != NOMAD::NO_MODEL )
3296 {
3297 out << NOMAD::open_block ( "model search" );
3298 if ( _model_params.search2 == NOMAD::NO_MODEL )
3299 out << "models type : " << _model_params.search1 << std::endl;
3300 else
3301 out << "models types : "
3302 << _model_params.search1 << " and "
3303 << _model_params.search2 << std::endl;
3304 out << "project to mesh: ";
3305 out.display_yes_or_no ( _model_params.search_proj_to_mesh );
3306 out << std::endl
3307 << "optimistic : ";
3308 out.display_yes_or_no ( _model_params.search_optimistic );
3309 out << std::endl
3310 << "max trial pts : " << _model_params.search_max_trial_pts
3311 << std::endl << NOMAD::close_block();
3312 }
3313 else
3314 out << "no model search" << std::endl;
3315
3316 // model ordering:
3317 if ( _model_params.eval_sort != NOMAD::NO_MODEL ) {
3318 if ( _model_params.eval_sort == NOMAD::QUADRATIC_MODEL ) {
3319 out << NOMAD::open_block ( "model ordering" )
3320 << "models type : " << _model_params.eval_sort
3321 << std::endl << "cautious model ordering: ";
3322 out.display_yes_or_no ( _model_params.eval_sort_cautious );
3323 out << std::endl << NOMAD::close_block();
3324 }
3325 else
3326 out << "model ordering: " << _model_params.eval_sort << std::endl;
3327 }
3328 else
3329 out << "no model ordering" << std::endl;
3330
3331
3332 if ( has_direction_type(NOMAD::ORTHO_NP1_QUAD) )
3333 {
3334 out << NOMAD::open_block ( "Quad model (n+1)th dynamic direction for Ortho N+1" )
3335 << "models type : QUADRATIC "
3336 << std::endl << "cautious model ordering: ";
3337 out.display_yes_or_no ( _model_params.eval_sort_cautious );
3338 out << std::endl << "quad model epsilon for ortho n+1: "
3339 << _model_params.model_np1_quad_epsilon << std::endl;
3340 out << std::endl << NOMAD::close_block();
3341 }
3342
3343 // quadratic model parameters:
3344 if ( _model_params.eval_sort == NOMAD::QUADRATIC_MODEL ||
3345 _model_params.search1 == NOMAD::QUADRATIC_MODEL ||
3346 _model_params.search2 == NOMAD::QUADRATIC_MODEL ) {
3347 out << NOMAD::open_block ( "quadratic model parameters" )
3348 << "radius factor: " << _model_params.quad_radius_factor << std::endl
3349 << "use WP : ";
3350 out.display_yes_or_no ( _model_params.quad_use_WP );
3351 out << std::endl << "min Y size : ";
3352 if ( _model_params.quad_min_Y_size < 0 )
3353 out << "n+1";
3354 else
3355 out << _model_params.quad_min_Y_size;
3356 out << std::endl
3357 << "max Y size : " << _model_params.quad_max_Y_size
3358 << std::endl << NOMAD::close_block();
3359 }
3360
3361 // TGP model parameters:
3362 if ( _model_params.eval_sort == NOMAD::TGP_MODEL ||
3363 _model_params.search1 == NOMAD::TGP_MODEL ||
3364 _model_params.search2 == NOMAD::TGP_MODEL ) {
3365 out << NOMAD::open_block ( "TGP model parameters" )
3366 << "mode : " << _model_params.tgp_mode << std::endl
3367 << "reuse model: " << _model_params.tgp_reuse_model << std::endl
3368 << NOMAD::close_block();
3369 }
3370 out.close_block();
3371 }
3372 else {
3373 out << "use models : ";
3374 out.display_yes_or_no ( false );
3375 out << std::endl;
3376 }
3377 }
3378
3379 // SPECULATIVE_SEARCH:
3380 out << "speculative search : ";
3381 out.display_yes_or_no ( _speculative_search );
3382 out << std::endl;
3383
3384 // VNS_SEARCH:
3385 out << "VNS search : ";
3386 out.display_yes_or_no ( _VNS_search );
3387 if ( _VNS_search )
3388 out << " [trigger=" << _VNS_trigger << "]";
3389 out << std::endl;
3390
3391 // LH_SEARCH:
3392 out << "Latin-Hypercube (LH) search : ";
3393 if ( _LH_search_p0 > 0 || _LH_search_pi > 0 ) {
3394 out << "#init:" << _LH_search_p0
3395 << ", #iter:" << _LH_search_pi
3396 << ", opport:";
3397 out.display_yes_or_no ( _opportunistic_LH );
3398 }
3399 else
3400 out.display_yes_or_no ( false );
3401 out << std::endl;
3402
3403 // CACHE_SEARCH:
3404 out << "cache search : ";
3405 if ( _cache_search ) {
3406 out.display_yes_or_no ( true );
3407 out << ", opport:";
3408 out.display_yes_or_no ( _opportunistic_cache_search );
3409 }
3410 else
3411 out.display_yes_or_no ( false );
3412 out << std::endl;
3413
3414 // random seed / unique tag / run id:
3415 out << "random seed / run id : " << _seed << std::endl;
3416
3417 // EPSILON:
3418 out << "epsilon : "
3419 << NOMAD::Double::get_epsilon() << std::endl;
3420
3421 // UNDEF_STR:
3422 out << "undefined string : "
3423 << NOMAD::Double::get_undef_str() << std::endl;
3424
3425 // INF_STR:
3426 out << "infinity string : "
3427 << NOMAD::Double::get_inf_str() << std::endl;
3428
3429 // DISPLAY_DEGREEs:
3430 out << NOMAD::open_block ( "display degrees" )
3431 << "general : " << _out.get_gen_dd() << std::endl
3432 << "search : " << _out.get_search_dd() << std::endl
3433 << "poll : " << _out.get_poll_dd() << std::endl
3434 << "iterative: " << _out.get_iter_dd() << std::endl
3435 << NOMAD::close_block();
3436
3437 // DISPLAY_STATS:
3438 out << "display stats : ";
3439 std::list<std::string>::const_iterator end = _display_stats.end();
3440 for ( it = _display_stats.begin() ; it != end ; ++it ) {
3441 if ( it->empty() )
3442 out << " ";
3443 else
3444 out << *it;
3445 }
3446 out << std::endl;
3447
3448 // DISPLAY_ALL_EVAL:
3449 out << "display all evaluations : ";
3450 out.display_yes_or_no ( _display_all_eval );
3451 out << std::endl;
3452
3453 // POINT_DISPLAY_LIMIT:
3454 out << "point display limit : ";
3455 if ( NOMAD::Point::get_display_limit() > 0 )
3456 out << NOMAD::Point::get_display_limit() << std::endl;
3457 else
3458 out << "no limit" << std::endl;
3459
3460 // MAX_EVAL:
3461 if ( _max_eval > 0 )
3462 out << "max eval. (bb+cache) : " << _max_eval << std::endl;
3463
3464 // MAX_BB_EVAL:
3465 if ( _max_bb_eval >= 0 ) {
3466 out << "max number of blackbox eval. : " << _max_bb_eval;
3467 if ( _max_bb_eval == 0 )
3468 out << " (no blackbox eval. allowed)";
3469 out << std::endl;
3470 }
3471
3472 // MAX_SIM_BB_EVAL:
3473 if ( _max_sim_bb_eval >= 0 )
3474 out << "max simulated blackbox eval. : " << _max_sim_bb_eval << std::endl;
3475
3476 // MAX_SGTE_EVAL:
3477 if ( _sgte_max_eval >= 0 ) {
3478 out << "max surrogate eval. : " << _sgte_max_eval;
3479 if ( _sgte_max_eval == 0 )
3480 out << " (no surrogate eval. allowed)";
3481 out << std::endl;
3482 }
3483
3484 // MAX_ITERATIONS:
3485 if ( _max_iterations >= 0 ) {
3486 out << "max iterations : " << _max_iterations;
3487 if ( _max_iterations == 0 )
3488 out << " (no iterations allowed)";
3489 out << std::endl;
3490 }
3491
3492 // MAX_CONSECUTIVE_FAILED_ITERATIONS:
3493 if ( _max_cons_failed_it > 0 )
3494 out << "max consecutive failed it. : " << _max_cons_failed_it << std::endl;
3495
3496 // MAX_CACHE_MEMORY:
3497 if ( _max_cache_memory > 0 )
3498 out << "max cache memory : " << _max_cache_memory
3499 << " MB" << std::endl;
3500
3501 // MAX_TIME:
3502 if ( _max_time > 0 )
3503 out << "max wall-clock time : " << _max_time << "s" << std::endl;
3504
3505 // F_TARGET:
3506 if ( _f_target.is_defined() ) {
3507 out << "objective target : ";
3508 if ( _f_target.size() > 1 ) {
3509 out << "( ";
3510 _f_target.display ( out , " " , 4 , -1 );
3511 out << " )" << std::endl;
3512 }
3513 else
3514 out << _f_target[0] << std::endl;
3515 }
3516
3517 // STAT_SUM_TARGET:
3518 if ( _stat_sum_target.is_defined() )
3519 out << "stat sum target : "
3520 << _stat_sum_target << std::endl;
3521
3522 // L_CURVE_TARGET:
3523 if ( _L_curve_target.is_defined() )
3524 out << "L-curve target : "
3525 << _L_curve_target << std::endl;
3526
3527 // STOP_IF_FEASIBLE:
3528 if ( _stop_if_feasible ) {
3529 out << "stop if feasible : ";
3530 out.display_yes_or_no ( _stop_if_feasible );
3531 out << std::endl;
3532 }
3533 }
3534
3535 /*---------------------------------------*/
3536 /* reset stats file */
3537 /*---------------------------------------*/
reset_stats_file(void)3538 void NOMAD::Parameters::reset_stats_file ( void )
3539 {
3540 _stats_file.clear();
3541 _stats_file_name.clear();
3542 }
3543
3544 /*---------------------------------------*/
3545 /* reset variable groups */
3546 /*---------------------------------------*/
3547
3548 // 1/2 (private):
reset_variable_groups(std::set<NOMAD::Variable_Group *,NOMAD::VG_Comp> & vg) const3549 void NOMAD::Parameters::reset_variable_groups
3550 ( std::set<NOMAD::Variable_Group*,NOMAD::VG_Comp> & vg ) const
3551 {
3552 std::set<NOMAD::Variable_Group*,NOMAD::VG_Comp>::const_iterator end = vg.end() , it;
3553 for ( it = vg.begin() ; it != end ; ++it )
3554 delete *it;
3555 vg.clear();
3556 }
3557
3558 // 2/2 (public):
reset_variable_groups(void)3559 void NOMAD::Parameters::reset_variable_groups ( void )
3560 {
3561 _to_be_checked = true;
3562 reset_variable_groups ( _var_groups );
3563 reset_variable_groups ( _user_var_groups );
3564 }
3565
3566 /*---------------------------------------*/
3567 /* reset fixed variables */
3568 /*---------------------------------------*/
reset_fixed_variables(void)3569 void NOMAD::Parameters::reset_fixed_variables ( void )
3570 {
3571 _to_be_checked = true;
3572 _fixed_variables.clear();
3573 }
3574
3575 /*---------------------------------------*/
3576 /* reset periodic variables */
3577 /*---------------------------------------*/
reset_periodic_variables(void)3578 void NOMAD::Parameters::reset_periodic_variables ( void )
3579 {
3580 _to_be_checked = true;
3581 _periodic_variables.clear();
3582 }
3583
3584 /*---------------------------------------*/
3585 /* reset bounds */
3586 /*---------------------------------------*/
reset_bounds(void)3587 void NOMAD::Parameters::reset_bounds ( void )
3588 {
3589 _to_be_checked = true;
3590 _lb.clear();
3591 _ub.clear();
3592 }
3593
3594 /*---------------------------------------*/
3595 /* reset scaling */
3596 /*---------------------------------------*/
reset_scaling(void)3597 void NOMAD::Parameters::reset_scaling ( void )
3598 {
3599 _to_be_checked = true;
3600 _scaling.clear();
3601 }
3602
3603 /*----------------------------------------*/
3604 /* check the parameters */
3605 /*----------------------------------------*/
check(bool remove_history_file,bool remove_solution_file,bool remove_stats_file)3606 void NOMAD::Parameters::check ( bool remove_history_file ,
3607 bool remove_solution_file ,
3608 bool remove_stats_file )
3609 {
3610 if ( !_to_be_checked )
3611 return;
3612
3613 int i;
3614
3615 /*--------------------------------------------------*/
3616 /* display degree and NOMAD::Point::display_limit */
3617 /*--------------------------------------------------*/
3618 {
3619
3620 #ifdef USE_MPI
3621 if ( !NOMAD::Slave::is_master() )
3622 _out.set_degrees ( NOMAD::NO_DISPLAY );
3623 #endif
3624
3625 #ifdef DEBUG
3626 #ifdef USE_MPI
3627 if ( NOMAD::Slave::is_master() )
3628 #endif
3629 _out.set_degrees ( NOMAD::FULL_DISPLAY );
3630 #endif
3631
3632 if ( _out.get_gen_dd() == NOMAD::FULL_DISPLAY )
3633 set_POINT_DISPLAY_LIMIT ( -1 );
3634 }
3635
3636 /*----------------------------*/
3637 /* DIMENSION */
3638 /*----------------------------*/
3639 if ( _dimension <= 0 )
3640 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3641 "invalid parameter: DIMENSION" );
3642 if ( _dimension > NOMAD::MAX_DIMENSION )
3643 {
3644 std::ostringstream oss;
3645 oss << "invalid parameter: DIMENSION (must be <= "
3646 << NOMAD::MAX_DIMENSION << ")";
3647 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , oss.str() );
3648 }
3649
3650 /*----------------------------*/
3651 /* BB_INPUT_TYPE */
3652 /*----------------------------*/
3653 if ( static_cast<int>(_bb_input_type.size()) != _dimension )
3654 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3655 "invalid parameter: BB_INPUT_TYPE" );
3656
3657
3658 /*----------------------------*/
3659 /* BOUNDS */
3660 /*----------------------------*/
3661 {
3662 if ( _lb.size() > _dimension )
3663 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3664 "invalid parameter: LOWER_BOUND" );
3665 if ( _lb.size() < _dimension )
3666 _lb.resize ( _dimension );
3667
3668 if ( _ub.size() > _dimension )
3669 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3670 "invalid parameter: UPPER_BOUND" );
3671 if ( _ub.size() < _dimension )
3672 _ub.resize ( _dimension );
3673
3674 for ( i = 0 ; i < _dimension ; ++i )
3675 {
3676 if ( _lb[i].is_defined() && _ub[i].is_defined() )
3677 {
3678 if ( _lb[i] > _ub[i] )
3679 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3680 "invalid parameter: LOWER_BOUND or UPPER_BOUND" );
3681 if ( _lb[i] == _ub[i] )
3682 set_FIXED_VARIABLE ( i , _lb[i] );
3683
3684 }
3685 // Check that x0s are within bounds when defined
3686 if(_lb[i].is_defined())
3687 {
3688 std::vector<NOMAD::Point *>::iterator it;
3689 for(it=_x0s.begin();it<_x0s.end();it++)
3690 {
3691 // Compare values only if dimension is the same
3692 if ( (*it)->size()==_lb.size() && (**it)[i] < _lb[i] )
3693 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3694 "invalid parameter: x0 < LOWER_BOUND " );
3695 }
3696 }
3697 if(_ub[i].is_defined())
3698 {
3699 std::vector<NOMAD::Point *>::iterator it;
3700 for(it=_x0s.begin();it<_x0s.end();it++)
3701 {
3702 // Compare values only if dimension is the same
3703 if ( (*it)->size()==_ub.size() && (**it)[i] > _ub[i] )
3704 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3705 "invalid parameter: x0 > UPPER_BOUND " );
3706 }
3707 }
3708 // integer, binary, and categorical variables:
3709 if ( _bb_input_type[i] != NOMAD::CONTINUOUS )
3710 {
3711
3712 // binary variables:
3713 if ( _bb_input_type[i] == NOMAD::BINARY )
3714 {
3715 _lb[i] = 0.0;
3716 _ub[i] = 1.0;
3717 }
3718 // integer and categorical variables:
3719 else
3720 {
3721 if ( _lb[i].is_defined() )
3722 _lb[i] = ceil(_lb[i].value());
3723 if ( _ub[i].is_defined() )
3724 _ub[i] = floor(_ub[i].value());
3725 }
3726 }
3727 }
3728 }
3729
3730
3731 /*----------------------------*/
3732 /* FIXED_VARIABLES */
3733 /*----------------------------*/
3734 if ( _fixed_variables.size() > _dimension )
3735 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3736 "invalid parameter: FIXED_VARIABLE" );
3737
3738 if ( _fixed_variables.size() < _dimension )
3739 _fixed_variables.resize ( _dimension );
3740
3741 int nb_fixed = 0;
3742 for ( i = 0; i < _dimension; ++i )
3743 if ( _fixed_variables[i].is_defined() )
3744 {
3745 ++nb_fixed;
3746 if ( (_lb[i].is_defined() && _fixed_variables[i] < _lb[i]) ||
3747 (_ub[i].is_defined() && _fixed_variables[i] > _ub[i]) ||
3748 ( (_bb_input_type[i] == NOMAD::INTEGER ||
3749 _bb_input_type[i] == NOMAD::CATEGORICAL )
3750 && !_fixed_variables[i].is_integer() ) ||
3751 ( _bb_input_type[i] == NOMAD::BINARY && !_fixed_variables[i].is_binary() ) )
3752 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3753 "invalid parameter: FIXED_VARIABLE" );
3754 }
3755
3756 if ( nb_fixed == _dimension )
3757 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3758 "invalid parameter: FIXED_VARIABLE - all variables are fixed" );
3759
3760 _nb_free_variables = _dimension - nb_fixed;
3761
3762 /*----------------------------*/
3763 /* Poll and Mesh */
3764 /*----------------------------*/
3765 {
3766
3767 if ( _use_smesh && _anisotropic_mesh )
3768 {
3769 _anisotropic_mesh=false;
3770 if ( !_warning_has_been_displayed )
3771 _out << NOMAD::open_block("Warning:")
3772 << "Anisotropic mesh is disabled when using smesh." << std::endl
3773 << NOMAD::close_block();
3774 }
3775
3776
3777 // mesh sizes:
3778 if ( _initial_mesh_size.size() != _dimension )
3779 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3780 "invalid parameter: INITIAL_MESH_SIZE must have same dimension as problem" );
3781
3782 // poll sizes
3783 if ( _initial_poll_size.size() != _dimension )
3784 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3785 "invalid parameter: INITIAL_POLL_SIZE must have same dimension as problem" );
3786
3787 if ( _initial_mesh_size.is_defined() && _initial_poll_size.is_defined() )
3788 {
3789 if ( !_warning_has_been_displayed )
3790 _out << NOMAD::open_block("Warning:")
3791 << "Initial mesh size and initial poll size are provided. Only the initial poll size will be considered." << std::endl
3792 << NOMAD::close_block();
3793 _initial_mesh_size.clear();
3794 _initial_mesh_size.reset ( _dimension );
3795 }
3796
3797
3798 // initial mesh size or poll size:
3799 // --------------------------------
3800 bool use_x0 = !_x0s.empty() && _x0s[0]->size() == _dimension;
3801 for ( i = 0 ; i < _dimension ; ++i )
3802 {
3803
3804 // continuous variables:
3805 // ---------------------
3806 if ( _bb_input_type[i] == NOMAD::CONTINUOUS )
3807 {
3808
3809 // Determine _initial_mesh_size from _initial_poll_size (this will disappear in future version)
3810 if ( _initial_mesh_size[i].is_defined() )
3811 _initial_poll_size[i]=_initial_mesh_size[i]*pow(_dimension,0.5);
3812
3813 // default value for initial mesh size
3814 if ( !_initial_poll_size[i].is_defined() )
3815 {
3816
3817 if (_lb[i].is_defined() && _ub[i].is_defined())
3818 {
3819 set_INITIAL_POLL_SIZE ( i , 0.1 , true );
3820 if ( _lb[i] == _ub[i] )
3821 set_INITIAL_POLL_SIZE (i, 1 ,false);
3822
3823 }
3824 else if ( _lb[i].is_defined() && use_x0 && (*_x0s[0])[i].is_defined() && _lb[i]!=(*_x0s[0])[i])
3825 {
3826 _initial_poll_size[i] = ((*_x0s[0])[i]-_lb[i])/10.0; // Case x0 < lb tested elsewhere
3827 }
3828 else if ( _ub[i].is_defined()&& use_x0 && (*_x0s[0])[i].is_defined() && _ub[i]!=(*_x0s[0])[i])
3829 {
3830 _initial_poll_size[i] = (_ub[i]-(*_x0s[0])[i])/10.0; // Case x0 > ub tested elsewhere
3831 }
3832 else
3833 {
3834 if ( use_x0 && (*_x0s[0])[i].is_defined() && (*_x0s[0])[i].abs() > NOMAD::Double::get_epsilon()*10.0 )
3835 _initial_poll_size[i] = (*_x0s[0])[i].abs()/10.0;
3836 else
3837 {
3838 _initial_poll_size[i] = 1.0;
3839
3840 if (_out.get_gen_dd()>=NOMAD::NORMAL_DISPLAY && !_warning_has_been_displayed)
3841 _out << NOMAD::open_block("Warning:")
3842 << "Initial mesh size for variable " << i << " has been arbitrarily fixed to 1." << std::endl
3843 << " In the absence of bounds and initial values different than zero," << std::endl
3844 << " it is recommended to explicitely provide this parameter." << std::endl
3845 << NOMAD::close_block();
3846 }
3847 }
3848 }
3849 else if ( !_fixed_variables[i].is_defined() &&
3850 ( _initial_poll_size[i].value() < NOMAD::Double::get_epsilon() ||
3851 _initial_poll_size[i].value() <= 0.0 ) )
3852 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3853 "invalid parameter: INITIAL_MESH_SIZE" );
3854 }
3855 // binary/categorical variables:
3856 // -----------------------------
3857 else if ( _bb_input_type[i] == NOMAD::BINARY ||
3858 _bb_input_type[i] == NOMAD::CATEGORICAL )
3859 {
3860 // mesh and poll sizes not used for binary and categorical
3861 // but set to prevent warning when creating signature
3862 _initial_mesh_size[i] = 1.0;
3863 _initial_poll_size[i] = 1.0;
3864 }
3865 // integer variables:
3866 // ------------------
3867 else
3868 {
3869 // Determine mesh size from poll size
3870 if ( _initial_poll_size[i].is_defined() )
3871 _initial_mesh_size[i]=_initial_poll_size[i]*pow(_dimension,-0.5);
3872
3873
3874 if ( _initial_mesh_size[i].is_defined() )
3875 {
3876 _initial_mesh_size[i]=_initial_mesh_size[i].round();
3877 if ( _initial_mesh_size[i] < 1.0 )
3878 _initial_mesh_size[i] = 1.0;
3879
3880 }
3881 else // that is no initial_mesh_size and no initial_poll_size
3882 {
3883
3884 // default value for initial mesh size
3885 // (r0.1 if there are bounds + rounding to nearest integer not zero, 1.0 otherwise):
3886 if ( !_lb[i].is_defined() || !_ub[i].is_defined() )
3887 _initial_mesh_size[i] = 1.0;
3888 else
3889 {
3890 set_INITIAL_POLL_SIZE ( i , 0.1 , true );
3891 _initial_mesh_size[i]=_initial_poll_size[i]*pow(_dimension,-0.5);
3892 _initial_mesh_size[i]=_initial_mesh_size[i].round();
3893 if ( _initial_mesh_size[i] < 1.0 )
3894 _initial_mesh_size[i] = 1.0;
3895
3896 }
3897 }
3898 _initial_poll_size[i]=_initial_mesh_size[i]*pow(_dimension,0.5);
3899
3900 }
3901 // Determine _initial_mesh_size from _initial_poll_size (this will disappear in future version)
3902 if ( !_initial_mesh_size[i].is_defined() )
3903 _initial_mesh_size[i]=_initial_poll_size[i]*pow(_dimension,-0.5);
3904
3905 }
3906
3907 // min mesh size \delta_min:
3908 if ( _min_mesh_size.is_defined() )
3909 {
3910
3911 if ( _min_mesh_size.size() != _dimension )
3912 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3913 "invalid parameter: MIN_MESH_SIZE" );
3914
3915 for ( i = 0 ; i < _dimension ; ++i )
3916 if ( _min_mesh_size[i].is_defined() &&
3917 (_min_mesh_size[i].value() < NOMAD::Double::get_epsilon() ||
3918 _min_mesh_size[i].value() <= 0.0 ) )
3919 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3920 "invalid parameters: MIN_MESH_SIZE" );
3921 }
3922
3923 // min poll size \Delta^p_min:
3924 if ( _min_poll_size.is_defined() )
3925 {
3926
3927 _min_poll_size_defined = true;
3928
3929 if ( _min_poll_size.size() != _dimension )
3930 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3931 "invalid parameter: MIN_POLL_SIZE" );
3932
3933 for ( i = 0 ; i < _dimension ; ++i )
3934 {
3935 // continuous variables:
3936 if ( _bb_input_type[i] == NOMAD::CONTINUOUS )
3937 {
3938 if ( _min_poll_size[i].is_defined() &&
3939 (_min_poll_size[i].value() < NOMAD::Double::get_epsilon() ||
3940 _min_poll_size[i].value() <= 0.0 ) )
3941 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3942 "invalid parameters: MIN_POLL_SIZE" );
3943 }
3944
3945 // integer and binary variables:
3946 else if ( _bb_input_type[i] != NOMAD::CATEGORICAL )
3947 {
3948 if ( _min_poll_size[i].is_defined() )
3949 {
3950 if ( _min_poll_size[i] < 1.0 )
3951 _min_poll_size[i] = 1.0;
3952 }
3953 else
3954 _min_poll_size[i] = 1.0;
3955 }
3956 }
3957 }
3958
3959 // default min poll size for non-continuous variables:
3960 else
3961 {
3962
3963 _min_poll_size_defined = false;
3964
3965 _min_poll_size = NOMAD::Point ( _dimension );
3966 for ( i = 0 ; i < _dimension ; ++i )
3967 if ( _bb_input_type[i] == NOMAD::INTEGER )
3968 _min_poll_size[i] = 1.0;
3969 }
3970
3971 // default value for _mesh_update_basis (tau):
3972 if ( _mesh_update_basis <= 1.0 )
3973 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3974 "invalid parameters: MESH_UPDATE_BASIS (must be >1)" );
3975
3976 if ( _poll_update_basis <= 1.0 )
3977 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
3978 "invalid parameters: POLL_UPDATE_BASIS (must be >1)" );
3979 }
3980
3981
3982 int nb_obj = static_cast<int>(_index_obj.size());
3983
3984 /*----------------------------*/
3985 /* DISPLAY_STATS */
3986 /*----------------------------*/
3987 if ( _display_stats.empty() )
3988 {
3989 std::list<std::string> ls;
3990 if ( nb_obj == 1 )
3991 {
3992 ls.push_back ( NOMAD::Display::get_display_stats_keyword ( NOMAD::DS_BBE ) );
3993 ls.push_back ( std::string() );
3994 }
3995 ls.push_back ( NOMAD::Display::get_display_stats_keyword ( NOMAD::DS_OBJ ) );
3996 set_DISPLAY_STATS ( ls );
3997 }
3998
3999 else if ( !check_display_stats ( _display_stats ) )
4000 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4001 "invalid parameter: DISPLAY_STATS" );
4002
4003 /*----------------------------*/
4004 /* STATS_FILE */
4005 /*----------------------------*/
4006 if ( !_stats_file_name.empty() )
4007 {
4008 if ( _stats_file.empty() )
4009 {
4010 std::list<std::string> ls;
4011 ls.push_back ( NOMAD::Display::get_display_stats_keyword ( NOMAD::DS_BBE ) );
4012 ls.push_back ( std::string() );
4013 ls.push_back ( NOMAD::Display::get_display_stats_keyword ( NOMAD::DS_OBJ ) );
4014 set_STATS_FILE ( _stats_file_name , ls );
4015 }
4016 else if ( !check_display_stats ( _stats_file ) )
4017 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4018 "invalid parameter: STATS_FILE" );
4019 }
4020
4021 /*----------------------------*/
4022 /* SCALING */
4023 /*----------------------------*/
4024 if ( _scaling.size() > _dimension )
4025 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4026 "invalid parameter: SCALING" );
4027
4028 if ( _scaling.size() < _dimension )
4029 _scaling.resize ( _dimension );
4030
4031 for ( i = 0; i < _dimension; ++i )
4032 if ( _scaling[i].is_defined() && _scaling[i] == 0.0 )
4033 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4034 "invalid parameter: SCALING (zero value)" );
4035
4036 /*---------------------------*/
4037 /* blackbox outputs */
4038 /*---------------------------*/
4039 if ( _bb_output_type.empty() )
4040 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4041 "invalid parameter: BB_OUTPUT_TYPE" );
4042 if ( _bb_output_type.empty() )
4043 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4044 "invalid parameter: BB_OUTPUT_TYPE - undefined" );
4045
4046 size_t m = _bb_output_type.size();
4047
4048 if ( !_bb_exe.empty() && m != _bb_exe.size() )
4049 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4050 "invalid parameter: BB_EXE: wrong number of blackbox executable names" );
4051
4052 // surrogate:
4053 if ( !_sgte_exe.empty() )
4054 {
4055
4056 _has_sgte = true;
4057
4058 if ( _bb_exe.empty() )
4059 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4060 "invalid parameter: SGTE_EXE - no BB_EXE is defined" );
4061
4062 std::map<std::string,std::string>::const_iterator it;
4063 std::map<std::string,std::string>::const_iterator end = _sgte_exe.end();
4064 std::list<std::string>::const_iterator bb_exe_begin = _bb_exe.begin();
4065 std::list<std::string>::const_iterator bb_exe_end = _bb_exe.end();
4066
4067 // an empty string in _sgte_exe means that there is a unique
4068 // blackbox with the associated surrogate
4069 // (SGTE_EXE parameter with only one argument):
4070 it = _sgte_exe.find("");
4071 if ( it != end ) {
4072 if ( _sgte_exe.size() != 1 )
4073 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4074 "invalid parameter: SGTE_EXE - impossible to interpret with one argument" );
4075
4076 std::string bb_exe_name = *bb_exe_begin;
4077 std::list<std::string>::const_iterator it2 = ++bb_exe_begin;
4078 while ( it2 != bb_exe_end ) {
4079 if ( *it2 != bb_exe_name )
4080 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4081 "invalid parameter: unique SGTE_EXE without unique blackbox executable" );
4082 ++it2;
4083 }
4084
4085 std::string sgte_name = it->second;
4086
4087 _sgte_exe.clear();
4088 _sgte_exe[bb_exe_name] = sgte_name;
4089 }
4090 else
4091 for ( it = _sgte_exe.begin() ; it != end ; ++it )
4092 if ( find ( bb_exe_begin , bb_exe_end , it->first ) == bb_exe_end )
4093 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4094 "invalid parameter: SGTE_EXE" );
4095 }
4096 else if ( !_has_sgte )
4097 {
4098 _sgte_eval_sort = false;
4099 _sgte_cost = -1;
4100
4101 if ( _opt_only_sgte )
4102 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4103 "invalid parameter: OPT_ONLY_SGTE" );
4104 }
4105
4106 if ( _opt_only_sgte )
4107 _sgte_eval_sort = false;
4108
4109 size_t k;
4110
4111 // CNT_EVAL, _STAT_SUM_ and _STAT_AVG_ checks (each one have to be unique):
4112 _index_cnt_eval = _index_stat_sum = _index_stat_avg = -1;
4113 for ( k = 0 ; k < m ; ++k )
4114 {
4115 if ( _bb_output_type[k] == NOMAD::STAT_SUM )
4116 {
4117 if ( _index_stat_sum >= 0 )
4118 {
4119 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4120 "invalid parameter: BB_EXE: more than one STAT_SUM output" );
4121 }
4122 _index_stat_sum = static_cast<int>(k);
4123 }
4124 else if ( _bb_output_type[k] == NOMAD::STAT_AVG )
4125 {
4126 if ( _index_stat_avg >= 0 )
4127 {
4128 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4129 "invalid parameter: BB_EXE: more than one STAT_AVG output" );
4130 }
4131 _index_stat_avg = static_cast<int>(k);
4132 }
4133 else if ( _bb_output_type[k] == NOMAD::CNT_EVAL )
4134 {
4135 if ( _index_cnt_eval >= 0 )
4136 {
4137 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4138 "invalid parameter: BB_EXE: more than one CNT_EVAL output" );
4139 }
4140 _index_cnt_eval = static_cast<int>(k);
4141 }
4142 }
4143
4144 // F_TARGET:
4145 if ( _f_target.is_defined() && nb_obj != _f_target.size() )
4146 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4147 "invalid parameter: F_TARGET of bad dimension" );
4148
4149 /*----------------------------*/
4150 /* directions */
4151 /*----------------------------*/
4152 bool use_ortho_mads = false;
4153
4154 {
4155 bool use_mads = false;
4156 bool use_ortho_mads_only = true;
4157 std::set<NOMAD::direction_type>::const_iterator it , end = _direction_types.end();
4158
4159 // default value for primary poll directions:
4160 if ( _direction_types.empty() )
4161 {
4162 set_DIRECTION_TYPE ( NOMAD::ORTHO_NP1_QUAD ); // Default setting that maybe changed if models are disabled
4163 use_mads = true;
4164 use_ortho_mads = true;
4165 use_ortho_mads_only = true; // OrthoMads (2n or n+1) not mixed with LT or GPS
4166 }
4167 else
4168 for ( it = _direction_types.begin() ; it != end ; ++it )
4169 {
4170 if ( NOMAD::dir_is_mads ( *it ) )
4171 use_mads = true;
4172 if ( NOMAD::dir_is_orthomads ( *it ) )
4173 use_ortho_mads = true;
4174 if ( ! NOMAD::dir_is_orthomads ( *it ) )
4175 use_ortho_mads_only = false;
4176
4177 }
4178
4179 if ( ! use_ortho_mads_only && _anisotropic_mesh )
4180 {
4181 _anisotropic_mesh=false;
4182 if ( !_warning_has_been_displayed )
4183 _out << NOMAD::open_block("Warning:")
4184 << "Anisotropic mesh is disabled for direction types other than OrthoMads." << std::endl
4185 << NOMAD::close_block();
4186 }
4187
4188
4189
4190
4191 // default value for secondary poll directions:
4192 if ( _barrier_type == NOMAD::PB || _barrier_type == NOMAD::PEB_P )
4193 {
4194
4195 if ( _sec_poll_dir_types.empty() )
4196 {
4197 if ( use_mads )
4198 {
4199 if ( _direction_types.size() == 1 )
4200 {
4201 NOMAD::direction_type dt = *(_direction_types.begin());
4202 if ( dt == NOMAD::ORTHO_1 || dt == NOMAD::ORTHO_2 )
4203 set_SEC_POLL_DIR_TYPE ( NOMAD::ORTHO_1 );
4204 else if ( dt == NOMAD::LT_1 || dt == NOMAD::LT_2 )
4205 set_SEC_POLL_DIR_TYPE ( NOMAD::LT_1 );
4206 else
4207 set_SEC_POLL_DIR_TYPE ( (use_ortho_mads) ? NOMAD::ORTHO_2 : NOMAD::LT_2 );
4208 }
4209 else
4210 set_SEC_POLL_DIR_TYPE ( (use_ortho_mads) ? NOMAD::ORTHO_2 : NOMAD::LT_2 );
4211 }
4212 else
4213 set_SEC_POLL_DIR_TYPE ( NOMAD::GPS_NP1_STATIC );
4214 }
4215
4216 else
4217 {
4218 bool old_uom = use_ortho_mads;
4219 bool old_um = use_mads;
4220 end = _sec_poll_dir_types.end();
4221 for ( it = _sec_poll_dir_types.begin() ; it != end ; ++it )
4222 {
4223 if ( *it == NOMAD::NO_DIRECTION )
4224 {
4225 _sec_poll_dir_types.clear();
4226 use_ortho_mads = old_uom;
4227 use_mads = old_um;
4228 break;
4229 }
4230 if ( NOMAD::dir_is_orthomads (*it) )
4231 use_ortho_mads = true;
4232 if ( NOMAD::dir_is_mads ( *it ) )
4233 use_mads = true;
4234 }
4235 }
4236 }
4237 else
4238 _sec_poll_dir_types.clear();
4239
4240 /*----------------------------*/
4241 /* SPECULATIVE_SEARCH */
4242 /*----------------------------*/
4243 if ( !use_mads )
4244 _speculative_search = false;
4245 }
4246
4247 /*----------------------------*/
4248 /* periodic variables */
4249 /*----------------------------*/
4250 if ( !_periodic_variables.empty() ) {
4251
4252 // check the size:
4253 if ( _dimension != static_cast<int>(_periodic_variables.size()) )
4254 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4255 "invalid parameter: PERIODIC_VARIABLE - bad size" );
4256
4257 // check the bounds:
4258 for ( int k = 0 ; k < _dimension ; ++k )
4259 if ( _periodic_variables[k] ) {
4260 if ( !_lb[k].is_defined() )
4261 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4262 "invalid parameter: PERIODIC_VARIABLE - lower bound not defined" );
4263 if ( !_ub[k].is_defined() )
4264 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4265 "invalid parameter: PERIODIC_VARIABLE - upper bound not defined" );
4266 }
4267 }
4268
4269
4270 /*---------------------------*/
4271 /* model parameters */
4272 /*---------------------------*/
4273 {
4274
4275 // disable models upon request
4276 if ( _disable_models)
4277 {
4278 _model_params.search1 = _model_params.search2 = _model_params.eval_sort = NOMAD::NO_MODEL;
4279 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4280 {
4281 _out << NOMAD::open_block("Warning:")
4282 << "Model use is forcefully disabled." << std::endl
4283 << NOMAD::close_block();
4284
4285 if (has_direction_type(NOMAD::ORTHO_NP1_QUAD))
4286 {
4287 _out << NOMAD::open_block("Warning:")
4288 << "Model use is disabled for direction type. Direction types ORTHO N+1 QUAD are changed to ORTHO N+1 NEG." << std::endl
4289 << NOMAD::close_block();
4290 }
4291 }
4292 set_DIRECTION_TYPE_NO_MODEL();
4293
4294 }
4295
4296 // disable models when requested or for more than 50 variables,
4297 // for categorical variables and for surrogate optimization:
4298 bool has_categorical=false;
4299 bool has_binary=false;
4300 for ( i = 0 ; i < _dimension ; ++i )
4301 {
4302 if ( !_fixed_variables[i].is_defined() && _bb_input_type[i] == NOMAD::CATEGORICAL )
4303 {
4304 has_categorical=true;
4305 }
4306 if ( !_fixed_variables[i].is_defined() && _bb_input_type[i] == NOMAD::BINARY )
4307 {
4308 has_binary=true;
4309 }
4310 }
4311
4312 if ( _nb_free_variables >= 50 || has_categorical || _opt_only_sgte )
4313 {
4314 _model_params.search1 = _model_params.search2 = _model_params.eval_sort = NOMAD::NO_MODEL;
4315 set_DIRECTION_TYPE_NO_MODEL();
4316
4317 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4318 {
4319 if ( _opt_only_sgte)
4320 _out << NOMAD::open_block("Warning:")
4321 << "Model use is disabled when setting the option OPT_ONLY_SGTE to yes." << std::endl;
4322 if ( has_categorical)
4323 _out << NOMAD::open_block("Warning:")
4324 << "Model use is disabled for problem with categorical variables." << std::endl
4325 << NOMAD::close_block();
4326 if ( _nb_free_variables >= 50)
4327 _out << NOMAD::open_block("Warning:")
4328 << "Model use is disabled for problem with dimension greater than 50." << std::endl
4329 << NOMAD::close_block();
4330 }
4331 }
4332
4333
4334 // disable PEB constraints when categorical variables are present
4335 if ( has_categorical && _barrier_type == NOMAD::PEB_P)
4336 {
4337
4338 change_PEB_to_PB();
4339
4340 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4341 _out << NOMAD::open_block("Warning:")
4342 << "PEB constraints are disabled when using categorical variables. To continue, PEB constraints have been replaced by PB constraints." << std::endl
4343 << NOMAD::close_block();
4344
4345 }
4346
4347 if ( ( has_categorical || has_binary ) && _anisotropic_mesh )
4348 {
4349 _anisotropic_mesh=false;
4350 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4351 _out << NOMAD::open_block("Warning:")
4352 << "Default anisotropic mesh is disabled with categorical and binary variables." << std::endl
4353 << NOMAD::close_block();
4354
4355 }
4356
4357 // disable model use in parallel mode:
4358 #ifdef USE_MPI
4359 _model_params.search1 = _model_params.search2 = _model_params.eval_sort = NOMAD::NO_MODEL;
4360 set_DIRECTION_TYPE_NO_MODEL();
4361 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4362 _out << NOMAD::open_block("Warning:")
4363 << "Model use is disabled in parallel mode (MPI)." << std::endl
4364 << NOMAD::close_block();
4365
4366
4367 if ((has_direction_type(NOMAD::ORTHO_NP1_QUAD) || has_direction_type(NOMAD::ORTHO_NP1_NEG)) && _asynchronous)
4368 {
4369 set_ASYNCHRONOUS(false);
4370 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4371 _out << NOMAD::open_block("Warning:")
4372 << "Asynchronous mode is disabled in parallel mode (MPI) when dynamic directions (ortho n+1) are used." << std::endl
4373 << NOMAD::close_block();
4374 }
4375 #endif
4376
4377 // other checks:
4378 if ( ( _model_params.search1 == NOMAD::NO_MODEL &&
4379 _model_params.search2 != NOMAD::NO_MODEL ) ||
4380 ( _model_params.search1 != NOMAD::NO_MODEL &&
4381 _model_params.search1 == _model_params.search2 ) )
4382 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4383 "invalid parameter: MODEL_SEARCH (conflict with the two types of search)" );
4384
4385 if ( _model_params.quad_radius_factor <= 0.0 )
4386 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4387 "invalid parameter: MODEL_QUAD_RADIUS_FACTOR (must be > 0)" );
4388
4389 if ( _model_params.quad_min_Y_size < 0 )
4390 _model_params.quad_min_Y_size = -1;
4391 else if ( _model_params.quad_min_Y_size < 2 )
4392 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4393 "invalid parameter: MODEL_QUAD_MIN_Y_SIZE (must be in {'N+1',-1,2,3,...})" );
4394
4395 if ( _model_params.model_np1_quad_epsilon <= 0.0 || _model_params.model_np1_quad_epsilon >= 1.0)
4396 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4397 "invalid parameter: MODEL_NP1_QUAD_EPSILON (must be > 0 and < 1)" );
4398
4399 if ( _model_params.quad_max_Y_size <= _nb_free_variables )
4400 _model_params.quad_max_Y_size = _nb_free_variables + 1;
4401
4402 if ( _model_params.search_max_trial_pts < 1 )
4403 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4404 "invalid parameter: MODEL_SEARCH_MAX_TRIAL_PTS (must be >= 1)" );
4405 }
4406
4407 /*----------------------------*/
4408 /* EVAL SORT */
4409 /*----------------------------*/
4410 if (_disable_eval_sort)
4411 {
4412
4413 _model_params.eval_sort = NOMAD::NO_MODEL;
4414 _sgte_eval_sort = false;
4415 NOMAD::Priority_Eval_Point::set_lexicographic_order(true);
4416 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed)
4417 _out << NOMAD::open_block("Warning:")
4418 << "Eval sort is forcefully disabled (using models, surrogates, user eval priority, etc.). Only lexicographic order is used." << std::endl
4419 << NOMAD::close_block();
4420
4421 }
4422 else
4423 NOMAD::Priority_Eval_Point::set_lexicographic_order(false);
4424
4425
4426 /*----------------------------*/
4427 /* variable groups */
4428 /*----------------------------*/
4429 {
4430
4431 // reset variable groups:
4432 reset_variable_groups ( _var_groups );
4433
4434 std::vector<bool> in_group ( _dimension );
4435 for ( i = 0 ; i < _dimension ; ++i )
4436 in_group[i] = false;
4437
4438 NOMAD::Variable_Group * vg;
4439 std::set<NOMAD::direction_type> direction_types , sec_poll_dir_types;
4440
4441 // 1. user groups:
4442 std::set<NOMAD::Variable_Group*,NOMAD::VG_Comp>::const_iterator
4443 end = _user_var_groups.end() , it;
4444
4445 bool mod;
4446 for ( it = _user_var_groups.begin() ; it != end ; ++it )
4447 {
4448
4449 if ( !(*it)->check ( _fixed_variables , _bb_input_type , &in_group, mod ) )
4450 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4451 "invalid parameter: VARIABLE_GROUP" );
4452
4453 direction_types = (*it)->get_direction_types();
4454 sec_poll_dir_types = (*it)->get_sec_poll_dir_types();
4455
4456 if ( direction_types.empty() )
4457 direction_types = _direction_types;
4458
4459 if ( sec_poll_dir_types.empty() )
4460 sec_poll_dir_types = _sec_poll_dir_types;
4461
4462 vg = new NOMAD::Variable_Group ( (*it)->get_var_indexes() ,
4463 direction_types ,
4464 sec_poll_dir_types ,
4465 _out );
4466
4467 _var_groups.insert ( vg );
4468 }
4469
4470
4471 // 2. 'automatic' groups for other variables:
4472 std::set<int> vi_cbi; // list of cont./bin./int. variables
4473 std::set<int> vi_cat; // list of categorical variables
4474
4475 for ( i = 0 ; i < _dimension ; ++i )
4476 {
4477 if ( !in_group[i] && !_fixed_variables[i].is_defined() ) {
4478 if ( _bb_input_type[i] != NOMAD::CATEGORICAL )
4479 vi_cbi.insert(i);
4480 else
4481 vi_cat.insert(i);
4482 }
4483 }
4484
4485 // creation of a group for cont./bin./int. variables:
4486 if ( !vi_cbi.empty() )
4487 {
4488 vg = new NOMAD::Variable_Group ( vi_cbi ,
4489 _direction_types ,
4490 _sec_poll_dir_types ,
4491 _out );
4492
4493 _var_groups.insert ( vg );
4494 }
4495
4496 // creation of a group for categorical variables:
4497 if ( !vi_cat.empty() )
4498 {
4499 vg = new NOMAD::Variable_Group ( vi_cat ,
4500 _direction_types ,
4501 _sec_poll_dir_types ,
4502 _out );
4503 _var_groups.insert ( vg );
4504 }
4505 }
4506
4507 /*----------------------------*/
4508 /* TMP_DIR */
4509 /*----------------------------*/
4510 {
4511 if ( _tmp_dir.empty() )
4512 _tmp_dir = _problem_dir;
4513
4514 // check the directory:
4515 if ( !_tmp_dir.empty() && !NOMAD::check_read_file ( _tmp_dir ) )
4516 {
4517 std::string err = "invalid parameter: TMP_DIR: cannot access \'" + _tmp_dir + "\'";
4518 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
4519 }
4520 }
4521
4522 /*------------------------------------------------------*/
4523 /* SOLUTION_FILE, HISTORY_FILE and STATS_FILE */
4524 /* (depending on the value of ADD_SEED_TO_FILE_NAMES, */
4525 /* the seed is added the file names) */
4526 /*------------------------------------------------------*/
4527 if ( _add_seed_to_file_names )
4528 {
4529
4530 std::string s_seed = NOMAD::itos(_seed);
4531 int n_seed = static_cast<int>(s_seed.size());
4532
4533 add_seed_to_file_name ( n_seed , s_seed , _solution_file );
4534 add_seed_to_file_name ( n_seed , s_seed , _history_file );
4535 add_seed_to_file_name ( n_seed , s_seed , _stats_file_name );
4536 }
4537
4538 // remove old history, solution, and stats files:
4539 std::string old_file;
4540 if ( remove_history_file && !_history_file.empty() )
4541 {
4542 old_file = _problem_dir + _history_file;
4543 remove ( old_file.c_str() );
4544 }
4545 if ( remove_stats_file && !_stats_file_name.empty() )
4546 {
4547 old_file = _problem_dir + _stats_file_name;
4548 remove ( old_file.c_str() );
4549 }
4550 if ( remove_solution_file && !_solution_file.empty() )
4551 {
4552 old_file = _problem_dir + _solution_file;
4553 remove ( old_file.c_str() );
4554 }
4555
4556 /*----------------------------*/
4557 /* opportunistic strategy */
4558 /*----------------------------*/
4559 if ( !_opportunistic_eval )
4560 {
4561 _model_params.eval_sort = NOMAD::NO_MODEL;
4562 _sgte_eval_sort = false;
4563 _opportunistic_lucky_eval = false;
4564 _opportunistic_min_nb_success = -1;
4565 _opportunistic_min_eval = -1;
4566 _opportunistic_min_f_imprvmt.clear();
4567 }
4568
4569 // opportunistic default strategy for LH search:
4570 // single-objective: the default is taken the same as OPPORTUNISTIC_EVAL
4571 // multi-objective : the default is 'no'
4572 if ( !_opp_LH_is_defined )
4573 _opportunistic_LH = ( nb_obj > 1 ) ? false : _opportunistic_eval;
4574
4575 // opportunistic default strategy for cache search
4576 // (the same as OPPORTUNISTIC_EVAL):
4577 if ( !_opp_CS_is_defined )
4578 _opportunistic_cache_search = false;
4579
4580 if (_bb_max_block_size<=0)
4581 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4582 "Parameters::check(): invalid block size for list evaluation (>0)" );
4583
4584 if (_out.get_gen_dd()>NOMAD::MINIMAL_DISPLAY && !_warning_has_been_displayed && _bb_max_block_size > 1 && (_max_bb_eval>0 || _max_sim_bb_eval>0 || _max_eval>0))
4585 _out << NOMAD::open_block("Warning:")
4586 << "The maximum number of evaluations may be exceeded when BB_MAX_BLOCK_SIZE>1." << std::endl
4587 << NOMAD::close_block();
4588
4589
4590 #ifdef USE_MPI
4591 if (_bb_max_block_size >1)
4592 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4593 "Parameters::check(): List evaluation by block of size > 1 are not allowed when using MPI." );
4594 #endif
4595
4596 /*----------------------------*/
4597 /* MULTI-MADS */
4598 /*----------------------------*/
4599 if ( nb_obj > 1 )
4600 {
4601
4602 if ( _multi_formulation == NOMAD::UNDEFINED_FORMULATION )
4603 _multi_formulation = ( _VNS_search ) ? NOMAD::DIST_L2 : NOMAD::PRODUCT;
4604
4605 if ( _multi_nb_mads_runs < 0 )
4606 {
4607
4608 if ( _multi_overall_bb_eval < 0 )
4609 {
4610 _multi_nb_mads_runs = 30;
4611 if ( !_max_bbe_decided )
4612 {
4613 _max_bb_eval = 25 * _nb_free_variables;
4614
4615 if ( _LH_search_p0 < 0 )
4616 _LH_search_p0 = _max_bb_eval;
4617 }
4618 }
4619 else if ( !_max_bbe_decided )
4620 {
4621 _max_bb_eval = static_cast<int>
4622 ( ceil ( sqrt ( 1.0 * _nb_free_variables * _multi_overall_bb_eval ) ) );
4623
4624 if ( _LH_search_p0 < 0 )
4625 _LH_search_p0 = _max_bb_eval;
4626 }
4627 }
4628 else if ( _multi_overall_bb_eval > 0 && !_max_bbe_decided )
4629 {
4630 _max_bb_eval = _multi_overall_bb_eval / _multi_nb_mads_runs;
4631 if ( _multi_nb_mads_runs * _max_bb_eval < _multi_overall_bb_eval )
4632 ++_max_bb_eval;
4633 }
4634 }
4635
4636 /*----------------------------------*/
4637 /* signature (standard or extern) */
4638 /*----------------------------------*/
4639 NOMAD::Signature * new_s = new NOMAD::Signature ( _dimension ,
4640 _bb_input_type ,
4641 _lb ,
4642 _ub ,
4643 _use_smesh ,
4644 _anisotropic_mesh ,
4645 _initial_poll_size,
4646 _min_poll_size,
4647 _min_mesh_size,
4648 _mesh_update_basis,
4649 _poll_update_basis,
4650 _mesh_coarsening_exponent,
4651 _mesh_refining_exponent,
4652 _initial_mesh_index,
4653 _scaling ,
4654 _fixed_variables ,
4655 _periodic_variables ,
4656 _var_groups );
4657
4658 // extern signature:
4659 if ( _extern_signature )
4660 {
4661
4662 bool fail = ( *new_s != *_extern_signature );
4663 delete new_s;
4664 if ( fail )
4665 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4666 "Parameters::check(): incompatible extern signature" );
4667 }
4668
4669 // standard signature:
4670 else
4671 {
4672 if ( _std_signature )
4673 {
4674 delete new_s;
4675
4676 _std_signature->reset ( _dimension ,
4677 _bb_input_type ,
4678 _lb ,
4679 _ub ,
4680 _scaling ,
4681 _fixed_variables ,
4682 _periodic_variables ,
4683 _var_groups );
4684 }
4685 else
4686 {
4687 _std_signature = new_s;
4688 _std_signature->set_std();
4689 }
4690 }
4691
4692 bool has_categorical
4693 = ( (_std_signature) ? _std_signature : _extern_signature )->has_categorical();
4694
4695
4696 /*----------------------------*/
4697 /* X0 */
4698 /*----------------------------*/
4699 {
4700 if ( _x0s.empty() && _x0_cache_file.empty() ) {
4701 if ( _LH_search_p0 <= 0 )
4702 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4703 "Parameters::check(): no starting point" );
4704 else if ( has_categorical )
4705 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4706 "Parameters::check(): no starting point with categorical variables" );
4707 }
4708
4709 size_t x0n = _x0s.size();
4710 for ( size_t k = 0 ; k < x0n ; ++k )
4711 {
4712 if ( !_x0s[k]->is_complete() )
4713 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4714 "invalid parameter: x0 with missing coordinates" );
4715
4716 // check that x0 is consistent with input type
4717 for ( i = 0 ; i < _dimension ; ++i )
4718 {
4719 const NOMAD::Double xi = (*_x0s[k])[i];
4720 if ( _bb_input_type[i] != NOMAD::CONTINUOUS && ! xi.is_integer() )
4721 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4722 "invalid parameter: x0 with variables values inconistent with their type (integer, binary, categorical." );
4723
4724 }
4725
4726 }
4727
4728
4729 // avoid _x0_cache_file == _sgte_cache_file :
4730 if ( !_opt_only_sgte &&
4731 !_x0_cache_file.empty() &&
4732 !_sgte_cache_file.empty() &&
4733 _x0_cache_file == _sgte_cache_file )
4734 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
4735 "invalid parameter: x0 and sgte cache file are the same" );
4736 }
4737
4738
4739 /*----------------------*/
4740
4741 _to_be_checked = false;
4742 _warning_has_been_displayed=true;
4743 }
4744
4745 /*-----------------------------------------------------------------*/
4746 /* add seed to a file name: file_name.ext --> file_name.seed.ext */
4747 /* (static, private) */
4748 /*-----------------------------------------------------------------*/
add_seed_to_file_name(int n_seed,const std::string & s_seed,std::string & file_name)4749 void NOMAD::Parameters::add_seed_to_file_name ( int n_seed ,
4750 const std::string & s_seed ,
4751 std::string & file_name )
4752 {
4753 int n_pn = static_cast<int>(file_name.size());
4754
4755 if ( n_pn == 0 )
4756 return;
4757
4758 int k = static_cast<int>(file_name.find_last_of("."));
4759 std::string ext = "";
4760 std::string fic = file_name;
4761
4762 if ( k >= 0 && k < n_pn ) {
4763 fic = file_name.substr ( 0 , k );
4764 ext = file_name.substr ( k , n_pn-k );
4765 n_pn = k;
4766 }
4767
4768 if ( n_pn <= n_seed+1 ||
4769 fic.substr ( n_pn-n_seed , n_pn-1 ) != s_seed )
4770 file_name = fic + "." + s_seed + ext;
4771 }
4772
4773 /*----------------------------------------*/
4774 /* GET methods */
4775 /*----------------------------------------*/
4776
4777 // get_signature:
get_signature(void) const4778 NOMAD::Signature * NOMAD::Parameters::get_signature ( void ) const
4779 {
4780 if ( _to_be_checked )
4781 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4782 "Parameters::get_signature(), Parameters::check() must be invoked" );
4783 if ( !_std_signature && !_extern_signature )
4784 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4785 "Parameters::get_signature(), no signature is set" );
4786 return (_std_signature) ? _std_signature : _extern_signature;
4787 }
4788
4789 // get_dimension:
get_dimension(void) const4790 int NOMAD::Parameters::get_dimension ( void ) const
4791 {
4792 if ( _to_be_checked )
4793 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4794 "Parameters::get_dimension(), Parameters::check() must be invoked" );
4795 return _dimension;
4796 }
4797
4798 // get_nb_free_variables:
get_nb_free_variables(void) const4799 int NOMAD::Parameters::get_nb_free_variables ( void ) const
4800 {
4801 if ( _to_be_checked )
4802 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4803 "Parameters::get_nb_free_variables(), Parameters::check() must be invoked" );
4804 return _nb_free_variables;
4805 }
4806
4807 // get_add_seed_to_file_names:
get_add_seed_to_file_names(void) const4808 bool NOMAD::Parameters::get_add_seed_to_file_names ( void ) const
4809 {
4810 if ( _to_be_checked )
4811 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4812 "Parameters::get_add_seed_to_file_names(), Parameters::check() must be invoked" );
4813 return _add_seed_to_file_names;
4814 }
4815
4816 // get_snap_to_bounds:
get_snap_to_bounds(void) const4817 bool NOMAD::Parameters::get_snap_to_bounds ( void ) const
4818 {
4819 if ( _to_be_checked )
4820 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4821 "Parameters::get_snap_to_bounds(), Parameters::check() must be invoked" );
4822 return _snap_to_bounds;
4823 }
4824
4825 // get_speculative_search:
get_speculative_search(void) const4826 bool NOMAD::Parameters::get_speculative_search ( void ) const
4827 {
4828 if ( _to_be_checked )
4829 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4830 "Parameters::get_speculative_search(), Parameters::check() must be invoked" );
4831 return _speculative_search;
4832 }
4833
4834 // get_cache_search:
get_cache_search(void) const4835 bool NOMAD::Parameters::get_cache_search ( void ) const
4836 {
4837 if ( _to_be_checked )
4838 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4839 "Parameters::get_cache_search(), Parameters::check() must be invoked" );
4840 return _cache_search;
4841 }
4842
4843 // access to all the models parameters:
get_model_parameters(NOMAD::model_params_type & mp) const4844 void NOMAD::Parameters::get_model_parameters ( NOMAD::model_params_type & mp ) const
4845 {
4846 if ( _to_be_checked )
4847 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4848 "Parameters::get_model_parameters(), Parameters::check() must be invoked" );
4849 mp = _model_params;
4850 }
4851
4852 // get_model_search:
get_model_search(int i) const4853 NOMAD::model_type NOMAD::Parameters::get_model_search ( int i ) const
4854 {
4855 if ( _to_be_checked )
4856 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4857 "Parameters::get_model_search(), Parameters::check() must be invoked" );
4858
4859 if ( i != 1 && i != 2 )
4860 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4861 "Parameters::get_model_search(i), i must be 1 or 2" );
4862
4863 return ( i == 1 ) ? _model_params.search1 : _model_params.search2;
4864 }
4865
4866 // has_model_search:
has_model_search(void) const4867 bool NOMAD::Parameters::has_model_search ( void ) const
4868 {
4869 if ( _to_be_checked )
4870 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4871 "Parameters::has_model_search(), Parameters::check() must be invoked" );
4872 return _model_params.search1 != NOMAD::NO_MODEL;
4873 }
4874
4875 // get_model_search_optimistic:
get_model_search_optimistic(void) const4876 bool NOMAD::Parameters::get_model_search_optimistic ( void ) const
4877 {
4878 if ( _to_be_checked )
4879 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4880 "Parameters::get_model_search_optimistic(), Parameters::check() must be invoked" );
4881 return _model_params.search_optimistic;
4882 }
4883
4884 // get_model_search_proj_to_mesh:
get_model_search_proj_to_mesh(void) const4885 bool NOMAD::Parameters::get_model_search_proj_to_mesh ( void ) const
4886 {
4887 if ( _to_be_checked )
4888 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4889 "Parameters::get_model_search_proj_to_mesh(), Parameters::check() must be invoked" );
4890 return _model_params.search_proj_to_mesh;
4891 }
4892
4893 // get_model_quad_radius_factor:
get_model_quad_radius_factor(void) const4894 const NOMAD::Double & NOMAD::Parameters::get_model_quad_radius_factor ( void ) const
4895 {
4896 if ( _to_be_checked )
4897 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4898 "Parameters::get_model_quad_radius_factor(), Parameters::check() must be invoked" );
4899 return _model_params.quad_radius_factor;
4900 }
4901
4902 // get_model_quad_use_WP:
get_model_quad_use_WP(void) const4903 bool NOMAD::Parameters::get_model_quad_use_WP ( void ) const
4904 {
4905 if ( _to_be_checked )
4906 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4907 "Parameters::get_model_quad_use_WP(), Parameters::check() must be invoked" );
4908 return _model_params.quad_use_WP;
4909 }
4910
4911 // get_model_quad_max_Y_size:
get_model_quad_max_Y_size(void) const4912 int NOMAD::Parameters::get_model_quad_max_Y_size ( void ) const
4913 {
4914 if ( _to_be_checked )
4915 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4916 "Parameters::get_model_quad_max_Y_size(), Parameters::check() must be invoked" );
4917 return _model_params.quad_max_Y_size;
4918 }
4919
4920 // get_model_np1_quad_epsilon:
get_model_np1_quad_epsilon(void) const4921 const NOMAD::Double & NOMAD::Parameters::get_model_np1_quad_epsilon ( void ) const
4922 {
4923 if ( _to_be_checked )
4924 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4925 "Parameters::get_model_np1_quad_epsilon(), Parameters::check() must be invoked" );
4926 return _model_params.model_np1_quad_epsilon;
4927 }
4928
4929
4930 // get_model_quad_min_Y_size:
get_model_quad_min_Y_size(void) const4931 int NOMAD::Parameters::get_model_quad_min_Y_size ( void ) const
4932 {
4933 if ( _to_be_checked )
4934 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4935 "Parameters::get_model_quad_min_Y_size(), Parameters::check() must be invoked" );
4936 return _model_params.quad_min_Y_size;
4937 }
4938
4939 // get_model_tgp_mode:
get_model_tgp_mode(void) const4940 NOMAD::TGP_mode_type NOMAD::Parameters::get_model_tgp_mode ( void ) const
4941 {
4942 if ( _to_be_checked )
4943 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4944 "Parameters::get_model_tgp_mode(), Parameters::check() must be invoked" );
4945 return _model_params.tgp_mode;
4946 }
4947
4948 // get_model_tgp_reuse_model:
get_model_tgp_reuse_model(void) const4949 bool NOMAD::Parameters::get_model_tgp_reuse_model ( void ) const
4950 {
4951 if ( _to_be_checked )
4952 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4953 "Parameters::get_model_tgp_reuse_model(), Parameters::check() must be invoked" );
4954 return _model_params.tgp_reuse_model;
4955 }
4956
4957 // get_model_search_max_trial_pts:
get_model_search_max_trial_pts(void) const4958 int NOMAD::Parameters::get_model_search_max_trial_pts ( void ) const
4959 {
4960 if ( _to_be_checked )
4961 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4962 "Parameters::get_model_search_max_trial_pts(), Parameters::check() must be invoked" );
4963 return _model_params.search_max_trial_pts;
4964 }
4965
4966 // get_model_eval_sort:
get_model_eval_sort(void) const4967 NOMAD::model_type NOMAD::Parameters::get_model_eval_sort ( void ) const
4968 {
4969 if ( _to_be_checked )
4970 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4971 "Parameters::get_model_eval_sort(), Parameters::check() must be invoked" );
4972 return _model_params.eval_sort;
4973 }
4974
4975
4976
4977 // get_model_eval_sort_cautious:
get_model_eval_sort_cautious(void) const4978 bool NOMAD::Parameters::get_model_eval_sort_cautious ( void ) const
4979 {
4980 if ( _to_be_checked )
4981 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4982 "Parameters::get_model_eval_sort_cautious(), Parameters::check() must be invoked" );
4983 return _model_params.eval_sort_cautious;
4984 }
4985
4986 // get_VNS_search:
get_VNS_search(void) const4987 bool NOMAD::Parameters::get_VNS_search ( void ) const
4988 {
4989 if ( _to_be_checked )
4990 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
4991 "Parameters::get_VNS_search(), Parameters::check() must be invoked" );
4992 return _VNS_search;
4993 }
4994
4995 // get_VNS_trigger:
get_VNS_trigger(void) const4996 const NOMAD::Double & NOMAD::Parameters::get_VNS_trigger ( void ) const
4997 {
4998 if ( _to_be_checked )
4999 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5000 "Parameters::get_VNS_trigger(), Parameters::check() must be invoked" );
5001 return _VNS_trigger;
5002 }
5003
5004 // get_LH_search_p0:
get_LH_search_p0(void) const5005 int NOMAD::Parameters::get_LH_search_p0 ( void ) const
5006 {
5007 if ( _to_be_checked )
5008 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5009 "Parameters::get_LH_search_p0(), Parameters::check() must be invoked" );
5010 return _LH_search_p0;
5011 }
5012
5013 // get_LH_search_p0:
get_LH_search_pi(void) const5014 int NOMAD::Parameters::get_LH_search_pi ( void ) const
5015 {
5016 if ( _to_be_checked )
5017 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5018 "Parameters::get_LH_search_pi(), Parameters::check() must be invoked" );
5019 return _LH_search_pi;
5020 }
5021
5022 // get_direction_types:
5023 const std::set<NOMAD::direction_type> &
get_direction_types(void) const5024 NOMAD::Parameters::get_direction_types ( void ) const
5025 {
5026 if ( _to_be_checked )
5027 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5028 "Parameters::get_direction_types(), Parameters::check() must be invoked" );
5029 return _direction_types;
5030 }
5031
5032 // get_sec_poll_dir_types:
5033 const std::set<NOMAD::direction_type> &
get_sec_poll_dir_types(void) const5034 NOMAD::Parameters::get_sec_poll_dir_types ( void ) const
5035 {
5036 if ( _to_be_checked )
5037 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5038 "Parameters::get_sec_poll_dir_types(), Parameters::check() must be invoked" );
5039 return _sec_poll_dir_types;
5040 }
5041
5042 // check if there are Ortho-MADS directions:
has_orthomads_directions(void) const5043 bool NOMAD::Parameters::has_orthomads_directions ( void ) const
5044 {
5045 if ( _to_be_checked )
5046 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5047 "Parameters::has_orthomads_directions(), Parameters::check() must be invoked" );
5048 bool use_ortho_mads = NOMAD::dirs_have_orthomads ( _direction_types );
5049 if ( !use_ortho_mads )
5050 use_ortho_mads = NOMAD::dirs_have_orthomads ( _sec_poll_dir_types );
5051 return use_ortho_mads;
5052 }
5053
5054
5055 // check if there are dynamic directions to complete the (n+1)th direction:
has_dynamic_direction(void) const5056 bool NOMAD::Parameters::has_dynamic_direction ( void ) const
5057 {
5058 if ( _to_be_checked )
5059 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5060 "Parameters::has_dynamic_direction(), Parameters::check() must be invoked" );
5061
5062 return (has_direction_type(NOMAD::ORTHO_NP1_QUAD) || has_direction_type(NOMAD::ORTHO_NP1_NEG));
5063 }
5064
5065 // check that a given direction type is present (private)
has_direction_type(NOMAD::direction_type dt) const5066 bool NOMAD::Parameters::has_direction_type ( NOMAD::direction_type dt ) const
5067 {
5068 std::set<NOMAD::direction_type>::const_iterator it , end = _direction_types.end();
5069 for ( it = _direction_types.begin() ; it != end ; ++it )
5070 if ( (*it)==dt)
5071 return true;
5072 return false;
5073 }
5074
5075
5076 // anisotropic mesh :
get_anisotropic_mesh(void) const5077 bool NOMAD::Parameters::get_anisotropic_mesh ( void ) const
5078 {
5079 if ( _to_be_checked )
5080 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5081 "Parameters::get_anisotropic_mesh, Parameters::check() must be invoked" );
5082 return _anisotropic_mesh;
5083 }
5084
5085
5086 // smesh:
get_use_smesh(void) const5087 bool NOMAD::Parameters::get_use_smesh ( void ) const
5088 {
5089 if ( _to_be_checked )
5090 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5091 "Parameters::get_use_smesh, Parameters::check() must be invoked" );
5092 return _use_smesh;
5093 }
5094
5095
5096 // get_mesh_update_basis:
get_mesh_update_basis(void) const5097 const NOMAD::Double & NOMAD::Parameters::get_mesh_update_basis ( void ) const
5098 {
5099 if ( _to_be_checked )
5100 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5101 "Parameters::get_mesh_update_basis(), Parameters::check() must be invoked" );
5102 return _mesh_update_basis;
5103 }
5104
5105 // get_poll_update_basis:
get_poll_update_basis(void) const5106 const NOMAD::Double & NOMAD::Parameters::get_poll_update_basis ( void ) const
5107 {
5108 if ( _to_be_checked )
5109 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5110 "Parameters::get_poll_update_basis(), Parameters::check() must be invoked" );
5111 return _poll_update_basis;
5112 }
5113
5114 // get_mesh_coarsening_exponent:
get_mesh_coarsening_exponent(void) const5115 int NOMAD::Parameters::get_mesh_coarsening_exponent ( void ) const
5116 {
5117 if ( _to_be_checked )
5118 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5119 "Parameters::get_mesh_coarsening_exponent(), Parameters::check() must be invoked" );
5120 return _mesh_coarsening_exponent;
5121 }
5122
5123 // get_mesh_refining_exponent:
get_mesh_refining_exponent(void) const5124 int NOMAD::Parameters::get_mesh_refining_exponent ( void ) const
5125 {
5126 if ( _to_be_checked )
5127 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5128 "Parameters::get_mesh_refining_exponent(), Parameters::check() must be invoked" );
5129 return _mesh_refining_exponent;
5130 }
5131
5132 // get_initial_mesh_index:
get_initial_mesh_index(void) const5133 int NOMAD::Parameters::get_initial_mesh_index ( void ) const
5134 {
5135 if ( _to_be_checked )
5136 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5137 "Parameters::get_initial_mesh_index(), Parameters::check() must be invoked" );
5138 return _initial_mesh_index;
5139 }
5140
5141 // get_initial_mesh_size:
get_initial_mesh_size(void) const5142 const NOMAD::Point & NOMAD::Parameters::get_initial_mesh_size ( void ) const
5143 {
5144 if ( _to_be_checked )
5145 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5146 "Parameters::get_initial_mesh_size(), Parameters::check() must be invoked" );
5147 return _initial_mesh_size;
5148 }
5149
5150 // get_initial_poll_size:
get_initial_poll_size(void) const5151 const NOMAD::Point & NOMAD::Parameters::get_initial_poll_size ( void ) const
5152 {
5153 if ( _to_be_checked )
5154 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5155 "Parameters::get_initial_poll_size(), Parameters::check() must be invoked" );
5156 return _initial_poll_size;
5157 }
5158
5159 // get_min_mesh_size:
get_min_mesh_size(void) const5160 const NOMAD::Point & NOMAD::Parameters::get_min_mesh_size ( void ) const
5161 {
5162 if ( _to_be_checked )
5163 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5164 "Parameters::get_min_mesh_size(), Parameters::check() must be invoked" );
5165 return _min_mesh_size;
5166 }
5167
5168 // get_min_poll_size:
get_min_poll_size(void) const5169 const NOMAD::Point & NOMAD::Parameters::get_min_poll_size ( void ) const
5170 {
5171 if ( _to_be_checked )
5172 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5173 "Parameters::get_min_poll_size(), Parameters::check() must be invoked" );
5174 return _min_poll_size;
5175 }
5176
5177 // get_min_poll_size_defined:
get_min_poll_size_defined(void) const5178 bool NOMAD::Parameters::get_min_poll_size_defined ( void ) const
5179 {
5180 if ( _to_be_checked )
5181 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5182 "Parameters::get_min_poll_size_defined(), Parameters::check() must be invoked" );
5183 return _min_poll_size_defined;
5184 }
5185
5186 // get_neighbors_exe:
get_neighbors_exe(void) const5187 const std::string & NOMAD::Parameters::get_neighbors_exe ( void ) const
5188 {
5189 if ( _to_be_checked )
5190 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5191 "Parameters::get_neighbors_exe(), Parameters::check() must be invoked" );
5192 return _neighbors_exe;
5193 }
5194
5195 // get_extended_poll_trigger:
get_extended_poll_trigger(void) const5196 const NOMAD::Double & NOMAD::Parameters::get_extended_poll_trigger ( void ) const
5197 {
5198 if ( _to_be_checked )
5199 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5200 "Parameters::get_extended_poll_trigger(), Parameters::check() must be invoked" );
5201 return _extended_poll_trigger;
5202 }
5203
5204 // get_relative_ept:
get_relative_ept(void) const5205 bool NOMAD::Parameters::get_relative_ept ( void ) const
5206 {
5207 if ( _to_be_checked )
5208 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5209 "Parameters::get_relative_ept(), Parameters::check() must be invoked" );
5210 return _relative_ept;
5211 }
5212
5213 // get_extended_poll_enabled:
get_extended_poll_enabled(void) const5214 bool NOMAD::Parameters::get_extended_poll_enabled ( void ) const
5215 {
5216 if ( _to_be_checked )
5217 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5218 "Parameters::get_extended_poll_enabled(), Parameters::check() must be invoked" );
5219 return _extended_poll_enabled;
5220 }
5221
5222 // get_user_calls_enabled:
get_user_calls_enabled(void) const5223 bool NOMAD::Parameters::get_user_calls_enabled ( void ) const
5224 {
5225 if ( _to_be_checked )
5226 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5227 "Parameters::get_user_calls_enabled(), Parameters::check() must be invoked" );
5228 return _user_calls_enabled;
5229 }
5230
5231 // get_asynchronous:
get_asynchronous(void) const5232 bool NOMAD::Parameters::get_asynchronous ( void ) const
5233 {
5234 if ( _to_be_checked )
5235 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5236 "Parameters::get_asynchronous(), Parameters::check() must be invoked" );
5237 return _asynchronous;
5238 }
5239
5240 // get_x0s:
get_x0s(void) const5241 const std::vector<NOMAD::Point *> & NOMAD::Parameters::get_x0s ( void ) const
5242 {
5243 if ( _to_be_checked )
5244 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5245 "Parameters::get_x0s(), Parameters::check() must be invoked" );
5246 return _x0s;
5247 }
5248
5249 // get_x0_cache_file:
get_x0_cache_file(void) const5250 const std::string & NOMAD::Parameters::get_x0_cache_file ( void ) const
5251 {
5252 if ( _to_be_checked )
5253 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5254 "Parameters::get_x0_cache_file(), Parameters::check() must be invoked" );
5255 return _x0_cache_file;
5256 }
5257
5258 // get_lb:
get_lb(void) const5259 const NOMAD::Point & NOMAD::Parameters::get_lb ( void ) const
5260 {
5261 if ( _to_be_checked )
5262 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5263 "Parameters::get_lb(), Parameters::check() must be invoked" );
5264 return _lb;
5265 }
5266
5267 // get_ub:
get_ub(void) const5268 const NOMAD::Point & NOMAD::Parameters::get_ub ( void ) const
5269 {
5270 if ( _to_be_checked )
5271 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5272 "Parameters::get_ub(), Parameters::check() must be invoked" );
5273 return _ub;
5274 }
5275
5276 // get_scaling:
get_scaling(void) const5277 const NOMAD::Point & NOMAD::Parameters::get_scaling ( void ) const
5278 {
5279 if ( _to_be_checked )
5280 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5281 "Parameters::get_scaling(), Parameters::check() must be invoked" );
5282 return _scaling;
5283 }
5284
5285 // get_fixed_variables:
get_fixed_variables(void) const5286 const NOMAD::Point & NOMAD::Parameters::get_fixed_variables ( void ) const
5287 {
5288 if ( _to_be_checked )
5289 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5290 "Parameters::get_fixed_variables(), Parameters::check() must be invoked" );
5291 return _fixed_variables;
5292 }
5293
5294 // variable_is_fixed:
variable_is_fixed(int index) const5295 bool NOMAD::Parameters::variable_is_fixed ( int index ) const
5296 {
5297 if ( _to_be_checked )
5298 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5299 "Parameters::variable_is_fixed(), Parameters::check() must be invoked" );
5300 if ( index < 0 || index >= _fixed_variables.size() )
5301 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5302 "Parameters::variable_is_fixed(), bad variable index" );
5303 return _fixed_variables[index].is_defined();
5304 }
5305
5306 // get_bb_nb_outputs:
get_bb_nb_outputs(void) const5307 int NOMAD::Parameters::get_bb_nb_outputs ( void ) const
5308 {
5309 if ( _to_be_checked )
5310 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5311 "Parameters::get_bb_nb_outputs(), Parameters::check() must be invoked" );
5312 return static_cast<int>(_bb_output_type.size());
5313 }
5314
5315 // get_bb_exe:
get_bb_exe(void) const5316 const std::list<std::string> & NOMAD::Parameters::get_bb_exe ( void ) const
5317 {
5318 if ( _to_be_checked )
5319 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5320 "Parameters::get_bb_exe(), Parameters::check() must be invoked" );
5321 return _bb_exe;
5322 }
5323
5324 // get_sgte_eval_sort:
get_sgte_eval_sort(void) const5325 bool NOMAD::Parameters::get_sgte_eval_sort ( void ) const
5326 {
5327 if ( _to_be_checked )
5328 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5329 "Parameters::get_sgte_eval_sort(), Parameters::check() must be invoked" );
5330 return _sgte_eval_sort;
5331 }
5332
5333 // has_sgte:
has_sgte(void) const5334 bool NOMAD::Parameters::has_sgte ( void ) const
5335 {
5336 if ( _to_be_checked )
5337 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5338 "Parameters::has_sgte(), Parameters::check() must be invoked" );
5339 return _has_sgte;
5340 }
5341
5342 // get_opt_only_sgte:
get_opt_only_sgte(void) const5343 bool NOMAD::Parameters::get_opt_only_sgte ( void ) const
5344 {
5345 if ( _to_be_checked )
5346 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5347 "Parameters::get_opt_only_sgte(), Parameters::check() must be invoked" );
5348 return _opt_only_sgte;
5349 }
5350
5351 // has_sgte_exe:
has_sgte_exe(void) const5352 bool NOMAD::Parameters::has_sgte_exe ( void ) const
5353 {
5354 if ( _to_be_checked )
5355 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5356 "Parameters::has_sgte_exe(), Parameters::check() must be invoked" );
5357 return !_sgte_exe.empty();
5358 }
5359
5360 // get_sgte_cost:
get_sgte_cost(void) const5361 int NOMAD::Parameters::get_sgte_cost ( void ) const
5362 {
5363 if ( _to_be_checked )
5364 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5365 "Parameters::get_sgte_cost(), Parameters::check() must be invoked" );
5366 return _sgte_cost;
5367 }
5368
5369 // get_sgte_exe (returns an empty string if bb_exe has no surrogate):
get_sgte_exe(const std::string & bb_exe) const5370 std::string NOMAD::Parameters::get_sgte_exe ( const std::string & bb_exe ) const
5371 {
5372 if ( _to_be_checked )
5373 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5374 "Parameters::get_sgte_exe(), Parameters::check() must be invoked" );
5375 std::map<std::string,std::string>::const_iterator it = _sgte_exe.find(bb_exe);
5376 std::string s;
5377 if ( it != _sgte_exe.end() )
5378 s = it->second;
5379 return s;
5380 }
5381
5382 // get_index_obj:
get_index_obj(void) const5383 const std::list<int> & NOMAD::Parameters::get_index_obj ( void ) const
5384 {
5385 if ( _to_be_checked )
5386 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5387 "Parameters::get_index_obj(), Parameters::check() must be invoked" );
5388 return _index_obj;
5389 }
5390
5391 // get_nb_obj:
get_nb_obj(void) const5392 int NOMAD::Parameters::get_nb_obj ( void ) const
5393 {
5394 if ( _to_be_checked )
5395 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5396 "Parameters::get_nb_obj(), Parameters::check() must be invoked" );
5397 return static_cast<int>(_index_obj.size());
5398 }
5399
5400 // get_bb_input_include_tag:
get_bb_input_include_tag(void) const5401 bool NOMAD::Parameters::get_bb_input_include_tag ( void ) const
5402 {
5403 if ( _to_be_checked )
5404 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5405 "Parameters::get_bb_input_include_tag(), Parameters::check() must be invoked" );
5406 return _bb_input_include_tag;
5407 }
5408
5409 // get_bb_input_include_seed:
get_bb_input_include_seed(void) const5410 bool NOMAD::Parameters::get_bb_input_include_seed ( void ) const
5411 {
5412 if ( _to_be_checked )
5413 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5414 "Parameters::get_bb_input_include_seed(), Parameters::check() must be invoked" );
5415 return _bb_input_include_seed;
5416 }
5417
5418 // get_bb_redirection:
get_bb_redirection(void) const5419 bool NOMAD::Parameters::get_bb_redirection ( void ) const
5420 {
5421 if ( _to_be_checked )
5422 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5423 "Parameters::get_bb_redirection(), Parameters::check() must be invoked" );
5424 return _bb_redirection;
5425 }
5426
5427 // get_bb_input_type:
5428 const std::vector<NOMAD::bb_input_type> &
get_bb_input_type(void) const5429 NOMAD::Parameters::get_bb_input_type ( void ) const
5430 {
5431 if ( _to_be_checked )
5432 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5433 "Parameters::get_bb_input_type(), Parameters::check() must be invoked" );
5434 return _bb_input_type;
5435 }
5436
5437 // get_bb_output_type:
5438 const std::vector<NOMAD::bb_output_type> &
get_bb_output_type(void) const5439 NOMAD::Parameters::get_bb_output_type ( void ) const
5440 {
5441 if ( _to_be_checked )
5442 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5443 "Parameters::get_bb_output_type(), Parameters::check() must be invoked" );
5444 return _bb_output_type;
5445 }
5446
5447 // get_seed:
get_seed(void) const5448 int NOMAD::Parameters::get_seed ( void ) const
5449 {
5450 if ( _to_be_checked )
5451 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5452 "Parameters::get_seed(), Parameters::check() must be invoked" );
5453 return _seed;
5454 }
5455
5456 // get_display_all_eval:
get_display_all_eval(void) const5457 bool NOMAD::Parameters::get_display_all_eval ( void ) const
5458 {
5459 if ( _to_be_checked )
5460 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5461 "Parameters::get_display_all_eval(), Parameters::check() must be invoked" );
5462 return _display_all_eval;
5463 }
5464
5465 // get_display_stats:
get_display_stats(void) const5466 const std::list<std::string> & NOMAD::Parameters::get_display_stats ( void ) const
5467 {
5468 if ( _to_be_checked )
5469 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5470 "Parameters::get_display_stats(), Parameters::check() must be invoked" );
5471 return _display_stats;
5472 }
5473
5474 // get_stats_file_name:
get_stats_file_name(void) const5475 const std::string & NOMAD::Parameters::get_stats_file_name ( void ) const
5476 {
5477 if ( _to_be_checked )
5478 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5479 "Parameters::get_stats_file_name(), Parameters::check() must be invoked" );
5480 return _stats_file_name;
5481 }
5482
5483 // get_stats_file:
get_stats_file(void) const5484 const std::list<std::string> & NOMAD::Parameters::get_stats_file ( void ) const
5485 {
5486 if ( _to_be_checked )
5487 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5488 "Parameters::get_stats_file(), Parameters::check() must be invoked" );
5489 return _stats_file;
5490 }
5491
5492 // get_point_display_limit:
get_point_display_limit(void) const5493 int NOMAD::Parameters::get_point_display_limit ( void ) const
5494 {
5495 if ( _to_be_checked )
5496 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5497 "Parameters::get_point_display_limit(), Parameters::check() must be invoked" );
5498 return NOMAD::Point::get_display_limit();
5499 }
5500
5501 // out (ex get_display()):
out(void) const5502 const NOMAD::Display & NOMAD::Parameters::out ( void ) const
5503 {
5504 if ( _to_be_checked )
5505 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5506 "Parameters::out(), Parameters::check() must be invoked" );
5507 return _out;
5508 }
5509
5510 // get_display_degree 1/2:
get_display_degree(std::string & d) const5511 void NOMAD::Parameters::get_display_degree ( std::string & d ) const
5512 {
5513 if ( _to_be_checked )
5514 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5515 "Parameters::get_display_degree(), Parameters::check() must be invoked" );
5516 _out.get_display_degree ( d );
5517 }
5518
5519 // get_display_degree 2/2:
get_display_degree(void) const5520 int NOMAD::Parameters::get_display_degree ( void ) const
5521 {
5522 if ( _to_be_checked )
5523 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5524 "Parameters::get_display_degree(), Parameters::check() must be invoked" );
5525 return _out.get_gen_dd();
5526 }
5527
5528 // get_max_eval:
get_max_eval(void) const5529 int NOMAD::Parameters::get_max_eval ( void ) const
5530 {
5531 if ( _to_be_checked )
5532 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5533 "Parameters::get_max_eval(), Parameters::check() must be invoked" );
5534 return _max_eval;
5535 }
5536
5537 // get_max_bb_eval:
get_max_bb_eval(void) const5538 int NOMAD::Parameters::get_max_bb_eval ( void ) const
5539 {
5540 if ( _to_be_checked )
5541 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5542 "Parameters::get_max_bb_eval(), Parameters::check() must be invoked" );
5543 return _max_bb_eval;
5544 }
5545
5546 // get_max_sim_bb_eval:
get_max_sim_bb_eval(void) const5547 int NOMAD::Parameters::get_max_sim_bb_eval ( void ) const
5548 {
5549 if ( _to_be_checked )
5550 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5551 "Parameters::get_max_sim_bb_eval(), Parameters::check() must be invoked" );
5552 return _max_sim_bb_eval;
5553 }
5554
5555 // get_max_sgte_eval:
get_max_sgte_eval(void) const5556 int NOMAD::Parameters::get_max_sgte_eval ( void ) const
5557 {
5558 if ( _to_be_checked )
5559 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5560 "Parameters::get_max_sgte_eval(), Parameters::check() must be invoked" );
5561 return _sgte_max_eval;
5562 }
5563
5564 // get_max_time:
get_max_time(void) const5565 int NOMAD::Parameters::get_max_time ( void ) const
5566 {
5567 if ( _to_be_checked )
5568 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5569 "Parameters::get_max_time(), Parameters::check() must be invoked" );
5570 return _max_time;
5571 }
5572
5573 // get_max_iterations:
get_max_iterations(void) const5574 int NOMAD::Parameters::get_max_iterations ( void ) const
5575 {
5576 if ( _to_be_checked )
5577 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5578 "Parameters::get_max_iterations(), Parameters::check() must be invoked" );
5579 return _max_iterations;
5580 }
5581
5582 // get_max_consecutive_failed_iterations:
get_max_consecutive_failed_iterations(void) const5583 int NOMAD::Parameters::get_max_consecutive_failed_iterations ( void ) const
5584 {
5585 if ( _to_be_checked )
5586 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5587 "Parameters::get_max_consecutive_failed_iterations(), Parameters::check() must be invoked" );
5588 return _max_cons_failed_it;
5589 }
5590
5591 // get_max_cache_memory:
get_max_cache_memory(void) const5592 float NOMAD::Parameters::get_max_cache_memory ( void ) const
5593 {
5594 if ( _to_be_checked )
5595 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5596 "Parameters::get_max_cache_memory(), Parameters::check() must be invoked" );
5597 return _max_cache_memory;
5598 }
5599
5600 // get_cache_save_period:
get_cache_save_period(void) const5601 int NOMAD::Parameters::get_cache_save_period ( void ) const
5602 {
5603 if ( _to_be_checked )
5604 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5605 "Parameters::get_cache_save_period(), Parameters::check() must be invoked" );
5606 return _cache_save_period;
5607 }
5608
5609 // get_stop_if_feasible:
get_stop_if_feasible(void) const5610 bool NOMAD::Parameters::get_stop_if_feasible ( void ) const
5611 {
5612 if ( _to_be_checked )
5613 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5614 "Parameters::get_stop_if_feasible(), Parameters::check() must be invoked" );
5615 return _stop_if_feasible;
5616 }
5617
5618 // get_f_target:
get_f_target(void) const5619 const NOMAD::Point & NOMAD::Parameters::get_f_target ( void ) const
5620 {
5621 if ( _to_be_checked )
5622 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5623 "Parameters::get_f_target(), Parameters::check() must be invoked" );
5624 return _f_target;
5625 }
5626
5627 // get_stat_sum_target:
get_stat_sum_target(void) const5628 const NOMAD::Double & NOMAD::Parameters::get_stat_sum_target ( void ) const
5629 {
5630 if ( _to_be_checked )
5631 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5632 "Parameters::get_stat_sum_target(), Parameters::check() must be invoked" );
5633 return _stat_sum_target;
5634 }
5635
5636 // get_L_curve_target:
get_L_curve_target(void) const5637 const NOMAD::Double & NOMAD::Parameters::get_L_curve_target ( void ) const
5638 {
5639 if ( _to_be_checked )
5640 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5641 "Parameters::get_L_curve_target(), Parameters::check() must be invoked" );
5642 return _L_curve_target;
5643 }
5644
5645 // get_problem_dir:
get_problem_dir(void) const5646 const std::string & NOMAD::Parameters::get_problem_dir ( void ) const
5647 {
5648 if ( _to_be_checked )
5649 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5650 "Parameters::get_problem_dir(), Parameters::check() must be invoked" );
5651 return _problem_dir;
5652 }
5653
5654 // get_tmp_dir:
get_tmp_dir(void) const5655 const std::string & NOMAD::Parameters::get_tmp_dir ( void ) const
5656 {
5657 if ( _to_be_checked )
5658 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5659 "Parameters::get_tmp_dir(), Parameters::check() must be invoked" );
5660 return _tmp_dir;
5661 }
5662
5663 // get_solution_file:
get_solution_file(void) const5664 const std::string & NOMAD::Parameters::get_solution_file ( void ) const
5665 {
5666 if ( _to_be_checked )
5667 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5668 "Parameters::get_solution_file(), Parameters::check() must be invoked" );
5669 return _solution_file;
5670 }
5671
5672 // get_history_file:
get_history_file(void) const5673 const std::string & NOMAD::Parameters::get_history_file ( void ) const
5674 {
5675 if ( _to_be_checked )
5676 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5677 "Parameters::get_history_file(), Parameters::check() must be invoked" );
5678 return _history_file;
5679 }
5680
5681 // get_cache_file:
get_cache_file(void) const5682 const std::string & NOMAD::Parameters::get_cache_file ( void ) const
5683 {
5684 if ( _to_be_checked )
5685 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5686 "Parameters::get_cache_file(), Parameters::check() must be invoked" );
5687 return _cache_file;
5688 }
5689
5690 // get_sgte_cache_file:
get_sgte_cache_file(void) const5691 const std::string & NOMAD::Parameters::get_sgte_cache_file ( void ) const
5692 {
5693 if ( _to_be_checked )
5694 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5695 "Parameters::get_sgte_cache_file(), Parameters::check() must be invoked" );
5696 return _sgte_cache_file;
5697 }
5698
5699 // get_rho:
get_rho(void) const5700 const NOMAD::Double & NOMAD::Parameters::get_rho ( void ) const
5701 {
5702 if ( _to_be_checked )
5703 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5704 "Parameters::get_rho(), Parameters::check() must be invoked" );
5705 return _rho;
5706 }
5707
5708 // get_h_min:
get_h_min(void) const5709 const NOMAD::Double & NOMAD::Parameters::get_h_min ( void ) const
5710 {
5711 if ( _to_be_checked )
5712 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5713 "Parameters::get_h_min(), Parameters::check() must be invoked" );
5714 return _h_min;
5715 }
5716
5717 // get_h_max_0:
get_h_max_0(void) const5718 const NOMAD::Double & NOMAD::Parameters::get_h_max_0 ( void ) const
5719 {
5720 if ( _to_be_checked )
5721 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5722 "Parameters::get_h_max_0(), Parameters::check() must be invoked" );
5723 return _h_max_0;
5724 }
5725
5726 // get_h_norm:
get_h_norm(void) const5727 NOMAD::hnorm_type NOMAD::Parameters::get_h_norm ( void ) const
5728 {
5729 if ( _to_be_checked )
5730 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5731 "Parameters::get_h_norm(), Parameters::check() must be invoked" );
5732 return _h_norm;
5733 }
5734
5735 // use_sec_poll_center:
use_sec_poll_center(void) const5736 bool NOMAD::Parameters::use_sec_poll_center ( void ) const
5737 {
5738 if ( _to_be_checked )
5739 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5740 "Parameters::use_second_poll_center(), Parameters::check() must be invoked" );
5741 return _barrier_type == NOMAD::PB || _barrier_type == NOMAD::PEB_P;
5742 }
5743
5744 // get_barrier_type:
get_barrier_type(void) const5745 NOMAD::bb_output_type NOMAD::Parameters::get_barrier_type ( void ) const
5746 {
5747 if ( _to_be_checked )
5748 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5749 "Parameters::get_filter_type(), Parameters::check() must be invoked" );
5750 return _barrier_type;
5751 }
5752
5753 // has_constraints:
has_constraints(void) const5754 bool NOMAD::Parameters::has_constraints ( void ) const
5755 {
5756 if ( _to_be_checked )
5757 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5758 "Parameters::has_constraints(), Parameters::check() must be invoked" );
5759 return _has_constraints;
5760 }
5761
5762 // has_EB_constraints:
has_EB_constraints(void) const5763 bool NOMAD::Parameters::has_EB_constraints ( void ) const
5764 {
5765 if ( _to_be_checked )
5766 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5767 "Parameters::has_EB_constraints(), Parameters::check() must be invoked" );
5768 return _has_EB_constraints;
5769 }
5770
5771 // get_multi_nb_mads_runs:
get_multi_nb_mads_runs(void) const5772 int NOMAD::Parameters::get_multi_nb_mads_runs ( void ) const
5773 {
5774 if ( _to_be_checked )
5775 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5776 "Parameters::get_multi_nb_mads_runs(), Parameters::check() must be invoked" );
5777 return _multi_nb_mads_runs;
5778 }
5779
5780 // get_multi_overall_bb_eval:
get_multi_overall_bb_eval(void) const5781 int NOMAD::Parameters::get_multi_overall_bb_eval ( void ) const
5782 {
5783 if ( _to_be_checked )
5784 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5785 "Parameters::get_multi_overall_bb_eval(), Parameters::check() must be invoked" );
5786 return _multi_overall_bb_eval;
5787 }
5788
5789 // get_multi_use_delta_crit:
get_multi_use_delta_crit(void) const5790 bool NOMAD::Parameters::get_multi_use_delta_crit ( void ) const
5791 {
5792 if ( _to_be_checked )
5793 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5794 "Parameters::get_multi_use_delta_crit(), Parameters::check() must be invoked" );
5795 return _multi_use_delta_crit;
5796 }
5797
5798 // get_multi_f_bounds:
get_multi_f_bounds(void) const5799 const NOMAD::Point & NOMAD::Parameters::get_multi_f_bounds ( void ) const
5800 {
5801 if ( _to_be_checked )
5802 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5803 "Parameters::get_multi_f_bounds(), Parameters::check() must be invoked" );
5804 return _multi_f_bounds;
5805 }
5806
5807 // get_multi_formulation:
get_multi_formulation(void) const5808 NOMAD::multi_formulation_type NOMAD::Parameters::get_multi_formulation ( void ) const
5809 {
5810 if ( _to_be_checked )
5811 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5812 "Parameters::get_multi_formulation(), Parameters::check() must be invoked" );
5813 return _multi_formulation;
5814 }
5815
5816 // get_opportunistic_cache_search:
get_opportunistic_cache_search(void) const5817 bool NOMAD::Parameters::get_opportunistic_cache_search ( void ) const
5818 {
5819 if ( _to_be_checked )
5820 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5821 "Parameters::get_opportunistic_cache_search(), Parameters::check() must be invoked" );
5822 return _opportunistic_cache_search;
5823 }
5824
5825 // get_opportunistic_LH:
get_opportunistic_LH(void) const5826 bool NOMAD::Parameters::get_opportunistic_LH ( void ) const
5827 {
5828 if ( _to_be_checked )
5829 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5830 "Parameters::get_opportunistic_LH(), Parameters::check() must be invoked" );
5831 return _opportunistic_LH;
5832 }
5833
5834 // get_opportunistic_eval:
get_opportunistic_eval(void) const5835 bool NOMAD::Parameters::get_opportunistic_eval ( void ) const
5836 {
5837 if ( _to_be_checked )
5838 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5839 "Parameters::get_opportunistic_eval(), Parameters::check() must be invoked" );
5840 return _opportunistic_eval;
5841 }
5842
5843 // get_opportunistic_min_nb_success
get_opportunistic_min_nb_success(void) const5844 int NOMAD::Parameters::get_opportunistic_min_nb_success ( void ) const
5845 {
5846 if ( _to_be_checked )
5847 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5848 "Parameters::get_opportunistic_min_nb_success(), Parameters::check() must be invoked");
5849 return _opportunistic_min_nb_success;
5850 }
5851
5852 // get_opportunistic_min_eval
get_opportunistic_min_eval(void) const5853 int NOMAD::Parameters::get_opportunistic_min_eval ( void ) const
5854 {
5855 if ( _to_be_checked )
5856 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5857 "Parameters::get_opportunistic_min_eval(), Parameters::check() must be invoked" );
5858 return _opportunistic_min_eval;
5859 }
5860
5861 // get_bb_max_block_size
get_bb_max_block_size(void) const5862 int NOMAD::Parameters::get_bb_max_block_size ( void ) const
5863 {
5864 if ( _to_be_checked )
5865 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5866 "Parameters::get_bb_max_block_size(), Parameters::check() must be invoked" );
5867 return _bb_max_block_size;
5868 }
5869
5870
5871 // get_opportunistic_min_f_imprvmt
get_opportunistic_min_f_imprvmt(void) const5872 const NOMAD::Double & NOMAD::Parameters::get_opportunistic_min_f_imprvmt ( void ) const
5873 {
5874 if ( _to_be_checked )
5875 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5876 "Parameters::get_opportunistic_min_f_imprvmt(), Parameters::check() must be invoked" );
5877 return _opportunistic_min_f_imprvmt;
5878 }
5879
5880 // get_opportunistic_lucky_eval:
get_opportunistic_lucky_eval(void) const5881 bool NOMAD::Parameters::get_opportunistic_lucky_eval ( void ) const
5882 {
5883 if ( _to_be_checked )
5884 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5885 "Parameters::get_opportunistic_lucky_eval(), Parameters::check() must be invoked" );
5886 return _opportunistic_lucky_eval;
5887 }
5888
5889 // check_stat_sum:
check_stat_sum(void) const5890 bool NOMAD::Parameters::check_stat_sum ( void ) const
5891 {
5892 if ( _to_be_checked )
5893 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5894 "Parameters::check_stat_sum(), Parameters::check() must be invoked" );
5895 return ( _index_stat_sum >= 0 );
5896 }
5897
5898 // check_stat_avg:
check_stat_avg(void) const5899 bool NOMAD::Parameters::check_stat_avg ( void ) const
5900 {
5901 if ( _to_be_checked )
5902 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5903 "Parameters::check_stat_avg(), Parameters::check() must be invoked" );
5904 return ( _index_stat_avg >= 0 );
5905 }
5906
5907 // get_index_stat_sum:
get_index_stat_sum(void) const5908 int NOMAD::Parameters::get_index_stat_sum ( void ) const
5909 {
5910 if ( _to_be_checked )
5911 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5912 "Parameters::get_index_stat_sum(), Parameters::check() must be invoked" );
5913 return _index_stat_sum;
5914 }
5915
5916 // get_index_stat_avg:
get_index_stat_avg(void) const5917 int NOMAD::Parameters::get_index_stat_avg ( void ) const
5918 {
5919 if ( _to_be_checked )
5920 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5921 "Parameters::get_index_stat_avg(), Parameters::check() must be invoked" );
5922 return _index_stat_avg;
5923 }
5924
5925 // get_index_cnt_eval:
get_index_cnt_eval(void) const5926 int NOMAD::Parameters::get_index_cnt_eval ( void ) const
5927 {
5928 if ( _to_be_checked )
5929 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5930 "Parameters::get_index_cnt_eval(), Parameters::check() must be invoked" );
5931 return _index_cnt_eval;
5932 }
5933
5934 // get_periodic_variables:
get_periodic_variables(void) const5935 const std::vector<bool> & NOMAD::Parameters::get_periodic_variables ( void ) const
5936 {
5937 if ( _to_be_checked )
5938 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5939 "Parameters::get_periodic_variables(), Parameters::check() must be invoked" );
5940 return _periodic_variables;
5941 }
5942
5943 // get_variable_groups:
5944 const std::set<NOMAD::Variable_Group*,NOMAD::VG_Comp> &
get_variable_groups(void) const5945 NOMAD::Parameters::get_variable_groups ( void ) const
5946 {
5947 if ( _to_be_checked )
5948 throw Bad_Access ( "Parameters.cpp" , __LINE__ ,
5949 "Parameters::get_variable_groups(), Parameters::check() must be invoked" );
5950 return _var_groups;
5951 }
5952
5953 /*----------------------------------------*/
5954 /* SET methods */
5955 /*----------------------------------------*/
5956
5957 // set_POINT_DISPLAY_LIMIT:
set_POINT_DISPLAY_LIMIT(int dl)5958 void NOMAD::Parameters::set_POINT_DISPLAY_LIMIT ( int dl )
5959 {
5960 NOMAD::Point::set_display_limit ( dl );
5961 }
5962
5963 // set_DIMENSION:
set_DIMENSION(int dim)5964 bool NOMAD::Parameters::set_DIMENSION ( int dim )
5965 {
5966 if ( _dimension > 0 ) {
5967 _dimension = -1;
5968 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
5969 "invalid parameter: DIMENSION - defined twice" );
5970 return false;
5971 }
5972
5973 _to_be_checked = true;
5974 _dimension = dim;
5975 if ( _dimension <= 0 ) {
5976 _dimension = -1;
5977 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
5978 "invalid parameter: DIMENSION" );
5979 return false;
5980 }
5981
5982 // all variables are initially considered continuous:
5983 _bb_input_type.resize ( _dimension );
5984 for ( int i = 0 ; i < _dimension ; ++i )
5985 _bb_input_type[i] = NOMAD::CONTINUOUS;
5986
5987 // resize of _initial_mesh_size:
5988 _initial_mesh_size.reset ( _dimension );
5989 _initial_poll_size.reset ( _dimension );
5990
5991 return true;
5992 }
5993
5994 // set_EXTERN_SIGNATURE (set a new extern signature and
5995 // delete the standard signature):
set_EXTERN_SIGNATURE(NOMAD::Signature * s)5996 void NOMAD::Parameters::set_EXTERN_SIGNATURE ( NOMAD::Signature * s )
5997 {
5998 if ( _std_signature && s == _std_signature )
5999 return;
6000
6001 // standard signature:
6002 delete _std_signature;
6003 _std_signature = NULL;
6004 _extern_signature = s;
6005
6006 // dimension:
6007 _dimension = -1;
6008 set_DIMENSION ( s->get_n() );
6009
6010 // input types:
6011 set_BB_INPUT_TYPE ( s->get_input_types() );
6012
6013 // bounds:
6014 set_LOWER_BOUND ( s->get_lb() );
6015 set_UPPER_BOUND ( s->get_ub() );
6016
6017 // scaling:
6018 set_SCALING ( s->get_scaling() );
6019
6020 // fixed variables:
6021 set_FIXED_VARIABLE ( s->get_fixed_variables() );
6022
6023 // periodic variables:
6024 set_PERIODIC_VARIABLE ( s->get_periodic_variables() );
6025
6026 // variable groups:
6027 reset_variable_groups();
6028 set_VARIABLE_GROUP ( s->get_var_groups() );
6029
6030 _to_be_checked = true;
6031 }
6032
6033 // set_SNAP_TO_BOUNDS:
set_SNAP_TO_BOUNDS(bool stb)6034 void NOMAD::Parameters::set_SNAP_TO_BOUNDS ( bool stb )
6035 {
6036 _to_be_checked = true;
6037 _snap_to_bounds = stb;
6038 }
6039
6040 // set_SPECULATIVE_SEARCH:
set_SPECULATIVE_SEARCH(bool ss)6041 void NOMAD::Parameters::set_SPECULATIVE_SEARCH ( bool ss )
6042 {
6043 _to_be_checked = true;
6044 _speculative_search = ss;
6045 }
6046
6047 // set_CACHE_SEARCH:
set_CACHE_SEARCH(bool s)6048 void NOMAD::Parameters::set_CACHE_SEARCH ( bool s )
6049 {
6050 _to_be_checked = true;
6051 _cache_search = s;
6052 }
6053
6054 // Disable use of models
set_DISABLE_MODELS(void)6055 void NOMAD::Parameters::set_DISABLE_MODELS ( void )
6056 {
6057 _disable_models=true;
6058 }
6059
6060 // Disable use of models
set_DISABLE_EVAL_SORT(void)6061 void NOMAD::Parameters::set_DISABLE_EVAL_SORT ( void )
6062 {
6063 _disable_eval_sort=true;
6064 }
6065
6066 // set all the models parameters:
set_model_parameters(const NOMAD::model_params_type & mp)6067 void NOMAD::Parameters::set_model_parameters ( const NOMAD::model_params_type & mp )
6068 {
6069 _to_be_checked = true;
6070 set_MODEL_SEARCH ( 1 , mp.search1 );
6071 set_MODEL_SEARCH ( 2 , mp.search2 );
6072 set_MODEL_EVAL_SORT ( mp.eval_sort );
6073 set_MODEL_SEARCH_OPTIMISTIC ( mp.search_optimistic );
6074 set_MODEL_SEARCH_PROJ_TO_MESH ( mp.search_proj_to_mesh );
6075 set_MODEL_SEARCH_MAX_TRIAL_PTS ( mp.search_max_trial_pts );
6076 set_MODEL_EVAL_SORT_CAUTIOUS ( mp.eval_sort_cautious );
6077 set_MODEL_QUAD_RADIUS_FACTOR ( mp.quad_radius_factor );
6078 set_MODEL_QUAD_USE_WP ( mp.quad_use_WP );
6079 set_MODEL_QUAD_MIN_Y_SIZE ( mp.quad_min_Y_size );
6080 set_MODEL_QUAD_MAX_Y_SIZE ( mp.quad_max_Y_size );
6081 set_MODEL_TGP_MODE ( mp.tgp_mode );
6082 set_MODEL_TGP_REUSE_MODEL ( mp.tgp_reuse_model );
6083 }
6084
6085 // set_MODEL_SEARCH (1/3):
set_MODEL_SEARCH(int i,NOMAD::model_type ms)6086 void NOMAD::Parameters::set_MODEL_SEARCH ( int i , NOMAD::model_type ms )
6087 {
6088 _to_be_checked = true;
6089
6090 #ifndef USE_TGP
6091 if ( ms == NOMAD::TGP_MODEL )
6092 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6093 "invalid parameter: MODEL_SEARCH: this version has not been compiled for TGP" );
6094 #endif
6095
6096 if ( i != 1 && i != 2 )
6097 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6098 "NOMAD::Parameters::set_MODEL_SEARCH(i,m): bad value for argument i (must be 1 or 2)" );
6099
6100 if ( i == 1 ) {
6101 if ( _model_params.search2 != NOMAD::NO_MODEL )
6102 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6103 "NOMAD::Parameters::set_MODEL_SEARCH(1,m): already a second model search" );
6104
6105 _model_params.search1 = ms;
6106 }
6107 else {
6108
6109 if ( _model_params.search1 == NOMAD::NO_MODEL && ms != NOMAD::NO_MODEL )
6110 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6111 "NOMAD::Parameters::set_MODEL_SEARCH(2,m): no first model search" );
6112
6113 if ( _model_params.search1 != NOMAD::NO_MODEL && _model_params.search1 == ms )
6114 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6115 "NOMAD::Parameters::set_MODEL_SEARCH(2,m): second model search of the same type" );
6116
6117 _model_params.search2 = ms;
6118 }
6119 }
6120
6121 // set_MODEL_SEARCH (2/3):
set_MODEL_SEARCH(bool ms)6122 void NOMAD::Parameters::set_MODEL_SEARCH ( bool ms )
6123 {
6124 if ( ms ) {
6125 set_MODEL_SEARCH ( 1 , NOMAD::QUADRATIC_MODEL );
6126 set_MODEL_SEARCH ( 2 , NOMAD::NO_MODEL );
6127 }
6128 else {
6129 set_MODEL_SEARCH ( 1 , NOMAD::NO_MODEL );
6130 set_MODEL_SEARCH ( 2 , NOMAD::NO_MODEL );
6131 }
6132 }
6133
6134 // set_MODEL_SEARCH (3/3):
set_MODEL_SEARCH(NOMAD::model_type ms)6135 void NOMAD::Parameters::set_MODEL_SEARCH ( NOMAD::model_type ms )
6136 {
6137 set_MODEL_SEARCH ( 1 , ms );
6138 set_MODEL_SEARCH ( 2 , NOMAD::NO_MODEL );
6139 }
6140
6141
6142 // set_MODEL_EVAL_SORT (1/2):
set_MODEL_EVAL_SORT(NOMAD::model_type mes)6143 void NOMAD::Parameters::set_MODEL_EVAL_SORT ( NOMAD::model_type mes )
6144 {
6145 #ifndef USE_TGP
6146 if ( mes == NOMAD::TGP_MODEL )
6147 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6148 "invalid parameter: MODEL_EVAL_SORT: this version has not been compiled for TGP" );
6149 #endif
6150 _to_be_checked = true;
6151 _model_params.eval_sort = mes;
6152 }
6153
6154 // set_MODEL_EVAL_SORT (2/2):
set_MODEL_EVAL_SORT(bool mes)6155 void NOMAD::Parameters::set_MODEL_EVAL_SORT ( bool mes )
6156 {
6157 if ( mes )
6158 set_MODEL_EVAL_SORT ( NOMAD::QUADRATIC_MODEL );
6159 else
6160 set_MODEL_EVAL_SORT ( NOMAD::NO_MODEL );
6161 }
6162
6163
6164 // set_MODEL_SEARCH_OPTIMISTIC:
set_MODEL_SEARCH_OPTIMISTIC(bool mso)6165 void NOMAD::Parameters::set_MODEL_SEARCH_OPTIMISTIC ( bool mso )
6166 {
6167 _to_be_checked = true;
6168 _model_params.search_optimistic = mso;
6169 }
6170
6171 // set_MODEL_SEARCH_PROJ_TO_MESH:
set_MODEL_SEARCH_PROJ_TO_MESH(bool ptm)6172 void NOMAD::Parameters::set_MODEL_SEARCH_PROJ_TO_MESH ( bool ptm )
6173 {
6174 _to_be_checked = true;
6175 _model_params.search_proj_to_mesh = ptm;
6176 }
6177
6178 // set_MODEL_QUAD_RADIUS_FACTOR:
set_MODEL_QUAD_RADIUS_FACTOR(const NOMAD::Double & r)6179 void NOMAD::Parameters::set_MODEL_QUAD_RADIUS_FACTOR ( const NOMAD::Double & r )
6180 {
6181 _to_be_checked = true;
6182 _model_params.quad_radius_factor = r;
6183 }
6184
6185 // set_MODEL_QUAD_USE_WP:
set_MODEL_QUAD_USE_WP(bool uwp)6186 void NOMAD::Parameters::set_MODEL_QUAD_USE_WP ( bool uwp )
6187 {
6188 _to_be_checked = true;
6189 _model_params.quad_use_WP = uwp;
6190 }
6191
6192 // set_MODEL_QUAD_MAX_Y_SIZE:
set_MODEL_QUAD_MAX_Y_SIZE(int s)6193 void NOMAD::Parameters::set_MODEL_QUAD_MAX_Y_SIZE ( int s )
6194 {
6195 _to_be_checked = true;
6196 _model_params.quad_max_Y_size = s;
6197 }
6198
6199 // set_MODEL_QUAD_MIN_Y_SIZE:
set_MODEL_QUAD_MIN_Y_SIZE(int s)6200 void NOMAD::Parameters::set_MODEL_QUAD_MIN_Y_SIZE ( int s )
6201 {
6202 _to_be_checked = true;
6203 _model_params.quad_min_Y_size = (s < 0) ? -1 : s;
6204 }
6205
6206 // set_MODEL_QUAD_HYPERCUBE_LOWER_LIM:
set_MODEL_NP1_QUAD_EPSILON(const NOMAD::Double & d)6207 void NOMAD::Parameters::set_MODEL_NP1_QUAD_EPSILON ( const NOMAD::Double & d )
6208 {
6209 _to_be_checked = true;
6210 _model_params.model_np1_quad_epsilon = d;
6211 }
6212
6213
6214
6215 // set_MODEL_TGP_MODE:
set_MODEL_TGP_MODE(NOMAD::TGP_mode_type m)6216 void NOMAD::Parameters::set_MODEL_TGP_MODE ( NOMAD::TGP_mode_type m )
6217 {
6218 if ( m == NOMAD::TGP_USER ) {
6219 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6220 "invalid parameter: MODEL_TGP_MODE: the TGP user mode is only a debugging option" );
6221 }
6222
6223 _to_be_checked = true;
6224 _model_params.tgp_mode = m;
6225 }
6226
6227 // set_MODEL_TGP_REUSE_MODEL:
set_MODEL_TGP_REUSE_MODEL(bool rm)6228 void NOMAD::Parameters::set_MODEL_TGP_REUSE_MODEL ( bool rm )
6229 {
6230 _to_be_checked = true;
6231 _model_params.tgp_reuse_model = rm;
6232 }
6233
6234 // set_MODEL_SEARCH_MAX_TRIAL_PTS:
set_MODEL_SEARCH_MAX_TRIAL_PTS(int s)6235 void NOMAD::Parameters::set_MODEL_SEARCH_MAX_TRIAL_PTS ( int s )
6236 {
6237 _to_be_checked = true;
6238 _model_params.search_max_trial_pts = s;
6239 }
6240
6241 // set_MODEL_EVAL_SORT_CAUTIOUS:
set_MODEL_EVAL_SORT_CAUTIOUS(bool mesc)6242 void NOMAD::Parameters::set_MODEL_EVAL_SORT_CAUTIOUS ( bool mesc )
6243 {
6244 _to_be_checked = true;
6245 _model_params.eval_sort_cautious = mesc;
6246 }
6247
6248 // set_VNS_SEARCH (1/2):
set_VNS_SEARCH(bool s)6249 void NOMAD::Parameters::set_VNS_SEARCH ( bool s )
6250 {
6251 _to_be_checked = true;
6252 _VNS_search = s;
6253 _VNS_trigger = ( s ) ? 0.75 : NOMAD::Double();
6254 }
6255
6256 // set_VNS_SEARCH (2/2):
set_VNS_SEARCH(const NOMAD::Double & trigger)6257 void NOMAD::Parameters::set_VNS_SEARCH ( const NOMAD::Double & trigger )
6258 {
6259 _to_be_checked = true;
6260 if ( !trigger.is_defined() ) {
6261 _VNS_search = false;
6262 return;
6263 }
6264
6265 if ( trigger < 0.0 || trigger > 1.0 )
6266 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6267 "invalid parameter: VNS_SEARCH: must be in [0;1]" );
6268
6269 _VNS_search = ( trigger > 0.0 );
6270 _VNS_trigger = trigger;
6271 }
6272
6273 // set_LH_SEARCH:
set_LH_SEARCH(int p0,int pi)6274 void NOMAD::Parameters::set_LH_SEARCH ( int p0 , int pi )
6275 {
6276 _to_be_checked = true;
6277 _LH_search_p0 = (p0 <= 0 ) ? 0 : p0;
6278 _LH_search_pi = (pi <= 0 ) ? 0 : pi;
6279 }
6280
6281 // set_DIRECTION_TYPE (1/2):
set_DIRECTION_TYPE(NOMAD::direction_type dt)6282 void NOMAD::Parameters::set_DIRECTION_TYPE ( NOMAD::direction_type dt )
6283 {
6284 _to_be_checked = true;
6285 if ( dt == NOMAD::UNDEFINED_DIRECTION ||
6286 dt == NOMAD::NO_DIRECTION ||
6287 dt == NOMAD::MODEL_SEARCH_DIR )
6288 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6289 "invalid parameter: DIRECTION_TYPE" );
6290 _direction_types.insert ( dt );
6291 }
6292
6293 // set_DIRECTION_TYPE (2/2):
set_DIRECTION_TYPE(const std::set<NOMAD::direction_type> & dt)6294 void NOMAD::Parameters::set_DIRECTION_TYPE ( const std::set<NOMAD::direction_type> & dt )
6295 {
6296 std::set<NOMAD::direction_type>::const_iterator it , end = dt.end();
6297 for ( it = dt.begin() ; it != end ; ++it )
6298 set_DIRECTION_TYPE ( *it );
6299 }
6300
set_DIRECTION_TYPE_NO_MODEL(void)6301 void NOMAD::Parameters::set_DIRECTION_TYPE_NO_MODEL ( void )
6302 {
6303 std::set<NOMAD::direction_type>::iterator it=_direction_types.find(NOMAD::ORTHO_NP1_QUAD);
6304 std::set<NOMAD::direction_type>::iterator end = _direction_types.end();
6305 while (it != end)
6306 {
6307 _direction_types.erase(it);
6308 _direction_types.insert(NOMAD::ORTHO_NP1_NEG);
6309 it=_direction_types.find(NOMAD::ORTHO_NP1_QUAD);
6310 }
6311 }
6312
6313
6314 // set_SEC_POLL_DIR_TYPE (1/2):
set_SEC_POLL_DIR_TYPE(NOMAD::direction_type dt)6315 void NOMAD::Parameters::set_SEC_POLL_DIR_TYPE ( NOMAD::direction_type dt )
6316 {
6317 _to_be_checked = true;
6318 if ( dt == NOMAD::UNDEFINED_DIRECTION || dt == NOMAD::MODEL_SEARCH_DIR )
6319 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6320 "invalid parameter: SEC_POLL_DIR_TYPE" );
6321 _sec_poll_dir_types.insert ( dt );
6322 }
6323
6324 // set_SEC_POLL_DIR_TYPE (2/2):
set_SEC_POLL_DIR_TYPE(const std::set<NOMAD::direction_type> & dt)6325 void NOMAD::Parameters::set_SEC_POLL_DIR_TYPE
6326 ( const std::set<NOMAD::direction_type> & dt ) {
6327 std::set<NOMAD::direction_type>::const_iterator it , end = dt.end();
6328 for ( it = dt.begin() ; it != end ; ++it )
6329 set_SEC_POLL_DIR_TYPE ( *it );
6330 }
6331
6332
6333 // set_RHO:
set_RHO(const NOMAD::Double & rho)6334 void NOMAD::Parameters::set_RHO ( const NOMAD::Double & rho )
6335 {
6336 if ( !rho.is_defined() )
6337 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: RHO" );
6338 _to_be_checked = true;
6339 _rho = rho;
6340 }
6341
6342 // set_H_MIN:
set_H_MIN(const NOMAD::Double & h_min)6343 void NOMAD::Parameters::set_H_MIN ( const NOMAD::Double & h_min )
6344 {
6345 if ( !h_min.is_defined() )
6346 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , "invalid parameter: H_MIN" );
6347 _to_be_checked = true;
6348 _h_min = h_min;
6349 }
6350
6351 // set_H_MAX_0:
set_H_MAX_0(const NOMAD::Double & h_max)6352 void NOMAD::Parameters::set_H_MAX_0 ( const NOMAD::Double & h_max )
6353 {
6354 _to_be_checked = true;
6355 _h_max_0 = ( h_max.is_defined() ) ? h_max : NOMAD::INF;
6356 }
6357
6358 // set_H_NORM:
set_H_NORM(NOMAD::hnorm_type h_norm)6359 void NOMAD::Parameters::set_H_NORM ( NOMAD::hnorm_type h_norm )
6360 {
6361 _to_be_checked = true;
6362 _h_norm = h_norm;
6363 }
6364
6365 // set_SCALING (1/2):
set_SCALING(int index,const NOMAD::Double & value)6366 void NOMAD::Parameters::set_SCALING ( int index , const NOMAD::Double & value )
6367 {
6368 _to_be_checked = true;
6369 if ( index < 0 )
6370 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6371 "invalid parameter: SCALING" );
6372 if ( index >= _scaling.size() )
6373 _scaling.resize ( index + 1 );
6374
6375 _scaling[index] = value;
6376 }
6377
6378 // set_SCALING (2/2):
set_SCALING(const NOMAD::Point & s)6379 void NOMAD::Parameters::set_SCALING ( const NOMAD::Point & s )
6380 {
6381 _to_be_checked = true;
6382 _scaling = s;
6383 }
6384
6385 // set_FIXED_VARIABLE (1/3):
set_FIXED_VARIABLE(int index,const NOMAD::Double & value)6386 void NOMAD::Parameters::set_FIXED_VARIABLE ( int index , const NOMAD::Double & value )
6387 {
6388 _to_be_checked = true;
6389 if ( index < 0 )
6390 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6391 "invalid parameter: FIXED_VARIABLE" );
6392 if ( index >= _fixed_variables.size() )
6393 _fixed_variables.resize ( index + 1 );
6394
6395 _fixed_variables[index] = value;
6396 }
6397
6398 // set_FIXED_VARIABLE (2/3):
set_FIXED_VARIABLE(int index)6399 void NOMAD::Parameters::set_FIXED_VARIABLE ( int index )
6400 {
6401 _to_be_checked = true;
6402 if ( index < 0 )
6403 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6404 "invalid parameter: FIXED_VARIABLE (index < 0)" );
6405 if ( _x0s.empty() )
6406 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6407 "invalid parameter: FIXED_VARIABLE (no starting point defined)" );
6408
6409 if ( index >= _x0s[0]->size() )
6410 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6411 "invalid parameter: FIXED_VARIABLE (incompatible starting point)" );
6412
6413 if ( index >= _fixed_variables.size() )
6414 _fixed_variables.resize ( index + 1 );
6415
6416 _fixed_variables[index] = (*_x0s[0])[index];
6417 }
6418
6419 // set_FIXED_VARIABLE (2/3):
set_FIXED_VARIABLE(const NOMAD::Point & fv)6420 void NOMAD::Parameters::set_FIXED_VARIABLE ( const NOMAD::Point & fv )
6421 {
6422 _to_be_checked = true;
6423 _fixed_variables = fv;
6424 }
6425
6426 // set_LOWER_BOUND (1/2):
set_LOWER_BOUND(int index,const NOMAD::Double & value)6427 void NOMAD::Parameters::set_LOWER_BOUND ( int index, const NOMAD::Double & value )
6428 {
6429 _to_be_checked = true;
6430 if (index < 0)
6431 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6432 "invalid parameter: LOWER_BOUND" );
6433 if ( index >= _lb.size() )
6434 _lb.resize(index+1);
6435 if ( !_lb[index].is_defined() || value > _lb[index] )
6436 _lb[index] = value;
6437 }
6438
6439 // set_LOWER_BOUND (2/2):
set_LOWER_BOUND(const NOMAD::Point & lb)6440 void NOMAD::Parameters::set_LOWER_BOUND ( const NOMAD::Point & lb )
6441 {
6442 _to_be_checked = true;
6443 _lb = lb;
6444 }
6445
6446 // set_UPPER_BOUND (1/2):
set_UPPER_BOUND(int index,const NOMAD::Double & value)6447 void NOMAD::Parameters::set_UPPER_BOUND ( int index, const NOMAD::Double & value )
6448 {
6449 _to_be_checked = true;
6450 if (index < 0)
6451 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6452 "invalid parameter: UPPER_BOUND" );
6453 if ( index >= _ub.size() )
6454 _ub.resize (index + 1);
6455 if ( !_ub[index].is_defined() || value < _ub[index] )
6456 _ub[index] = value;
6457 }
6458
6459 // set_UPPER_BOUND (2/2):
set_UPPER_BOUND(const NOMAD::Point & ub)6460 void NOMAD::Parameters::set_UPPER_BOUND ( const NOMAD::Point & ub )
6461 {
6462 _to_be_checked = true;
6463 _ub = ub;
6464 }
6465
6466 // set_SGTE_COST:
set_SGTE_COST(int c)6467 void NOMAD::Parameters::set_SGTE_COST ( int c )
6468 {
6469 _to_be_checked = true;
6470 _sgte_cost = ( c > 0 ) ? c : -1;
6471 }
6472
6473 // set_SGTE_EVAL_SORT:
set_SGTE_EVAL_SORT(bool ses)6474 void NOMAD::Parameters::set_SGTE_EVAL_SORT ( bool ses )
6475 {
6476 _to_be_checked = true;
6477 _sgte_eval_sort = ses;
6478 }
6479
6480 // set_HAS_SGTET:
set_HAS_SGTE(bool hs)6481 void NOMAD::Parameters::set_HAS_SGTE ( bool hs )
6482 {
6483 _to_be_checked = true;
6484 _has_sgte = hs;
6485 }
6486
6487 // set_OPT_ONLY_SGTE:
set_OPT_ONLY_SGTE(bool oos)6488 void NOMAD::Parameters::set_OPT_ONLY_SGTE ( bool oos )
6489 {
6490 _to_be_checked = true;
6491 _opt_only_sgte = oos;
6492 }
6493
6494 // set_SGTE_EXE:
set_SGTE_EXE(const std::string & bb_exe,const std::string & sgte_exe)6495 void NOMAD::Parameters::set_SGTE_EXE ( const std::string & bb_exe ,
6496 const std::string & sgte_exe )
6497 {
6498 _to_be_checked = true;
6499 _sgte_exe[bb_exe] = sgte_exe;
6500 }
6501
6502 // set_BB_EXE (1/3):
set_BB_EXE(const std::string & bbexe)6503 void NOMAD::Parameters::set_BB_EXE ( const std::string & bbexe )
6504 {
6505 _to_be_checked = true;
6506 if ( _bb_output_type.empty() )
6507 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6508 "invalid parameter: BB_EXE - BB_OUTPUT_TYPE must be defined first" );
6509 _bb_exe.clear();
6510 size_t nk = _bb_output_type.size();
6511 for ( size_t k = 0 ; k < nk ; ++k )
6512 _bb_exe.push_back ( bbexe );
6513 }
6514
6515 // set_BB_EXE (2/3):
set_BB_EXE(int m,const std::string * bbexe)6516 void NOMAD::Parameters::set_BB_EXE ( int m , const std::string * bbexe )
6517 {
6518 _to_be_checked = true;
6519
6520 if ( m <= 0 )
6521 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6522 "invalid parameter: BB_EXE" );
6523
6524 if ( m != static_cast<int>(_bb_output_type.size()) )
6525 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6526 "invalid parameter: BB_EXE - number of names or BB_OUTPUT_TYPE undefined" );
6527
6528 size_t nk = _bb_output_type.size();
6529 for ( size_t k = 0 ; k < nk ; ++k )
6530 _bb_exe.push_back ( bbexe[k] );
6531 }
6532
6533 // set_BB_EXE (3/3):
set_BB_EXE(const std::list<std::string> & bbexe)6534 void NOMAD::Parameters::set_BB_EXE ( const std::list<std::string> & bbexe )
6535 {
6536 _to_be_checked = true;
6537 if ( !bbexe.empty() && bbexe.size() != _bb_output_type.size() )
6538 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6539 "invalid parameter: BB_EXE - number of names or BB_OUTPUT_TYPE undefined" );
6540 _bb_exe = bbexe;
6541 }
6542
6543 // set_BB_INPUT_INCLUDE_TAG:
set_BB_INPUT_INCLUDE_TAG(bool bbiit)6544 void NOMAD::Parameters::set_BB_INPUT_INCLUDE_TAG ( bool bbiit )
6545 {
6546 _to_be_checked = true;
6547 _bb_input_include_tag = bbiit;
6548 }
6549
6550 // set_BB_INPUT_INCLUDE_SEED:
set_BB_INPUT_INCLUDE_SEED(bool bbiis)6551 void NOMAD::Parameters::set_BB_INPUT_INCLUDE_SEED ( bool bbiis )
6552 {
6553 _to_be_checked = true;
6554 _bb_input_include_seed = bbiis;
6555 }
6556
6557 // set_BB_REDIRECTION:
set_BB_REDIRECTION(bool bbr)6558 void NOMAD::Parameters::set_BB_REDIRECTION ( bool bbr )
6559 {
6560 _to_be_checked = true;
6561 _bb_redirection = bbr;
6562 }
6563
6564 // set_BB_INPUT_TYPE (1/3):
set_BB_INPUT_TYPE(int index,NOMAD::bb_input_type bbit)6565 void NOMAD::Parameters::set_BB_INPUT_TYPE ( int index , NOMAD::bb_input_type bbit )
6566 {
6567 _to_be_checked = true;
6568 if ( index < 0 || index >= _dimension ||
6569 static_cast<int>(_bb_input_type.size()) != _dimension )
6570 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6571 "invalid parameter: BB_INPUT_TYPE" );
6572 _bb_input_type[index] = bbit;
6573 }
6574
6575 // set_BB_INPUT_TYPE (2/3):
set_BB_INPUT_TYPE(const std::vector<NOMAD::bb_input_type> & bbit)6576 void NOMAD::Parameters::set_BB_INPUT_TYPE
6577 ( const std::vector<NOMAD::bb_input_type > & bbit )
6578 {
6579 int n = static_cast<int>(bbit.size());
6580 for ( int i = 0 ; i < n ; ++i )
6581 set_BB_INPUT_TYPE ( i , bbit[i] );
6582 }
6583
6584 // set_BB_INPUT_TYPE (3/3):
set_BB_INPUT_TYPE(const std::list<NOMAD::bb_input_type> & bbit)6585 void NOMAD::Parameters::set_BB_INPUT_TYPE
6586 ( const std::list<NOMAD::bb_input_type > & bbit )
6587 {
6588 int i = 0;
6589 std::list<NOMAD::bb_input_type>::const_iterator it , end = bbit.end();
6590 for ( it = bbit.begin() ; it != end ; ++it , ++i )
6591 set_BB_INPUT_TYPE ( i , *it );
6592 }
6593
6594 // reset_PEB_changes:
reset_PEB_changes(void) const6595 void NOMAD::Parameters::reset_PEB_changes ( void ) const
6596 {
6597 size_t nk = _bb_output_type.size();
6598 for ( size_t k = 0 ; k < nk ; ++k )
6599 if ( _bb_output_type[k] == NOMAD::PEB_E )
6600 _bb_output_type[k] = NOMAD::PEB_P;
6601 }
6602
6603 // change PEB to PB constraints
change_PEB_to_PB(void)6604 void NOMAD::Parameters::change_PEB_to_PB ( void )
6605 {
6606 size_t nk = _bb_output_type.size();
6607 for ( size_t k = 0 ; k < nk ; ++k )
6608 if ( _bb_output_type[k] == NOMAD::PEB_P || _bb_output_type[k] == NOMAD::PEB_E )
6609 {
6610 _bb_output_type[k] = NOMAD::PB;
6611 _barrier_type = NOMAD::PB;
6612 }
6613 }
6614
6615
6616
6617 // change_PEB_constraint_status:
change_PEB_constraint_status(int index) const6618 void NOMAD::Parameters::change_PEB_constraint_status ( int index ) const
6619 {
6620 if ( index < 0 ||
6621 index >= static_cast<int>(_bb_output_type.size()) ||
6622 _bb_output_type[index] != NOMAD::PEB_P )
6623 throw NOMAD::Exception ( "Parameters.cpp" , __LINE__ ,
6624 "error in Parameters::change_PEB_constraint_status(i): bad i" );
6625 _bb_output_type[index] = NOMAD::PEB_E;
6626 }
6627
6628 // set_BB_OUTPUT_TYPE (1/2):
set_BB_OUTPUT_TYPE(const std::list<NOMAD::bb_output_type> & bbot)6629 void NOMAD::Parameters::set_BB_OUTPUT_TYPE
6630 ( const std::list<NOMAD::bb_output_type> & bbot )
6631 {
6632 int i = 0;
6633 std::vector<NOMAD::bb_output_type> bbot_vector ( bbot.size() );
6634 std::list<NOMAD::bb_output_type>::const_iterator end = bbot.end() , it;
6635 for ( it = bbot.begin() ; it != end ; ++it )
6636 bbot_vector[i++] = *it;
6637 set_BB_OUTPUT_TYPE ( bbot_vector );
6638 }
6639
6640 // set_BB_OUTPUT_TYPE (2/2):
set_BB_OUTPUT_TYPE(const std::vector<NOMAD::bb_output_type> & bbot)6641 void NOMAD::Parameters::set_BB_OUTPUT_TYPE
6642 ( const std::vector<NOMAD::bb_output_type> & bbot )
6643 {
6644 _to_be_checked = true;
6645
6646 _barrier_type = NOMAD::EB;
6647 _has_constraints = false;
6648 _has_EB_constraints = false;
6649 _has_filter_constraints = false;
6650
6651 _bb_output_type.clear();
6652
6653 int m = static_cast<int>(bbot.size());
6654
6655 if ( m <= 0 )
6656 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6657 "invalid parameter: BB_OUTPUT_TYPE" );
6658 if ( !_bb_output_type.empty() &&
6659 m != static_cast<int>(_bb_output_type.size()) )
6660 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6661 "invalid parameter: BB_OUTPUT_TYPE - number of types" );
6662
6663 _bb_output_type.resize (m);
6664
6665 bool filter_used = false;
6666 bool pb_used = false;
6667 bool peb_used = false;
6668
6669 _index_obj.clear();
6670
6671 for ( int i = 0 ; i < m ; ++i )
6672 {
6673
6674 _bb_output_type[i] = bbot[i];
6675
6676 switch ( bbot[i] )
6677 {
6678
6679 case NOMAD::OBJ:
6680 _index_obj.push_back(i);
6681 break;
6682
6683 case NOMAD::EB:
6684 _has_constraints = true;
6685 _has_EB_constraints = true;
6686 break;
6687
6688 case NOMAD::FILTER:
6689 _has_constraints = true;
6690 _has_filter_constraints = true;
6691 filter_used = true;
6692 break;
6693
6694 case NOMAD::PB:
6695 _has_constraints = true;
6696 _has_filter_constraints = true;
6697 pb_used = true;
6698 break;
6699
6700 case NOMAD::PEB_P:
6701 case NOMAD::PEB_E:
6702 _has_constraints = true;
6703 _has_filter_constraints = true;
6704 pb_used = true;
6705 peb_used = true;
6706 _bb_output_type[i] = NOMAD::PEB_P;
6707 break;
6708 default:
6709 break;
6710 }
6711 }
6712
6713 if ( _index_obj.empty() )
6714 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6715 "invalid parameter: BB_OUTPUT_TYPE - OBJ not given" );
6716 if ( filter_used && pb_used )
6717 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6718 "invalid parameter: BB_OUTPUT_TYPE - F and PB/PEB used together" );
6719
6720 if ( filter_used )
6721 _barrier_type = NOMAD::FILTER;
6722 else if ( pb_used )
6723 _barrier_type = (peb_used) ? NOMAD::PEB_P : NOMAD::PB;
6724 }
6725
6726 // set_PROBLEM_DIR:
set_PROBLEM_DIR(const std::string & dir)6727 void NOMAD::Parameters::set_PROBLEM_DIR ( const std::string & dir )
6728 {
6729 _to_be_checked = true;
6730 _problem_dir = dir;
6731 if ( !_problem_dir.empty() && !NOMAD::Parameters::check_directory ( _problem_dir ) )
6732 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6733 "invalid parameter: PROBLEM_DIR" );
6734 }
6735
6736 // set_TMP_DIR:
set_TMP_DIR(const std::string & dir)6737 void NOMAD::Parameters::set_TMP_DIR ( const std::string & dir )
6738 {
6739 _to_be_checked = true;
6740 _tmp_dir = dir;
6741 if ( !_tmp_dir.empty() && !NOMAD::Parameters::check_directory ( _tmp_dir ) )
6742 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6743 "invalid parameter: TMP_DIR" );
6744 }
6745
6746 // set_ADD_SEED_TO_FILE_NAMES:
set_ADD_SEED_TO_FILE_NAMES(bool astfn)6747 void NOMAD::Parameters::set_ADD_SEED_TO_FILE_NAMES ( bool astfn )
6748 {
6749 _to_be_checked = true;
6750 _add_seed_to_file_names = astfn;
6751 }
6752
6753 // set_SOLUTION_FILE:
set_SOLUTION_FILE(const std::string & sf)6754 void NOMAD::Parameters::set_SOLUTION_FILE ( const std::string & sf )
6755 {
6756 _to_be_checked = true;
6757 _solution_file = sf;
6758 if ( sf.empty() )
6759 return;
6760 if ( !NOMAD::Parameters::check_directory ( _solution_file ) )
6761 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6762 "invalid parameter: SOLUTION_FILE" );
6763 _solution_file.resize ( _solution_file.size()-1 );
6764 }
6765
6766 // set_HISTORY_FILE:
set_HISTORY_FILE(const std::string & hf)6767 void NOMAD::Parameters::set_HISTORY_FILE ( const std::string & hf )
6768 {
6769 _to_be_checked = true;
6770 _history_file = hf;
6771 if ( hf.empty() )
6772 return;
6773 if ( !NOMAD::Parameters::check_directory ( _history_file ) )
6774 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6775 "invalid parameter: HISTORY_FILE" );
6776 _history_file.resize ( _history_file.size()-1 );
6777 }
6778
6779 // set_CACHE_FILE:
set_CACHE_FILE(const std::string & cf)6780 void NOMAD::Parameters::set_CACHE_FILE ( const std::string & cf )
6781 {
6782 _to_be_checked = true;
6783 _cache_file = cf;
6784 if ( cf.empty() )
6785 return;
6786 if ( !NOMAD::Parameters::check_directory ( _cache_file ) )
6787 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6788 "invalid parameter: CACHE_FILE" );
6789 _cache_file.resize ( _cache_file.size()-1 );
6790 }
6791
6792 // set_SGTE_CACHE_FILE:
set_SGTE_CACHE_FILE(const std::string & cf)6793 void NOMAD::Parameters::set_SGTE_CACHE_FILE ( const std::string & cf )
6794 {
6795 _to_be_checked = true;
6796 _sgte_cache_file = cf;
6797 if ( cf.empty() )
6798 return;
6799 if ( !NOMAD::Parameters::check_directory ( _sgte_cache_file ) ) {
6800 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6801 "invalid parameter: SGTE_CACHE_FILE");
6802 }
6803 _sgte_cache_file.resize ( _sgte_cache_file.size()-1 );
6804 }
6805
6806 // set_X0:
6807 // add a new point in the list of starting points:
set_X0(const NOMAD::Point & x0)6808 void NOMAD::Parameters::set_X0 ( const NOMAD::Point & x0 )
6809 {
6810 _to_be_checked = true;
6811 _x0s.push_back ( new NOMAD::Point ( x0 ) );
6812 }
6813
6814 // indicate a x0 file or a cache file containing starting points:
set_X0(const std::string & file_name)6815 void NOMAD::Parameters::set_X0 ( const std::string & file_name )
6816 {
6817 _to_be_checked = true;
6818
6819 if ( file_name.empty() )
6820 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6821 "Parameters::set_X0(file_name): file_name is empty" );
6822
6823 if ( _dimension <= 0 )
6824 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6825 "Parameters::set_X0() has been used before setting DIMENSION" );
6826
6827 NOMAD::Point tmp_x0 ( _dimension );
6828 std::string complete_file_name = _problem_dir + file_name;
6829 std::ifstream fin ( complete_file_name.c_str() );
6830
6831 if ( fin.fail() ) {
6832 std::string err = "invalid parameter: X0 - could not open file \'"
6833 + complete_file_name + "\'";
6834 fin.close();
6835 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ , err );
6836 }
6837
6838 bool flag = true;
6839 try {
6840 fin >> tmp_x0;
6841 }
6842 catch ( NOMAD::Point::Bad_Input & ) {
6843 flag = false;
6844
6845 // we suppose that the file name corresponds to a cache file:
6846 _x0_cache_file = file_name;
6847 }
6848
6849 while ( flag ) {
6850
6851 set_X0 ( tmp_x0 );
6852
6853 // other starting points in the file ?
6854 flag = true;
6855 try {
6856 fin >> tmp_x0;
6857 }
6858 catch ( NOMAD::Point::Bad_Input & ) {
6859 flag = false;
6860 }
6861 }
6862
6863 fin.close();
6864 }
6865
6866 // set_DISPLAY_ALL_EVAL:
set_DISPLAY_ALL_EVAL(bool dae)6867 void NOMAD::Parameters::set_DISPLAY_ALL_EVAL ( bool dae )
6868 {
6869 _to_be_checked = true;
6870 _display_all_eval = dae;
6871 }
6872
6873 // set_DISPLAY_STATS (1/2):
set_DISPLAY_STATS(const std::list<std::string> & ls)6874 void NOMAD::Parameters::set_DISPLAY_STATS ( const std::list<std::string> & ls )
6875 {
6876 _display_stats.clear();
6877 _display_stats = ls;
6878 }
6879
6880 // set_DISPLAY_STATS (2/2):
set_DISPLAY_STATS(const std::string & stats)6881 void NOMAD::Parameters::set_DISPLAY_STATS ( const std::string & stats )
6882 {
6883 if ( stats.empty() ) {
6884 _display_stats.clear();
6885 return;
6886 }
6887
6888 NOMAD::Parameter_Entry pe ( "DISPLAY_STATS " + stats , false );
6889
6890 std::list<std::string>::const_iterator end = pe.get_values().end() ,
6891 it = pe.get_values().begin();
6892 std::list<std::string> ls;
6893
6894 while ( it != end ) {
6895 ls.push_back ( *it );
6896 ++it;
6897 }
6898
6899 ls.resize ( ls.size()-1 );
6900
6901 set_DISPLAY_STATS ( ls );
6902 }
6903
6904 // set_STATS_FILE (1/2):
set_STATS_FILE(const std::string & file_name,const std::list<std::string> & ls)6905 void NOMAD::Parameters::set_STATS_FILE ( const std::string & file_name ,
6906 const std::list<std::string> & ls )
6907 {
6908 if ( file_name.empty() ) {
6909 reset_stats_file();
6910 return;
6911 }
6912
6913 _to_be_checked = true;
6914 _stats_file = ls;
6915 _stats_file_name = file_name;
6916
6917 if ( !NOMAD::Parameters::check_directory ( _stats_file_name ) )
6918 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
6919 "invalid parameter: STATS_FILE" );
6920
6921 _stats_file_name.resize ( _stats_file_name.size()-1 );
6922 }
6923
6924 // set_STATS_FILE (2/2):
set_STATS_FILE(const std::string & file_name,const std::string & stats)6925 void NOMAD::Parameters::set_STATS_FILE ( const std::string & file_name ,
6926 const std::string & stats )
6927 {
6928 NOMAD::Parameter_Entry pe ( "STATS_FILE " + file_name + " " + stats , false );
6929 std::list<std::string>::const_iterator end = pe.get_values().end() ,
6930 it = pe.get_values().begin();
6931 std::list<std::string> ls;
6932 ++it;
6933 while ( it != end ) {
6934 ls.push_back(*it);
6935 ++it;
6936 }
6937
6938 ls.resize ( ls.size()-1 );
6939
6940 set_STATS_FILE ( file_name , ls );
6941 }
6942
6943 // set_DISPLAY_DEGREE (1/3) - (accepts also dd_type arguments):
set_DISPLAY_DEGREE(int dd)6944 bool NOMAD::Parameters::set_DISPLAY_DEGREE ( int dd )
6945 {
6946 #ifndef DEBUG
6947 return set_DISPLAY_DEGREE ( NOMAD::itos(dd) );
6948 #endif
6949 return true;
6950 }
6951
6952 // set_DISPLAY_DEGREE (2/3):
set_DISPLAY_DEGREE(const std::string & dd)6953 bool NOMAD::Parameters::set_DISPLAY_DEGREE ( const std::string & dd )
6954 {
6955 #ifndef DEBUG
6956 {
6957 std::string ddu = dd;
6958 NOMAD::toupper ( ddu );
6959
6960 if ( ddu == "NO" || ddu == "NO_DISPLAY" ) {
6961 set_DISPLAY_DEGREE ( 0 , 0 , 0 , 0 );
6962 return true;
6963 }
6964 else if ( ddu == "MIN" || ddu == "MINIMAL" || ddu == "MINIMAL_DISPLAY" ) {
6965 set_DISPLAY_DEGREE ( 1 , 1 , 1 , 1 );
6966 return true;
6967 }
6968
6969 else if ( ddu == "NORMAL" || ddu == "NORMAL_DISPLAY" ) {
6970 set_DISPLAY_DEGREE ( 2 , 2 , 2 , 2 );
6971 return true;
6972 }
6973
6974 else if ( ddu == "FULL" || ddu == "FULL_DISPLAY" ) {
6975 set_DISPLAY_DEGREE ( 3 , 3 , 3 , 3 );
6976 return true;
6977 }
6978 }
6979
6980 if ( dd.size() == 1 ) {
6981 int i;
6982 if ( !NOMAD::atoi ( dd[0] , i ) )
6983 return false;
6984 _out.set_degrees ( NOMAD::Display::int_to_dd(i) );
6985 return true;
6986 }
6987
6988 if ( dd.size() != 4 )
6989 return false;
6990
6991 // 1. general display:
6992 int gdd;
6993 if ( !NOMAD::atoi ( dd[0] , gdd ) )
6994 return false;
6995
6996 // 2. search display:
6997 int sdd;
6998 if ( !NOMAD::atoi ( dd[1] , sdd ) )
6999 return false;
7000
7001 // 3. poll display:
7002 int pdd;
7003 if ( !NOMAD::atoi ( dd[2] , pdd ) )
7004 return false;
7005
7006 // 4. iterative display:
7007 int idd;
7008 if ( !NOMAD::atoi ( dd[3] , idd ) )
7009 return false;
7010
7011 set_DISPLAY_DEGREE ( gdd , sdd , pdd , idd );
7012
7013 #endif
7014 return true;
7015 }
7016
7017 // set_DISPLAY_DEGREE (3/3):
set_DISPLAY_DEGREE(int gen_dd,int search_dd,int poll_dd,int iter_dd)7018 void NOMAD::Parameters::set_DISPLAY_DEGREE ( int gen_dd ,
7019 int search_dd ,
7020 int poll_dd ,
7021 int iter_dd )
7022 {
7023 #ifndef DEBUG
7024 _out.set_degrees ( NOMAD::Display::int_to_dd ( gen_dd ) ,
7025 NOMAD::Display::int_to_dd ( search_dd ) ,
7026 NOMAD::Display::int_to_dd ( poll_dd ) ,
7027 NOMAD::Display::int_to_dd ( iter_dd ) );
7028 #endif
7029 }
7030
7031 // set_OPEN_BRACE:
set_OPEN_BRACE(const std::string & ob)7032 void NOMAD::Parameters::set_OPEN_BRACE ( const std::string & ob )
7033 {
7034 _to_be_checked = true;
7035 _out.set_open_brace ( ob );
7036 }
7037
7038 // set_CLOSED_BRACE:
set_CLOSED_BRACE(const std::string & cb)7039 void NOMAD::Parameters::set_CLOSED_BRACE ( const std::string & cb )
7040 {
7041 _to_be_checked = true;
7042 _out.set_closed_brace ( cb );
7043 }
7044
7045 // set_SEED:
set_SEED(int t)7046 void NOMAD::Parameters::set_SEED ( int t )
7047 {
7048 _to_be_checked = true;
7049 _seed = ( t < 0 ) ? NOMAD::get_pid() : t;
7050
7051 if ( t < 0 && t!=-1 && _out.get_gen_dd()>=NOMAD::NORMAL_DISPLAY && !_warning_has_been_displayed)
7052 _out << NOMAD::open_block("Warning:")
7053 << "Seed should be in the interval [0;INT_MAX] U {-1}. The seed is set to the process id!" << std::endl
7054 << NOMAD::close_block();
7055
7056 // The RNG seed is set here when explicit set is required otherwise default RNG seed is used
7057 NOMAD::RNG::set_seed(_seed);
7058
7059 }
7060
7061 // set_MAX_EVAL:
set_MAX_EVAL(int e)7062 void NOMAD::Parameters::set_MAX_EVAL ( int e )
7063 {
7064 _to_be_checked = true;
7065 _max_eval = ( e <= 0 ) ? -1 : e;
7066 }
7067
7068 // set_MAX_BB_EVAL:
set_MAX_BB_EVAL(int bbe)7069 void NOMAD::Parameters::set_MAX_BB_EVAL ( int bbe )
7070 {
7071 _to_be_checked = true;
7072 _max_bbe_decided = true;
7073 _max_bb_eval = ( bbe < 0 ) ? -1 : bbe;
7074 }
7075
7076 // set_MAX_SIM_BB_EVAL:
set_MAX_SIM_BB_EVAL(int bbe)7077 void NOMAD::Parameters::set_MAX_SIM_BB_EVAL ( int bbe )
7078 {
7079 _to_be_checked = true;
7080 _max_sim_bb_eval = ( bbe <= 0 ) ? -1 : bbe;
7081 }
7082
7083 // set_MAX_SGTE_EVAL:
set_MAX_SGTE_EVAL(int bbe)7084 void NOMAD::Parameters::set_MAX_SGTE_EVAL ( int bbe )
7085 {
7086 _to_be_checked = true;
7087 _sgte_max_eval = ( bbe < 0 ) ? -1 : bbe;
7088 }
7089
7090 // set_MAX_TIME:
set_MAX_TIME(int t)7091 void NOMAD::Parameters::set_MAX_TIME ( int t )
7092 {
7093 _to_be_checked = true;
7094 _max_time = ( t <= 0 ) ? -1 : t;
7095 }
7096
7097 // set_MAX_ITERATIONS:
set_MAX_ITERATIONS(int it)7098 void NOMAD::Parameters::set_MAX_ITERATIONS ( int it )
7099 {
7100 _to_be_checked = true;
7101 _max_iterations = ( it < 0 ) ? -1 : it;
7102 }
7103
7104 // set_MAX_CONSECUTIVE_FAILED_ITERATIONS:
set_MAX_CONSECUTIVE_FAILED_ITERATIONS(int it)7105 void NOMAD::Parameters::set_MAX_CONSECUTIVE_FAILED_ITERATIONS ( int it )
7106 {
7107 _to_be_checked = true;
7108 _max_cons_failed_it = ( it <= 0 ) ? -1 : it;
7109 }
7110
7111 // set_MAX_CACHE_MEMORY::
set_MAX_CACHE_MEMORY(float mcm)7112 void NOMAD::Parameters::set_MAX_CACHE_MEMORY ( float mcm )
7113 {
7114 _to_be_checked = true;
7115 _max_cache_memory = ( mcm < 0.0 ) ? -1 : mcm;
7116 }
7117
7118 // set_CACHE_SAVE_PERIOD:
set_CACHE_SAVE_PERIOD(int csp)7119 void NOMAD::Parameters::set_CACHE_SAVE_PERIOD ( int csp )
7120 {
7121 _to_be_checked = true;
7122 _cache_save_period = ( csp <= 0 ) ? -1 : csp;
7123 }
7124
7125 // set_STOP_IF_FEASIBLE:
set_STOP_IF_FEASIBLE(bool sif)7126 void NOMAD::Parameters::set_STOP_IF_FEASIBLE ( bool sif )
7127 {
7128 _to_be_checked = true;
7129 _stop_if_feasible = sif;
7130 }
7131
7132 // set_F_TARGET (1/2):
set_F_TARGET(const NOMAD::Double & f_target)7133 void NOMAD::Parameters::set_F_TARGET ( const NOMAD::Double & f_target )
7134 {
7135 _to_be_checked = true;
7136 _f_target = NOMAD::Point ( 1 , f_target );
7137 }
7138
7139 // set_F_TARGET (2/2):
set_F_TARGET(const NOMAD::Point & f_target)7140 void NOMAD::Parameters::set_F_TARGET ( const NOMAD::Point & f_target )
7141 {
7142 _to_be_checked = true;
7143 _f_target = f_target;
7144 }
7145
7146 // set_STAT_SUM_TARGET:
set_STAT_SUM_TARGET(const NOMAD::Double & sst)7147 void NOMAD::Parameters::set_STAT_SUM_TARGET ( const NOMAD::Double & sst )
7148 {
7149 _to_be_checked = true;
7150 _stat_sum_target = sst;
7151 }
7152
7153 // set_L_CURVE_TARGET:
set_L_CURVE_TARGET(const NOMAD::Double & lct)7154 void NOMAD::Parameters::set_L_CURVE_TARGET ( const NOMAD::Double & lct )
7155 {
7156 _to_be_checked = true;
7157 _L_curve_target = lct;
7158 }
7159
7160 // set_ANISOTROPIC_MESH:
set_ANISOTROPIC_MESH(bool anis)7161 void NOMAD::Parameters::set_ANISOTROPIC_MESH ( bool anis )
7162 {
7163 _to_be_checked = true;
7164 _anisotropic_mesh = anis;
7165 }
7166
7167
7168 // set_USE_SMESH:
set_USE_SMESH(bool use_smesh)7169 void NOMAD::Parameters::set_USE_SMESH ( bool use_smesh )
7170 {
7171 _to_be_checked = true;
7172 _use_smesh = use_smesh;
7173 }
7174
7175
7176
7177 // set_MESH_UPDATE_BASIS:
set_MESH_UPDATE_BASIS(const NOMAD::Double & mub)7178 void NOMAD::Parameters::set_MESH_UPDATE_BASIS ( const NOMAD::Double & mub )
7179 {
7180 if ( !mub.is_defined() )
7181 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7182 "invalid parameter: MESH_UPDATE_BASIS" );
7183 _to_be_checked = true;
7184 _mesh_update_basis = mub;
7185 }
7186
7187 // set_POLL_UPDATE_BASIS:
set_POLL_UPDATE_BASIS(const NOMAD::Double & pub)7188 void NOMAD::Parameters::set_POLL_UPDATE_BASIS ( const NOMAD::Double & pub )
7189 {
7190 if ( !pub.is_defined() )
7191 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7192 "invalid parameter: POLL_UPDATE_BASIS" );
7193 _to_be_checked = true;
7194 _poll_update_basis = pub;
7195 }
7196
7197
7198 // set_INITIAL_MESH_INDEX:
set_INITIAL_MESH_INDEX(int ell_0)7199 void NOMAD::Parameters::set_INITIAL_MESH_INDEX ( int ell_0 )
7200 {
7201 _to_be_checked = true;
7202 if ( ell_0 > NOMAD::L_LIMITS )
7203 ell_0 = NOMAD::L_LIMITS;
7204 else if ( ell_0 < - NOMAD::L_LIMITS )
7205 ell_0 = -NOMAD::L_LIMITS;
7206 _initial_mesh_index = ell_0;
7207 }
7208
7209 // set_MESH_COARSENING_EXPONENT:
set_MESH_COARSENING_EXPONENT(int mce)7210 void NOMAD::Parameters::set_MESH_COARSENING_EXPONENT ( int mce )
7211 {
7212 _to_be_checked = true;
7213 if ( mce < 0 )
7214 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7215 "invalid parameter: MESH_COARSENING_EXPONENT");
7216 _mesh_coarsening_exponent = mce;
7217 }
7218
7219 // set_MESH_REFINING_EXPONENT:
set_MESH_REFINING_EXPONENT(int mre)7220 void NOMAD::Parameters::set_MESH_REFINING_EXPONENT ( int mre )
7221 {
7222 _to_be_checked = true;
7223 if ( mre >= 0 )
7224 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7225 "invalid parameter: MESH_REFINING_EXPONENT");
7226 _mesh_refining_exponent = mre;
7227 }
7228
7229 // set_INITIAL_MESH_SIZE (1/3):
set_INITIAL_MESH_SIZE(int index,const NOMAD::Double & d,bool relative)7230 void NOMAD::Parameters::set_INITIAL_MESH_SIZE ( int index ,
7231 const NOMAD::Double & d ,
7232 bool relative )
7233 {
7234 if ( index < 0 || index >= _initial_mesh_size.size() || !d.is_defined() )
7235 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7236 "invalid parameter: INITIAL_MESH_SIZE" );
7237 _to_be_checked = true;
7238
7239 if ( relative )
7240 {
7241
7242 if ( !_lb.is_defined() || !_ub.is_defined() )
7243 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7244 "invalid parameter: INITIAL_MESH_SIZE - bounds not defined" );
7245
7246 if ( !_lb[index].is_defined() || !_ub[index].is_defined() ||
7247 d <= 0.0 || d > 1.0 )
7248 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7249 "invalid parameter: INITIAL_MESH_SIZE - relative value" );
7250
7251 NOMAD::Double d2 = d;
7252 d2 *= _ub[index] - _lb[index];
7253 _initial_mesh_size[index] = d2;
7254 }
7255 else
7256 _initial_mesh_size[index] = d;
7257 }
7258
7259 // set_INITIAL_MESH_SIZE (2/3):
set_INITIAL_MESH_SIZE(const NOMAD::Point & delta_m_0,bool relative)7260 void NOMAD::Parameters::set_INITIAL_MESH_SIZE ( const NOMAD::Point & delta_m_0 ,
7261 bool relative )
7262 {
7263 _to_be_checked = true;
7264 if ( relative )
7265 {
7266 int nd = delta_m_0.size();
7267 for ( int i = 0 ; i < nd ; ++i )
7268 set_INITIAL_MESH_SIZE ( i , delta_m_0[i] , true );
7269 }
7270 else
7271 _initial_mesh_size = delta_m_0;
7272 }
7273
7274 // set_INITIAL_MESH_SIZE (3/3):
set_INITIAL_MESH_SIZE(const NOMAD::Double & d,bool relative)7275 void NOMAD::Parameters::set_INITIAL_MESH_SIZE ( const NOMAD::Double & d , bool relative )
7276 {
7277 if ( _dimension <= 0 )
7278 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7279 "invalid parameter: INITIAL_MESH_SIZE - undefined dimension" );
7280 _to_be_checked = true;
7281 if ( relative )
7282 for ( int i = 0 ; i < _dimension ; ++i )
7283 set_INITIAL_MESH_SIZE ( i , d , true );
7284 else
7285 _initial_mesh_size = NOMAD::Point ( _dimension , d );
7286 }
7287
7288 // set_INITIAL_POLL_SIZE (1/3):
set_INITIAL_POLL_SIZE(int index,const NOMAD::Double & d,bool relative)7289 void NOMAD::Parameters::set_INITIAL_POLL_SIZE ( int index ,
7290 const NOMAD::Double & d ,
7291 bool relative )
7292 {
7293 if ( index < 0 || index >= _initial_poll_size.size() || !d.is_defined() )
7294 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7295 "invalid parameter: INITIAL_POLL_SIZE" );
7296 _to_be_checked = true;
7297
7298 if ( relative )
7299 {
7300
7301 if ( !_lb.is_defined() || !_ub.is_defined() )
7302 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7303 "invalid parameter: INITIAL_POLL_SIZE - bounds not defined" );
7304
7305 if ( !_lb[index].is_defined() || !_ub[index].is_defined() ||
7306 d <= 0.0 || d > 1.0 )
7307 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7308 "invalid parameter: INITIAL_POLL_SIZE - relative value" );
7309
7310 NOMAD::Double d2 = d;
7311 d2 *= _ub[index] - _lb[index];
7312 _initial_poll_size[index] = d2;
7313 }
7314 else
7315 _initial_poll_size[index] = d;
7316 }
7317
7318 // set_INITIAL_POLL_SIZE (2/3):
set_INITIAL_POLL_SIZE(const NOMAD::Point & delta_m_0,bool relative)7319 void NOMAD::Parameters::set_INITIAL_POLL_SIZE ( const NOMAD::Point & delta_m_0 ,
7320 bool relative )
7321 {
7322 _to_be_checked = true;
7323 if ( relative )
7324 {
7325 int nd = delta_m_0.size();
7326 for ( int i = 0 ; i < nd ; ++i )
7327 set_INITIAL_POLL_SIZE ( i , delta_m_0[i] , true );
7328 }
7329 else
7330 _initial_poll_size = delta_m_0;
7331 }
7332
7333 // set_INITIAL_POLL_SIZE (3/3):
set_INITIAL_POLL_SIZE(const NOMAD::Double & d,bool relative)7334 void NOMAD::Parameters::set_INITIAL_POLL_SIZE ( const NOMAD::Double & d , bool relative )
7335 {
7336 if ( _dimension <= 0 )
7337 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7338 "invalid parameter: INITIAL_POLL_SIZE - undefined dimension" );
7339 _to_be_checked = true;
7340 if ( relative )
7341 for ( int i = 0 ; i < _dimension ; ++i )
7342 set_INITIAL_POLL_SIZE ( i , d , true );
7343 else
7344 _initial_poll_size = NOMAD::Point ( _dimension , d );
7345 }
7346
7347
7348
7349 // set_MIN_MESH_SIZE (1/3):
set_MIN_MESH_SIZE(int index,const NOMAD::Double & d,bool relative)7350 void NOMAD::Parameters::set_MIN_MESH_SIZE ( int index ,
7351 const NOMAD::Double & d ,
7352 bool relative )
7353 {
7354 if (_dimension <= 0 )
7355 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7356 "invalid parameter: MIN_MESH_SIZE - undefined dimension" );
7357
7358 if ( !_min_mesh_size.is_defined() )
7359 _min_mesh_size = NOMAD::Point ( _dimension );
7360
7361 if ( index < 0 || index >= _min_mesh_size.size() )
7362 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7363 "invalid parameter: MIN_MESH_SIZE" );
7364 _to_be_checked = true;
7365 if ( relative )
7366 {
7367
7368 if ( !_lb.is_defined() || !_ub.is_defined() )
7369 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7370 "invalid parameter: MIN_MESH_SIZE - bounds not defined" );
7371
7372 if ( !_lb[index].is_defined() || !_ub[index].is_defined() ||
7373 !d.is_defined() || d <= 0.0 || d > 1.0 )
7374 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7375 "invalid parameter: MIN_MESH_SIZE - relative value" );
7376 NOMAD::Double d2 = d;
7377 d2 *= _ub[index] - _lb[index];
7378 _min_mesh_size[index] = d2;
7379 }
7380 else
7381 _min_mesh_size[index] = d;
7382 }
7383
7384 // set_MIN_MESH_SIZE (2/3):
set_MIN_MESH_SIZE(const NOMAD::Point & delta_p_min,bool relative)7385 void NOMAD::Parameters::set_MIN_MESH_SIZE ( const NOMAD::Point & delta_p_min ,
7386 bool relative )
7387 {
7388 _to_be_checked = true;
7389 if ( relative )
7390 {
7391 int nd = delta_p_min.size();
7392 for ( int i = 0 ; i < nd ; ++i )
7393 set_MIN_MESH_SIZE ( i , delta_p_min[i] , true );
7394 }
7395 else
7396 _min_mesh_size = delta_p_min;
7397 }
7398
7399 // set_MIN_MESH_SIZE (3/3):
set_MIN_MESH_SIZE(const NOMAD::Double & d,bool relative)7400 void NOMAD::Parameters::set_MIN_MESH_SIZE ( const NOMAD::Double & d , bool relative )
7401 {
7402 if ( _dimension <= 0 )
7403 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7404 "invalid parameter: MIN_MESH_SIZE - undefined dimension" );
7405 _to_be_checked = true;
7406 if ( relative )
7407 for ( int i = 0 ; i < _dimension ; ++i )
7408 set_MIN_MESH_SIZE ( i , d , true );
7409 else
7410 _min_mesh_size = NOMAD::Point ( _dimension , d );
7411 }
7412
7413 // set_MIN_POLL_SIZE (1/3):
set_MIN_POLL_SIZE(int index,const NOMAD::Double & d,bool relative)7414 void NOMAD::Parameters::set_MIN_POLL_SIZE ( int index ,
7415 const NOMAD::Double & d ,
7416 bool relative )
7417 {
7418 if ( _dimension <= 0 )
7419 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7420 "invalid parameter: MIN_POLL_SIZE - undefined dimension" );
7421
7422 if ( !_min_poll_size.is_defined() )
7423 _min_poll_size = NOMAD::Point ( _dimension );
7424
7425 if ( index < 0 || index >= _min_poll_size.size() )
7426 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7427 "invalid parameter: MIN_POLL_SIZE" );
7428 _to_be_checked = true;
7429 if ( relative ) {
7430 if ( !_lb[index].is_defined() || !_ub[index].is_defined() ||
7431 !d.is_defined() || d <= 0.0 || d > 1.0 )
7432 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7433 "invalid parameter: MIN_POLL_SIZE - relative value" );
7434 _min_poll_size[index] = d * ( _ub[index] - _lb[index] );
7435 }
7436 else
7437 _min_poll_size[index] = d;
7438 }
7439
7440 // set_MIN_POLL_SIZE (2/3):
set_MIN_POLL_SIZE(const NOMAD::Point & delta_p_min,bool relative)7441 void NOMAD::Parameters::set_MIN_POLL_SIZE ( const NOMAD::Point & delta_p_min ,
7442 bool relative )
7443 {
7444 _to_be_checked = true;
7445 if ( relative ) {
7446 int nd = delta_p_min.size();
7447 for ( int i = 0 ; i < nd ; ++i )
7448 set_MIN_POLL_SIZE ( i , delta_p_min[i] , true );
7449 }
7450 else
7451 _min_poll_size = delta_p_min;
7452 }
7453
7454 // set_MIN_POLL_SIZE (3/3):
set_MIN_POLL_SIZE(const NOMAD::Double & d,bool relative)7455 void NOMAD::Parameters::set_MIN_POLL_SIZE ( const NOMAD::Double & d , bool relative )
7456 {
7457 if ( _dimension <= 0 )
7458 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7459 "invalid parameter: MIN_POLL_SIZE - undefined dimension" );
7460 _to_be_checked = true;
7461 if ( relative )
7462 for ( int i = 0 ; i < _dimension ; ++i )
7463 set_MIN_POLL_SIZE ( i , d , true );
7464 else
7465 _min_poll_size = NOMAD::Point ( _dimension , d );
7466 }
7467
7468 // set_NEIGHBORS_EXE:
set_NEIGHBORS_EXE(const std::string & ne)7469 void NOMAD::Parameters::set_NEIGHBORS_EXE ( const std::string & ne )
7470 {
7471 _to_be_checked = true;
7472 _neighbors_exe = ne;
7473 }
7474
7475 // set_EXTENDED_POLL_TRIGGER:
set_EXTENDED_POLL_TRIGGER(const NOMAD::Double & ept,bool relative)7476 void NOMAD::Parameters::set_EXTENDED_POLL_TRIGGER ( const NOMAD::Double & ept ,
7477 bool relative )
7478 {
7479 _to_be_checked = true;
7480
7481 if ( !ept.is_defined() )
7482 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7483 "invalid parameter: EXTENDED_POLL_TRIGGER (undefined)" );
7484
7485 if ( ept <= 0.0 )
7486 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7487 "invalid parameter: EXTENDED_POLL_TRIGGER: must be strictly positive" );
7488
7489 _extended_poll_trigger = ept;
7490 _relative_ept = relative;
7491 }
7492
7493 // set_EXTENDED_POLL_ENABLED:
set_EXTENDED_POLL_ENABLED(bool epe)7494 void NOMAD::Parameters::set_EXTENDED_POLL_ENABLED ( bool epe )
7495 {
7496 _to_be_checked = true;
7497 _extended_poll_enabled = epe;
7498 }
7499
7500 // set_USER_CALLS_ENABLED:
set_USER_CALLS_ENABLED(bool uce)7501 void NOMAD::Parameters::set_USER_CALLS_ENABLED ( bool uce )
7502 {
7503 _to_be_checked = true;
7504 _user_calls_enabled = uce;
7505 }
7506
7507 // set_ASYNCHRONOUS:
set_ASYNCHRONOUS(bool a)7508 void NOMAD::Parameters::set_ASYNCHRONOUS ( bool a )
7509 {
7510 _to_be_checked = true;
7511 _asynchronous = a;
7512 }
7513
7514 // set_MULTI_NB_MADS_RUNS:
set_MULTI_NB_MADS_RUNS(int i)7515 void NOMAD::Parameters::set_MULTI_NB_MADS_RUNS ( int i )
7516 {
7517 if ( i == 0 )
7518 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7519 "invalid parameter: MULTI_NB_MADS_RUNS - has been set to zero" );
7520
7521 _to_be_checked = true;
7522 _multi_nb_mads_runs = ( i < 0 ) ? -1 : i;
7523 }
7524
7525 // set_MULTI_OVERALL_BB_EVAL:
set_MULTI_OVERALL_BB_EVAL(int i)7526 void NOMAD::Parameters::set_MULTI_OVERALL_BB_EVAL ( int i )
7527 {
7528 _to_be_checked = true;
7529 _multi_overall_bb_eval = ( i < 0 ) ? -1 : i;
7530 }
7531
7532 // set_MULTI_USE_DELTA_CRIT:
set_MULTI_USE_DELTA_CRIT(bool b)7533 void NOMAD::Parameters::set_MULTI_USE_DELTA_CRIT ( bool b )
7534 {
7535 _to_be_checked = true;
7536 _multi_use_delta_crit = b;
7537 }
7538
7539 // set_MULTI_F_BOUNDS:
set_MULTI_F_BOUNDS(const NOMAD::Point & p)7540 void NOMAD::Parameters::set_MULTI_F_BOUNDS ( const NOMAD::Point & p )
7541 {
7542 _to_be_checked = true;
7543 if ( p.size() != 4 || p[0] >= p[1] || p[2] >= p[3] )
7544 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7545 "invalid parameter: MULTI_F_BOUNDS" );
7546 _multi_f_bounds = p;
7547 }
7548
7549 // set_MULTI_FORMULATION:
set_MULTI_FORMULATION(NOMAD::multi_formulation_type mft)7550 void NOMAD::Parameters::set_MULTI_FORMULATION ( NOMAD::multi_formulation_type mft )
7551 {
7552 _to_be_checked = true;
7553 _multi_formulation = mft;
7554 }
7555
set_BB_MAX_BLOCK_SIZE(int max_block_size)7556 void NOMAD::Parameters::set_BB_MAX_BLOCK_SIZE ( int max_block_size )
7557 {
7558 _to_be_checked = true;
7559 _bb_max_block_size = max_block_size;
7560
7561 if ( _bb_max_block_size > 1 )
7562 _eval_points_as_block=true;
7563
7564
7565 }
7566
7567
7568
7569 // set_OPPORTUNISTIC_LH:
set_OPPORTUNISTIC_LH(bool opp)7570 void NOMAD::Parameters::set_OPPORTUNISTIC_LH ( bool opp )
7571 {
7572 _to_be_checked = true;
7573 _opportunistic_LH = opp;
7574 _opp_LH_is_defined = true;
7575 }
7576
7577 // set_OPPORTUNISTIC_CACHE_SEARCH:
set_OPPORTUNISTIC_CACHE_SEARCH(bool opp)7578 void NOMAD::Parameters::set_OPPORTUNISTIC_CACHE_SEARCH ( bool opp )
7579 {
7580 _to_be_checked = true;
7581 _opportunistic_cache_search = opp;
7582 _opp_CS_is_defined = true;
7583 }
7584
7585 // set_OPPORTUNISTIC_EVAL:
set_OPPORTUNISTIC_EVAL(bool oe)7586 void NOMAD::Parameters::set_OPPORTUNISTIC_EVAL ( bool oe )
7587 {
7588 _to_be_checked = true;
7589 _opportunistic_eval = oe;
7590 }
7591
7592 // set_OPPORTUNISTIC_MIN_NB_SUCCESS:
set_OPPORTUNISTIC_MIN_NB_SUCCESS(int mns)7593 void NOMAD::Parameters::set_OPPORTUNISTIC_MIN_NB_SUCCESS ( int mns )
7594 {
7595 _to_be_checked = true;
7596 if ( mns <= 0 )
7597 mns = -1;
7598 _opportunistic_min_nb_success = mns;
7599 }
7600
7601 // set_OPPORTUNISTIC_MIN_EVAL:
set_OPPORTUNISTIC_MIN_EVAL(int me)7602 void NOMAD::Parameters::set_OPPORTUNISTIC_MIN_EVAL ( int me )
7603 {
7604 _to_be_checked = true;
7605 if ( me <= 0 )
7606 me = -1;
7607 _opportunistic_min_eval = me;
7608 }
7609
7610 // set_OPPORTUNISTIC_MIN_F_IMPRVMT:
set_OPPORTUNISTIC_MIN_F_IMPRVMT(const NOMAD::Double & mfi)7611 void NOMAD::Parameters::set_OPPORTUNISTIC_MIN_F_IMPRVMT ( const NOMAD::Double & mfi )
7612 {
7613 _to_be_checked = true;
7614 if ( !mfi.is_defined() || mfi <= 0.0 )
7615 _opportunistic_min_f_imprvmt.clear();
7616 else
7617 _opportunistic_min_f_imprvmt = mfi;
7618 }
7619
7620 // set_OPPORTUNISTIC_LUCKY_EVAL:
set_OPPORTUNISTIC_LUCKY_EVAL(bool le)7621 void NOMAD::Parameters::set_OPPORTUNISTIC_LUCKY_EVAL ( bool le )
7622 {
7623 _to_be_checked = true;
7624 _opportunistic_lucky_eval = le;
7625 }
7626
7627 // set_PERIODIC_VARIABLE (1/2):
set_PERIODIC_VARIABLE(int index)7628 void NOMAD::Parameters::set_PERIODIC_VARIABLE ( int index )
7629 {
7630 if ( _dimension <= 0 )
7631 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7632 "invalid parameter: PERIODIC_VARIABLE - undefined dimension" );
7633
7634 if ( index < 0 || index >= _dimension )
7635 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7636 "invalid parameter: PERIODIC_VARIABLE - bad variable index" );
7637
7638 if ( _periodic_variables.empty() )
7639 for ( int i = 0 ; i < _dimension ; ++i )
7640 _periodic_variables.push_back ( false );
7641
7642 _periodic_variables[index] = true;
7643 _to_be_checked = true;
7644 }
7645
7646 // set_PERIODIC_VARIABLE (2/2):
set_PERIODIC_VARIABLE(const std::vector<bool> & pv)7647 void NOMAD::Parameters::set_PERIODIC_VARIABLE ( const std::vector<bool> & pv )
7648 {
7649 _to_be_checked = true;
7650 _periodic_variables = pv;
7651 }
7652
7653 // set_VARIABLE_GROUP (1/3):
set_VARIABLE_GROUP(const std::set<int> & var_indexes)7654 void NOMAD::Parameters::set_VARIABLE_GROUP ( const std::set<int> & var_indexes )
7655 {
7656 if ( _dimension <= 0 )
7657 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7658 "invalid parameter: VARIABLE_GROUP - undefined dimension" );
7659
7660 if ( _bb_input_type.empty() ||
7661 static_cast<int>(_bb_input_type.size()) != _dimension )
7662 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7663 "invalid parameter: VARIABLE_GROUP - undefined blackbox input types" );
7664
7665 _to_be_checked = true;
7666
7667 std::set<NOMAD::direction_type> empty;
7668
7669 _user_var_groups.insert ( new NOMAD::Variable_Group ( var_indexes ,
7670 empty ,
7671 empty ,
7672 _out ) );
7673 }
7674
7675 // set_VARIABLE_GROUP (2/3):
set_VARIABLE_GROUP(const std::set<int> & var_indexes,const std::set<NOMAD::direction_type> & direction_types,const std::set<NOMAD::direction_type> & sec_poll_dir_types)7676 void NOMAD::Parameters::set_VARIABLE_GROUP
7677 ( const std::set<int> & var_indexes ,
7678 const std::set<NOMAD::direction_type> & direction_types ,
7679 const std::set<NOMAD::direction_type> & sec_poll_dir_types )
7680 {
7681 if ( _dimension <= 0 )
7682 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7683 "invalid parameter: VARIABLE_GROUP - undefined dimension" );
7684
7685 if ( _bb_input_type.empty() ||
7686 static_cast<int>(_bb_input_type.size()) != _dimension )
7687 throw Invalid_Parameter ( "Parameters.cpp" , __LINE__ ,
7688 "invalid parameter: VARIABLE_GROUP - undefined blackbox input types" );
7689
7690 _to_be_checked = true;
7691
7692 std::set<NOMAD::direction_type> dt = direction_types;
7693 if ( dt.empty() )
7694 dt.insert ( NOMAD::ORTHO_NP1_QUAD );
7695
7696 _user_var_groups.insert ( new NOMAD::Variable_Group ( var_indexes ,
7697 dt ,
7698 sec_poll_dir_types ,
7699 _out ) );
7700 }
7701
7702 // set_VARIABLE_GROUP (3/3):
set_VARIABLE_GROUP(const std::list<NOMAD::Variable_Group * > & vg)7703 void NOMAD::Parameters::set_VARIABLE_GROUP
7704 ( const std::list<NOMAD::Variable_Group*> & vg )
7705 {
7706
7707 std::list<NOMAD::Variable_Group*>::const_iterator it , end = vg.end();
7708 for ( it = vg.begin() ; it != end ; ++it )
7709 set_VARIABLE_GROUP ( (*it)->get_var_indexes () ,
7710 (*it)->get_direction_types () ,
7711 (*it)->get_sec_poll_dir_types()
7712 );
7713
7714 }
7715
7716 /*-----------------------------------------------*/
7717 /* help (display parameter descriptions) - 1/3 */
7718 /*-----------------------------------------------*/
help(const std::string & param_name,bool developer) const7719 void NOMAD::Parameters::help ( const std::string & param_name,bool developer ) const
7720 {
7721 std::list<std::string> ls;
7722 ls.push_back ( param_name );
7723 help ( ls,developer);
7724 }
7725
7726 /*-----------------------------------------------*/
7727 /* help (display parameter descriptions) - 2/3 */
7728 /*-----------------------------------------------*/
help(int argc,char ** argv,bool developer) const7729 void NOMAD::Parameters::help ( int argc , char ** argv , bool developer ) const
7730 {
7731 std::list<std::string> ls;
7732 if ( argc <= 2 )
7733 ls.push_back ( "ALL" );
7734 else
7735 for ( int i = 2 ; i < argc ; ++i )
7736 ls.push_back ( argv[i] );
7737 help(ls,developer);
7738 }
7739
7740 /*-----------------------------------------------*/
7741 /* help (display parameter descriptions) - 3/3 */
7742 /*-----------------------------------------------*/
help(const std::list<std::string> & pnames,bool developer) const7743 void NOMAD::Parameters::help ( const std::list<std::string> & pnames,bool developer ) const
7744 {
7745 #ifdef USE_MPI
7746 if ( !NOMAD::Slave::is_master() )
7747 return;
7748 #endif
7749
7750 // initial display:
7751 _out << std::endl
7752 << NOMAD::open_block ( "NOMAD - help on parameters - see more details in "
7753 + NOMAD::USER_GUIDE_FILE );
7754
7755 std::list<std::string> param_names = pnames;
7756 NOMAD::toupper ( param_names );
7757
7758 bool chk = false;
7759 bool display_all = false;
7760
7761 if ( NOMAD::string_match ( "ALL", param_names) || NOMAD::string_match( "PARAMS", param_names ) ||
7762 NOMAD::string_match ( "PARAMETER", param_names) || NOMAD::string_match ( "PARAM", param_names) ||
7763 NOMAD::string_match ( "NOMAD" , param_names ) || NOMAD::string_match ( "EVERYTHING", param_names) )
7764 display_all = true;
7765
7766
7767 const char registered_key_basic[]="2N ANGLES AVG BARRIER BASIC BASIC BB_EXE BB_INPUT_TYPE BB_OUTPUT_TYPE BI-MADS BI-OBJECTIVES BIMADS \
7768 BINARY BIOBJECTIVES BLACK-BOXES BLACKBOXES BOUNDS CACHE BBEVAL CACHE_FILE CNT_EVAL CONSTRAINTS CONTINUOUS COUNT DEBUG DELTA_0 DIMENSION \
7769 DIRECTION_TYPE DIRECTION_TYPES DIRECTIONS DIRECTIONS_TYPES DIRECTORY DISPLAY_ALL_EVAL DISPLAY_DEGREES DISPLAY_STATS EVALUATIONS \
7770 EXECUTABLE F_TARGET FILES FILTER FORMAT GPS h(x) HISTORY_FILE INITIAL_MESH_SIZE INTEGER LATEX LATIN-HYPERCUBE LB LH_SEARCH LOWER_BOUND \
7771 LT LT-MADS LTMADS MADS MAX_BB_EVAL MAX_TIME MAXIMUM MINIMIZE MODEL MODELS MULTI-OBJECTIVE MULTIOBJECTIVES N+1 NUMBER OPTIMIZE ORTHO \
7772 ORTHO-MADS ORTHOMADS OUTPUTS PATH PB PEB POINT POLL PROGRESSIVE-BARRIER RANDOM SAMPLING SCREEN SCREEN SOLUTION_FILE STARTING STATIC \
7773 STATS STATS_FILE STOPPING SUM TEMPORARY TERMINATES TERMINATION TMP_DIR UB UNIFORM UPPER_BOUNDS VARIABLES X0";
7774
7775 const char registered_key_advanced[]="ADD_SEED_TO_FILE_NAMES ADVANCED ANISOTROPIC_MESH ASYNCHRONOUS BB_INPUT_INCLUDE_SEED BB_INPUT_INCLUDE_TAG \
7776 BB_REDIRECTION BBEVAL BI-MADS BI-OBJECTIVES BIMADS BIOBJECTIVES BLACK-BOXES BLACKBOXES BLOCKS BOUNDS CACHE CACHE_FILE CACHE_SAVE_PERIOD \
7777 CACHE_SEARCH CATEGORICAL CLOSED_BRACES CONSTRAINTS CYCLIC DELTA DETERMINISTIC DIRECTIONS DISABLE DISABLE_EVAL_SORT DISABLE_MODEL DISABLE_MODELS \
7778 DISPLAY ELL ELL_0 BB_MAX_BLOCK_SIZE EVALUATIONS EXECUTABLE EXTENDED_POLL EXTENDED_POLL_DISABLED EXTENDED_POLL_ENABLED EXTENDED_POLL_TRIGGER FEASIBILITY \
7779 FILES FILTER FIXED_VARIABLE FROBENIUS GLOBAL GROUPS H_MAX_0 H_MIN H_NORM HAS_SGTE HMAX HMAX_0 HMIN INDENTATION INF_STR \
7780 INFINITY INTERPOLATION ITERATIONS L_0 L_INF L0 L1 L2 LATIN-HYPERCUBE LB LIBRARY LINF LT-MADS LTMADS MADS \
7781 MAX_CACHE_MEMORY MAX_CONSECUTIVE_FAILED_ITERATIONS MAX_EVAL MAX_ITERATIONS MAX_SGTE_EVAL MAX_SIM_BB_EVAL MAXIMUM \
7782 MB MEGA-BYTES MEGABYTES MESH MESH_COARSENING_EXPONENT MESH_REFINING_EXPONENT MESH_UPDATE_BASIS META-HEURISTICS METAHEURISTICS MFN \
7783 MIN_MESH_SIZE MIN_POLL_SIZE MINIMUM MIXED MODEL MODEL_EVAL_SORT MODEL_ORDERING MODEL_SEARCH MODEL_SEARCH_OPTIMISTIC MODELS MPI \
7784 MULTI_F_BOUNDS MULTI_NB_MADS_RUNS MULTI_OVERALL_BB_EVAL MULTI-OBJECTIVES MULTIOBJECTIVES MVP N+1 NEIGHBORHOOD NEIGHBORHOODS NEIGHBORS_EXE \
7785 NEIGHBOURHOODS NEIGHBOURS NUMBER OPEN_BRACES OPPORTUNISTIC_CACHE_SEARCH OPPORTUNISTIC_EVAL OPPORTUNISTIC_LH OPPORTUNISTIC_MIN_EVAL \
7786 OPTIMISTIC ORTHO ORTHO-MADS ORTHOGONAL ORTHOMADS OUTPUT OUTPUTS PARALLELISM PARETO PB PEB PERIODIC_VARIABLE PMADS POINT_DISPLAY_LIMIT \
7787 POLL POLL_UPDATE_BASIS PRECISION PROGRESSIVE-BARRIER PROJECTION PSD-MADS PSDMADS QUAD QUADRATIC RAM RANDOM REALS REGRESSION RHO SAMPLING SCALE SCALING \
7788 SEARCH SEED SGTE_CACHE_FILE SGTE_COST SGTE_EVAL_SORT SGTE_EXE SGTE_ORDERING SGTES SIMULATED SNAP_TO_BOUNDS SPECULATIVE_SEARCH \
7789 STAT_SUM_TARGET STATS STOP_IF_FEASIBLE SUCCESSES SURF SURROGATES TABULATIONS TAU TERMINATES TERMINATION TGP TGPMODEL_SEARCH TRIGGER \
7790 UB UNDEF_STR UNDEFINED USER_CALLS_DISABLED USER_CALLS_ENABLED VARIABLE_GROUP VARIABLES VNS_SEARCH W- W+";
7791
7792 const char registered_key_developer[]="BI-MADS BI-OBJECTIVES BIMADS BIOBJECTIVES BLACK-BOXES BLACK-BOXES COMPARISONS DEVELOPER \
7793 DIRECTIONS EPSILON EVALUATIONS FROBENIUS INITIAL_MESH_INDEX IMPROVEMENT INTERPOLATION L_CURVE_TARGET MADS MFN MODEL MODEL_EVAL_SORT_CAUTIOUS MODEL_ORDERING \
7794 MODEL_QUAD_MAX_Y_SIZE MODEL_QUAD_MIN_Y_SIZE MODEL_QUAD_RADIUS_FACTOR MODEL_QUAD_USE_WP MODEL_SEARCH MODEL_SEARCH_MAX_TRIAL_PTS \
7795 MODEL_SEARCH_PROJ_TO_MESH MODEL_TGP_MODE MODEL_TGP_REUSE_MODEL MODELS MULTI_FORMULATION MULTI_USE_DELTA_CRITERION MULTI-OBJECTIVES \
7796 MULTIOBJECTIVES N+1 NP1 OBJECTIVE OPPORTUNISTIC_LUCKY_EVAL OPPORTUNISTIC_MIN_F_IMPRVMT OPPORTUNISTIC_MIN_NB_SUCCESSES OPT_ONLY_SGTES \
7797 ORTHO PARETO PB PEB POLL PRECISION PROGRESSIVE-BARRIER PROJECTION QUAD QUADRATIC REALS REGRESSION SEC_POLL_DIR_TYPES SGTES STOPPING \
7798 SUCCESSES SURROGATES TERMINATES TERMINATION TGP USE_SMESH WELL-POISEDNESS";
7799
7800
7801 if ( display_all || NOMAD::string_find ( registered_key_basic, param_names ) )
7802 {
7803 _out << "--------------------------------------------------------------" << endl;
7804 _out << "-----------------------BASIC PARAMETERS-----------------------" << endl;
7805 _out << "--------------------------------------------------------------" << endl;
7806 }
7807
7808
7809 // BB_EXE:
7810 // -------
7811 if ( display_all || NOMAD::string_find ( "BB_EXE BASIC BLACK-BOXES BLACKBOXES \
7812 EXECUTABLE FILES BI-OBJECTIVES \
7813 BIOBJECTIVES MULTIOBJECTIVES \
7814 BIMADS BI-MADS \
7815 MULTI-OBJECTIVES" , param_names ) ) {
7816 _out << std::endl
7817 << NOMAD::open_block ( "BB_EXE (basic)" ) << std::endl
7818 << ". blackbox executable names" << std::endl
7819 << ". list of strings" << std::endl
7820 << ". no default, required (except in library mode)" << std::endl
7821 << ". several executables can be used" << std::endl
7822 << ". one executable can give several outputs" << std::endl
7823 << ". use \' or \", and \'$\', to specify names or" << std::endl
7824 << " commands with spaces" << std::endl
7825 << ". when the \'$\' character is put in first" << std::endl
7826 << " position of a string, it is considered" << std::endl
7827 << " as global and no path will be added" << std::endl
7828 << ". " << NOMAD::open_block ( "examples" )
7829 << "BB_EXE bb.exe" << std::endl
7830 << "BB_EXE bb1.exe bb2.exe" << std::endl
7831 << "BB_EXE \'$nice bb.exe\'" << std::endl
7832 << "BB_EXE \'$python bb.py\'" << std::endl
7833 << NOMAD::close_block()
7834 << NOMAD::close_block();
7835 chk = true;
7836 }
7837
7838 // BB_INPUT_TYPE:
7839 // --------------
7840 if ( display_all || NOMAD::string_find ( "BB_INPUT_TYPE BLACK-BOXES BLACKBOXES \
7841 BASIC VARIABLES CONTINUOUS \
7842 INTEGER BINARY" , param_names ) ) {
7843 _out << std::endl
7844 << NOMAD::open_block ( "BB_INPUT_TYPE (basic)" ) << std::endl
7845 << ". blackbox input types" << std::endl
7846 << ". list of types for each variable" << std::endl
7847 << ". " << NOMAD::open_block ( "available types" )
7848 << "B: binary" << std::endl
7849 << "C: categorical" << std::endl
7850 << "I: integer" << std::endl
7851 << "R: continuous" << std::endl
7852 << NOMAD::close_block()
7853 << ". default: * R (all continuous)" << std::endl
7854 << ". " << NOMAD::open_block ( "examples" )
7855 << "BB_INPUT_TYPE ( R I B ) # for all 3 variables" << std::endl
7856 << "BB_INPUT_TYPE 1-3 B # variables 1 to 3 are binary" << std::endl
7857 << "BB_INPUT_TYPE 0 I # first variable is integer" << std::endl
7858 << NOMAD::close_block() << NOMAD::close_block();
7859 chk = true;
7860 }
7861
7862 // BB_OUTPUT_TYPE:
7863 // ---------------
7864 if ( display_all || NOMAD::string_find ( "BB_OUTPUT_TYPE BASIC CONSTRAINTS \
7865 BLACK-BOXES BLACKBOXES \
7866 BARRIER STATS BI-OBJECTIVES h(x) \
7867 PB PEB FILTER STATS SUM AVG CNT_EVAL \
7868 COUNT PROGRESSIVE-BARRIER \
7869 MULTI-OBJECTIVE MINIMIZE \
7870 BIOBJECTIVES MULTIOBJECTIVES \
7871 BI-MADS BIMADS \
7872 OPTIMIZE" , param_names ) ) {
7873 _out << std::endl
7874 << NOMAD::open_block ( "BB_OUTPUT_TYPE (basic)" ) << std::endl
7875 << ". blackbox output types" << std::endl
7876 << ". list of types for each blackbox output" << std::endl
7877 << ". " << NOMAD::open_block ( "available types" ) << std::endl
7878 << "OBJ : objective value to minimize" << std::endl
7879 << " (define twice for bi-objective)" << std::endl
7880 << "CSTR or PB: constraint <= 0 treated with" << std::endl
7881 << " Progressive Barrier (PB)" << std::endl
7882 << "EB : constraint <= 0 treated with" << std::endl
7883 << " Extreme Barrier (EB)" << std::endl
7884 << "PEB : constraint <= 0 treated with" << std::endl
7885 << " hybrid PB/EB" << std::endl
7886 << "F : constraint <= 0 treated with Filter" << std::endl
7887 << "CNT_EVAL : 0 or 1 output: count or not the" << std::endl
7888 << " evaluation" << std::endl
7889 << "STAT_AVG : NOMAD will compute the average" << std::endl
7890 << " value for this output" << std::endl
7891 << "STAT_SUM : the same for the sum" << std::endl
7892 << "NOTHING : the output is ignored" << std::endl
7893 << "- : same as \'NOTHING\'" << std::endl
7894 << NOMAD::close_block()
7895 << ". STAT_SUM and STAT_AVG outputs have to be unique;" << std::endl
7896 << " they are updated at every new blackbox evaluation" << std::endl
7897 << ". no default, required" << std::endl
7898 << ". see user guide for blackbox output formats" << std::endl
7899 << ". equality constraints are not natively supported" << std::endl
7900 << ". see parameters LOWER_BOUND and UPPER_BOUND for" << std::endl
7901 << " bound constraints" << std::endl
7902 << ". " << NOMAD::open_block ( "examples" ) << std::endl
7903 << "BB_EXE bb.exe # these two lines define" << std::endl
7904 << "BB_OUTPUT_TYPE OBJ EB EB # that bb.exe outputs" << std::endl
7905 << " # three values" << std::endl
7906 << std::endl
7907 << "BB_EXE bb1.exe bb2.exe bb2.exe # bb1.exe outputs the" << std::endl
7908 << "BB_OUTPUT_TYPE OBJ EB EB # objective and bb2.exe" << std::endl
7909 << " # two constraints" << std::endl
7910 << NOMAD::close_block() << NOMAD::close_block();
7911 chk = true;
7912 }
7913
7914
7915 // CACHE_FILE:
7916 // -----------
7917 if ( display_all || NOMAD::string_find ( "CACHE_FILE BASIC \
7918 FILES OUTPUTS" , param_names ) ) {
7919 _out << std::endl
7920 << NOMAD::open_block ( "CACHE_FILE (basic)" ) << std::endl
7921 << ". cache file; if the specified file" << std::endl
7922 << " does not exist, it will be created" << std::endl
7923 << ". argument: one string" << std::endl
7924 << ". no default" << std::endl
7925 << ". points already in the file will be" << std::endl
7926 << " tagged as true evaluations" << std::endl
7927 << ". example: CACHE_FILE cache.bin" << std::endl
7928 << NOMAD::close_block();
7929 chk = true;
7930 }
7931
7932
7933 // DIMENSION:
7934 // ----------
7935 if ( display_all || NOMAD::string_find ( "DIMENSION BASIC VARIABLES" ,
7936 param_names ) )
7937 {
7938 _out << std::endl
7939 << NOMAD::open_block ( "DIMENSION (basic)" ) << std::endl
7940 << ". number of variables" << std::endl
7941 << ". argument: one positive integer" << std::endl
7942 << ". no default, required" << std::endl
7943 << ". example: DIMENSION 3" << std::endl
7944 << NOMAD::close_block();
7945 chk = true;
7946 }
7947
7948 // DIRECTION_TYPE:
7949 // ---------------
7950 if ( display_all || NOMAD::string_find ( "DIRECTION_TYPES BASIC DIRECTION_TYPE DIRECTIONS_TYPES \
7951 BASIC ORTHO LT GPS \
7952 MADS DIRECTIONS 2N N+1 POLL MODEL MODELS \
7953 ORTHOMADS ORTHO-MADS LTMADS LT-MADS \
7954 RANDOM STATIC UNIFORM ANGLES" ,
7955 param_names ) ) {
7956 _out << std::endl
7957 << NOMAD::open_block ( "DIRECTION_TYPE (basic)" ) << std::endl
7958 << ". types of directions used in the poll step" << std::endl
7959 << ". arguments: direction types (see user" << std::endl
7960 << " guide for available types)" << std::endl
7961 << ". default: ORTHO (OrthoMADS n+1 (QUAD model used for " << std::endl
7962 << " (n+1)th dir)." << std::endl
7963 << ". several direction types can be defined" << std::endl
7964 << " at the same time (one direction per line)" << std::endl
7965 << ". " << NOMAD::open_block ( "examples" ) << std::endl
7966 << "DIRECTION_TYPE ORTHO 1 # OrthoMADS, 1" << std::endl
7967 << "DIRECTION_TYPE ORTHO 2 # OrthoMADS, 2" << std::endl
7968 << "DIRECTION_TYPE ORTHO N+1 # OrthoMADS, n+1" << std::endl
7969 << " # (QUAD model used"<< std::endl
7970 << " # for (n+1)th dir)"<< std::endl
7971 << "DIRECTION_TYPE ORTHO N+1 QUAD # OrthoMADS, n+1" << std::endl
7972 << " # (QUAD model used"<< std::endl
7973 << " # for (n+1)th dir)"<< std::endl
7974 << "DIRECTION_TYPE ORTHO N+1 NEG # OrthoMADS, n+1" << std::endl
7975 << " # ((n+1)th dir = " << std::endl
7976 << " # negative sum of" << std::endl
7977 << " # n first dirs)" << std::endl
7978 << "DIRECTION_TYPE ORTHO # OrthoMADS, n+1 QUAD " << std::endl
7979 << "DIRECTION_TYPE ORTHO 2N # OrthoMADS, 2n" << std::endl
7980 << "DIRECTION_TYPE LT 1 # LT-MADS, 1" << std::endl
7981 << "DIRECTION_TYPE LT 2 # LT-MADS, 2" << std::endl
7982 << "DIRECTION_TYPE LT N+1 # LT-MADS, n+1" << std::endl
7983 << "DIRECTION_TYPE LT # LT-MADS, 2n" << std::endl
7984 << "DIRECTION_TYPE LT 2N # LT-MADS, 2n" << std::endl
7985 << "DIRECTION_TYPE GPS BINARY or BIN # GPS, bin var" << std::endl
7986 << "DIRECTION_TYPE GPS N+1 # GPS, n+1," << std::endl
7987 << " # static" << std::endl
7988 << "DIRECTION_TYPE GPS N+1 STATIC # GPS, n+1," << std::endl
7989 << " # static" << std::endl
7990 << "DIRECTION_TYPE GPS N+1 STATIC UNIFORM # GPS, n+1," << std::endl
7991 << " # static, unif" << std::endl
7992 << "DIRECTION_TYPE GPS N+1 RAND # GPS, n+1," << std::endl
7993 << " # rand" << std::endl
7994 << "DIRECTION_TYPE GPS N+1 RAND UNIFORM # GPS, n+1," << std::endl
7995 << " # rand, unif" << std::endl
7996 << "DIRECTION_TYPE GPS # GPS, 2n," << std::endl
7997 << " # static" << std::endl
7998 << "DIRECTION_TYPE GPS 2N # GPS, 2n," << std::endl
7999 << " # static" << std::endl
8000 << "DIRECTION_TYPE GPS 2N STATIC # GPS, 2n," << std::endl
8001 << " # static" << std::endl
8002 << "DIRECTION_TYPE GPS 2N RAND # GPS, 2n," << std::endl
8003 << " # rand" << std::endl
8004 << NOMAD::close_block() << NOMAD::close_block();
8005 chk = true;
8006 }
8007
8008 // DISPLAY_ALL_EVAL:
8009 // -----------------
8010 if ( display_all || NOMAD::string_find ( "DISPLAY_ALL_EVAL DISPLAY_STATS \
8011 STATS_FILE BASIC" , param_names ) )
8012 {
8013 _out << std::endl
8014 << NOMAD::open_block ( "DISPLAY_ALL_EVAL (basic)" ) << std::endl
8015 << ". if \'yes\', more points are displayed with" << std::endl
8016 << " parameters DISPLAY_STATS and STATS_FILE" << std::endl
8017 << ". points of the phase one with EB constraints" << std::endl
8018 << " are not displayed" << std::endl
8019 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8020 << ". default: \'no\'" << std::endl
8021 << ". example: DISPLAY_ALL_EVAL yes" << std::endl
8022 << NOMAD::close_block();
8023 chk = true;
8024 }
8025
8026
8027
8028 // DISPLAY_DEGREE:
8029 // ---------------
8030 if ( display_all || NOMAD::string_find ( "DISPLAY_DEGREES OUTPUTS \
8031 SCREEN DEBUG BASIC" , param_names ) ) {
8032 _out << std::endl
8033 << NOMAD::open_block ( "DISPLAY_DEGREE (basic)" ) << std::endl
8034 << ". " << NOMAD::open_block ( "display degree" )
8035 << "0: no display" << std::endl
8036 << "1: minimal display" << std::endl
8037 << "2: normal display" << std::endl
8038 << "3: full display" << std::endl
8039 << NOMAD::close_block()
8040 << ". argument: one integer in {0, 1, 2, 3} (basic)" << std::endl
8041 << " or one string in {\'NO\', \'NO_DISPLAY\', \'MIN\'," << std::endl
8042 << " \'MINIMAL\', \'MINIMAL_DISPLAY\' ,\'NORMAL\',"
8043 << std::endl
8044 << " \'NORMAL_DISPLAY\', \'FULL\'," << std::endl
8045 << " \'FULL_DISPLAY\'}" << std::endl
8046 << " or one string composed of 4 integers each in" << std::endl
8047 << " { 0, 1, 2 ,3} (advanced)" << std::endl
8048 << ". default: 2" << std::endl
8049 << ". "
8050 << NOMAD::open_block("advanced use with 4 digits (see user guide for details)")
8051 << "#1 general display degree (before and after" << std::endl
8052 << " all iterations)" << std::endl
8053 << "#2 search display degree (during searches)" << std::endl
8054 << "#3 poll display degree (during polls)" << std::endl
8055 << "#4 iterative display degree (other displays at" << std::endl
8056 << " each iteration)" << std::endl
8057 << NOMAD::close_block() << ". " << NOMAD::open_block ( "examples" )
8058 << "DISPLAY_DEGREE 2 # basic : normal display" << std::endl
8059 << "DISPLAY_DEGREE 0030 # advanced: display only" << std::endl
8060 << " # poll info" << std::endl
8061 << NOMAD::close_block()
8062 << NOMAD::close_block();
8063 chk = true;
8064 }
8065
8066 // DISPLAY_STATS:
8067 // ---------------
8068 if ( display_all || NOMAD::string_find ( "DISPLAY_STATS OUTPUTS LATEX FORMAT \
8069 SCREEN DEBUG BASIC" , param_names ) ) {
8070 _out << std::endl
8071 << NOMAD::open_block ( "DISPLAY_STATS (basic)" ) << std::endl
8072 << ". format of the outputs displayed at each success" << std::endl
8073 << " (single-objective)" << std::endl
8074 << ". format of the final Pareto front" << std::endl
8075 << " (multi-objective)" << std::endl
8076 << ". displays more points with DISPLAY_ALL_EVAL=true" << std::endl
8077 << ". arguments: list of strings possibly including" << std::endl
8078 << " the following keywords:" << std::endl
8079 << " BBE : blackbox evaluations" << std::endl
8080 << " BBO : blackbox outputs" << std::endl
8081 << " BLK_EVA : number of blocks of evaluations" << std::endl
8082 << " EVAL : evaluations (includes cache hits)" << std::endl
8083 << " MESH_INDEX: mesh index" << std::endl
8084 << " MESH_SIZE : mesh size delta_k^m" << std::endl
8085 << " OBJ : objective function value" << std::endl
8086 << " POLL_SIZE : poll size delta_k^p" << std::endl
8087 << " SIM_BBE : simulated blackbox evaluations" << std::endl
8088 << " SGTE : surrogate evaluations" << std::endl
8089 << " SOL : current feasible iterate" << std::endl
8090 << " STAT_SUM : value of stat SUM" << std::endl
8091 << " STAT_AVG : value of stat AVG" << std::endl
8092 << " TIME : real time in seconds" << std::endl
8093 << " VARi : value of variable i" << std::endl
8094 << " (0 for the first variable)" << std::endl
8095 << ". all outputs may be formatted using C style" << std::endl
8096 << " (%f, %e, %E, %g, %G, %i, %d with the possibility" << std::endl
8097 << " to specify the display width and the precision)" << std::endl
8098 << " example: %5.2Ef displays f in 5 columns and 2 decimals" << std::endl
8099 << " in scientific notation" << std::endl
8100 << ". do not use quotes" << std::endl
8101 << ". the \'%\' character may be explicitely indicated with \'\\%\'"
8102 << std::endl
8103 << ". see details in user guide" << std::endl
8104 << ". defaults: BBE OBJ (single-objective)" << std::endl
8105 << " OBJ (multi-objective)" << std::endl
8106 << ". " << NOMAD::open_block ( "examples" )
8107 << "DISPLAY_STATS TIME f=OBJ" << std::endl
8108 << "DISPLAY_STATS %5.2obj" << std::endl
8109 << "# for LaTeX tables:" << std::endl
8110 << "DISPLAY_STATS $BBE$ & ( $%12.5SOL, ) & $OBJ$ \\\\" << std::endl
8111 << NOMAD::close_block() << NOMAD::close_block();
8112 chk = true;
8113 }
8114
8115 // F_TARGET:
8116 // ---------
8117 if ( display_all || NOMAD::string_find ( "F_TARGET BASIC BLACK-BOXES BLACKBOXES \
8118 BI-OBJECTIVES STOPPING \
8119 MULTI-OBJECTIVES \
8120 BIOBJECTIVES MULTIOBJECTIVES \
8121 BI-MADS BIMADS \
8122 TERMINATES TERMINATION" , param_names ) ) {
8123 _out << std::endl
8124 << NOMAD::open_block ( "F_TARGET (basic)" ) << std::endl
8125 << ". NOMAD terminates if fi <= F_TARGET[i] for" << std::endl
8126 << " all objectives i" << std::endl
8127 << ". arguments: one or two reals (single or bi-obj.)" << std::endl
8128 << ". no default" << std::endl
8129 << ". " << NOMAD::open_block ( "examples" )
8130 << "F_TARGET 0.0 # single-objective" << std::endl
8131 << "F_TARGET ( 0.0 0.0 ) # bi-objective" << std::endl
8132 << NOMAD::close_block() << NOMAD::close_block();
8133 chk = true;
8134 }
8135
8136
8137 // HISTORY_FILE:
8138 // -------------
8139 if ( display_all || NOMAD::string_find ( "HISTORY_FILE BASIC \
8140 FILES OUTPUTS" , param_names ) ) {
8141 _out << std::endl
8142 << NOMAD::open_block ( "HISTORY_FILE (basic)" ) << std::endl
8143 << ". history file: contains all trial points" << std::endl
8144 << ". does not include multiple evaluations" << std::endl
8145 << ". argument: one string" << std::endl
8146 << ". no default" << std::endl
8147 << ". the seed is added to the file name" << std::endl
8148 << " if ADD_SEED_TO_FILE_NAMES=\'yes\'" << std::endl
8149 << ". example: HISTORY_FILE his.txt" << std::endl
8150 << NOMAD::close_block();
8151 chk = true;
8152 }
8153
8154
8155 // INITIAL_MESH_SIZE:
8156 // ------------------
8157 if ( display_all || NOMAD::string_find ( "INITIAL_MESH_SIZE BASIC MADS \
8158 DELTA_0 " , param_names ) ) {
8159 _out << std::endl
8160 << NOMAD::open_block ( "INITIAL_MESH_SIZE (basic)" ) << std::endl
8161 << ". initial mesh size" << std::endl
8162 << ". arguments: one or DIMENSION positive real(s)" << std::endl
8163 << ". no default" << std::endl
8164 << ". NOMAD uses one mesh size per variable." << std::endl
8165 << ". values can be given with \'r\' to indicate a proportion of" << std::endl
8166 << " the bounds range (bounds have to be defined for the" << std::endl
8167 << " corresponding variables)" << std::endl
8168 << ". initial poll size is determined from initial mesh size" << std::endl
8169 << " when provided, but providing both is not allowed. " << std::endl
8170 << ". " << NOMAD::open_block ( "examples" )
8171 << "INITIAL_MESH_SIZE 1.0 # for all variables" << std::endl
8172 << "INITIAL_MESH_SIZE ( 3 - r0.1 ) # for all variables" << std::endl
8173 << " # (default considered" << std::endl
8174 << " # for 2nd variable)" << std::endl
8175 << "INITIAL_MESH_SIZE 1 0.5 # for var. 1 only" << std::endl
8176 << "INITIAL_MESH_SIZE 2-4 r0.25 # for var. 2 to 4" << std::endl
8177 << NOMAD::close_block()
8178 << NOMAD::close_block();
8179 chk = true;
8180 }
8181
8182
8183 // INITIAL_POLL_SIZE:
8184 // ------------------
8185 if ( display_all || NOMAD::string_find ( "INITIAL_POLL_SIZE BASIC MADS \
8186 DELTA_0 " , param_names ) ) {
8187 _out << std::endl
8188 << NOMAD::open_block ( "INITIAL_POLL_SIZE (basic)" ) << std::endl
8189 << ". initial poll size" << std::endl
8190 << ". arguments: one or DIMENSION positive real(s)" << std::endl
8191 << ". defaults: r0.1 if bounds are defined (10% of the range)," << std::endl
8192 << " |x0|/10 otherwise (if x0!=0)" << std::endl
8193 << ". NOMAD uses one poll size per variable to achieve scaling" << std::endl
8194 << ". values can be given with \'r\' to indicate a proportion of" << std::endl
8195 << " the bounds range (bounds have to be defined for the" << std::endl
8196 << " corresponding variables)." << std::endl
8197 << ". the initial mesh size is determined from initial poll size" << std::endl
8198 << " when provided, but providing both is not allowed. " << std::endl
8199 << ". " << NOMAD::open_block ( "examples" )
8200 << "INITIAL_POLL_SIZE 1.0 # for all variables" << std::endl
8201 << "INITIAL_POLL_SIZE ( 3 - r0.1 ) # for all variables" << std::endl
8202 << " # (default considered" << std::endl
8203 << " # for 2nd variable)" << std::endl
8204 << "INITIAL_POLL_SIZE 1 0.5 # for var. 1 only" << std::endl
8205 << "INITIAL_POLL_SIZE 2-4 r0.25 # for var. 2 to 4" << std::endl
8206 << NOMAD::close_block()
8207 << NOMAD::close_block();
8208 chk = true;
8209 }
8210
8211
8212 // LH_SEARCH:
8213 // ----------
8214 if ( display_all || NOMAD::string_find ( "LH_SEARCH LATIN-HYPERCUBE \
8215 SAMPLING BASIC" , param_names ) ) {
8216 _out << std::endl
8217 << NOMAD::open_block ( "LH_SEARCH (basic)" ) << std::endl
8218 << ". Latin-Hypercube sampling (search)" << std::endl
8219 << ". arguments: two nonnegative integers p0 and pi" << std::endl
8220 << ". defaults: no search for single-objective" << std::endl
8221 << " or one initial search for bi-objective" << std::endl
8222 << " (see user guide)" << std::endl
8223 << ". p0: number of initial LH search points" << std::endl
8224 << " (or in first MADS run for bi-obj.)" << std::endl
8225 << ". pi: LH search points at each iteration" << std::endl
8226 << " (or in 2nd MADS run for bi-obj.)" << std::endl
8227 << ". the search can be opportunistic or not" << std::endl
8228 << " (see parameter OPPORTUNISTIC_LH)" << std::endl
8229 << ". example: LH_SEARCH 100 0" << std::endl
8230 << NOMAD::close_block();
8231 chk = true;
8232 }
8233
8234 // LOWER_BOUND:
8235 // ------------
8236 if ( display_all || NOMAD::string_find ( "LOWER_BOUND BASIC LB BOUNDS FILES" ,
8237 param_names ) ) {
8238 _out << std::endl
8239 << NOMAD::open_block ( "LOWER_BOUND (basic)" ) << std::endl
8240 << ". lower bounds for each variable" << std::endl
8241 << ". no default" << std::endl
8242 << ". can be defined by various methods (see user guide)" << std::endl
8243 << ". " << NOMAD::open_block ( "examples" )
8244 << "LOWER_BOUND * 0.0 # all variables are nonnegative" << std::endl
8245 << "LOWER_BOUND 0-2 0.0 # the 3 first var. are nonnegative" << std::endl
8246 << "LOWER_BOUND 0 0.0 # the first var. is nonnegative" << std::endl
8247 << "LOWER_BOUND lb.txt # bounds are defined in \'lb.txt\'" << std::endl
8248 << " # containing DIMENSION values" << std::endl
8249 << NOMAD::close_block() << NOMAD::close_block();
8250 chk = true;
8251 }
8252
8253 // MAX_BB_EVAL:
8254 // ------------
8255 if ( display_all || NOMAD::string_find ( "MAX_BB_EVAL BASIC BLACK-BOXES BLACKBOXES \
8256 MAXIMUM CACHE BBEVAL \
8257 NUMBER EVALUATIONS STOPPING \
8258 BI-0BJECTIVE MULTI-OBJECTIVE \
8259 BIOBJECTIVES MULTIOBJECTIVES \
8260 BI-MADS BIMADS \
8261 TERMINATES TERMINATION" , param_names ) ) {
8262 _out << std::endl
8263 << NOMAD::open_block ( "MAX_BB_EVAL (basic)" ) << std::endl
8264 << ". maximum number of blackbox evaluations" << std::endl
8265 << ". argument: one positive integer" << std::endl
8266 << ". no default" << std::endl
8267 << ". doesn\'t consider evaluations taken in the" << std::endl
8268 << " cache (cache hits)" << std::endl
8269 << ". in bi-objective mode: max number of blackbox" << std::endl
8270 << " evaluations for each MADS run" << std::endl
8271 << ". example: MAX_BB_EVAL 1000" << std::endl
8272 << NOMAD::close_block();
8273 chk = true;
8274 }
8275
8276 // MAX_TIME:
8277 // ---------
8278 if ( display_all || NOMAD::string_find ( "MAX_TIME BASIC BLACK-BOXES BLACKBOXES \
8279 MAXIMUM WALL-CLOCK REAL \
8280 STOPPING TERMINATION \
8281 TERMINATES" , param_names ) ) {
8282 _out << std::endl
8283 << NOMAD::open_block ( "MAX_TIME (basic)" ) << std::endl
8284 << ". maximum wall-clock time in seconds" << std::endl
8285 << ". argument: one positive integer" << std::endl
8286 << ". no default" << std::endl
8287 << ". example: MAX_TIME 3600 # one hour max" << std::endl
8288 << NOMAD::close_block();
8289 chk = true;
8290 }
8291
8292
8293 // SOLUTION_FILE:
8294 // --------------
8295 if ( display_all || NOMAD::string_find ( "SOLUTION_FILE BASIC \
8296 FILES OUTPUTS" , param_names ) ) {
8297 _out << std::endl
8298 << NOMAD::open_block ( "SOLUTION_FILE (basic)" ) << std::endl
8299 << ". file containing the solution" << std::endl
8300 << ". argument: one string" << std::endl
8301 << ". no default" << std::endl
8302 << ". the seed is added to the file name if" << std::endl
8303 << " ADD_SEED_TO_FILE_NAMES=\'yes\'" << std::endl
8304 << ". example: SOLUTION_FILE sol.txt" << std::endl
8305 << NOMAD::close_block();
8306 chk = true;
8307 }
8308
8309
8310
8311 // STATS_FILE:
8312 // -----------
8313 if ( display_all || NOMAD::string_find ( "STATS_FILE BASIC \
8314 FILES OUTPUTS DISPLAY_STATS" ,
8315 param_names ) ) {
8316 _out << std::endl
8317 << NOMAD::open_block ( "STATS_FILE (basic)" ) << std::endl
8318 << ". file containing all successes with the same format" << std::endl
8319 << " than DISPLAY_STATS" << std::endl
8320 << ". displays more points with DISPLAY_ALL_EVAL=true" << std::endl
8321 << ". arguments: one string (file name) and one" << std::endl
8322 << " list of strings (stats)" << std::endl
8323 << ". no default" << std::endl
8324 << ". the seed is added to the file name if" << std::endl
8325 << " ADD_SEED_TO_FILE_NAMES=\'yes\'" << std::endl
8326 << ". example: STATS_FILE log.txt BBE SOL f=%.2EOBJ" << std::endl
8327 << NOMAD::close_block();
8328 chk = true;
8329 }
8330
8331 // TMP_DIR:
8332 // --------
8333 if ( display_all || NOMAD::string_find ( "TMP_DIR BASIC PATH TEMPORARY \
8334 DIRECTORY FILES \
8335 BLACK-BOXES BLACKBOXES" , param_names ) ) {
8336 _out << std::endl
8337 << NOMAD::open_block ( "TMP_DIR (basic)" ) << std::endl
8338 << ". temporary directory for blackbox input/output files" << std::endl
8339 << ". argument: one string indicating a directory" << std::endl
8340 << ". default: problem directory" << std::endl
8341 << ". improved performance with a local temporary directory" << std::endl
8342 << ". example: TMP_DIR /tmp" << std::endl
8343 << NOMAD::close_block();
8344 chk = true;
8345 }
8346
8347
8348
8349 // UPPER_BOUND:
8350 // ------------
8351 if ( display_all || NOMAD::string_find ( "UPPER_BOUND BASIC UB BOUNDS" ,
8352 param_names ) ) {
8353 _out << std::endl
8354 << NOMAD::open_block ( "UPPER_BOUND (basic)" ) << std::endl
8355 << ". upper bounds for each variable" << std::endl
8356 << ". same logic as parameter LOWER_BOUND" << std::endl
8357 << NOMAD::close_block();
8358 chk = true;
8359 }
8360
8361
8362
8363 // X0:
8364 // ---
8365 if ( display_all || NOMAD::string_find ( "X0 STARTING POINT BASIC \
8366 VARIABLES \
8367 LH LATIN-HYPERCUBE \
8368 CACHE FILES" , param_names ) ) {
8369 _out << std::endl
8370 << NOMAD::open_block ( "X0 (basic)" ) << std::endl
8371 << ". starting point(s)" << std::endl
8372 << ". arguments: text file name," << std::endl
8373 << " or cache file name," << std::endl
8374 << " or DIMENSION reals," << std::endl
8375 << " or indexed values" << std::endl
8376 << ". default: best point from a cache file or from" << std::endl
8377 << " an initial LH search" << std::endl
8378 << ". do not use a surrogate cache file" << std::endl
8379 << " (even if OPT_ONLY_SGTE=\'yes\')" << std::endl
8380 << ". more than one starting point can be defined (all points" << std::endl
8381 << " are evaluated: x0 evaluations are not opportunistic)" << std:: endl
8382 << ". a text file can describe more than one point" << std::endl
8383 << ". may be infeasible, but can only violate PB, F, or PEB" << std::endl
8384 << " constraints" << std::endl
8385 << ". cannot be outside bounds" << std::endl
8386 << ". must respect fixed variables (param. FIXED_VARIABLE)" << std::endl
8387 << ". " << NOMAD::open_block ("examples") << std::endl
8388 << "X0 x0.txt # text file with a multiple" << std::endl
8389 << " # of DIMENSION values" << std::endl << std::endl
8390 << "X0 * 0.0 # first starting point" << std::endl
8391 << "X0 1 * 1.0 # second starting point" << std::endl << std::endl
8392 << "X0 ( 0 1 2 ) # if DIMENSION=3" << std::endl << std::endl
8393 << "see other examples in user guide" << std::endl
8394 << NOMAD::close_block()
8395 << NOMAD::close_block();
8396 chk = true;
8397 }
8398
8399
8400 if ( display_all || NOMAD::string_find ( registered_key_advanced , param_names ) )
8401 {
8402 _out << "--------------------------------------------------------------" << endl;
8403 _out << "---------------------ADVANCED PARAMETERS----------------------" << endl;
8404 _out << "--------------------------------------------------------------" << endl;
8405 }
8406
8407 // ADD_SEED_TO_FILE_NAMES:
8408 // -----------------------
8409 if ( display_all || NOMAD::string_find ( "ADD_SEED_TO_FILE_NAMES OUTPUTS \
8410 ADVANCED FILES" , param_names ) ) {
8411 _out << std::endl
8412 << NOMAD::open_block ( "ADD_SEED_TO_FILE_NAMES (advanced)" ) << std::endl
8413 << ". if \'yes\', the seed is added to the name of" << std::endl
8414 << " output files (HISTORY_FILE, SOLUTION_FILE," << std::endl
8415 << " and STATS_FILE)" << std::endl
8416 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8417 << ". default: \'yes\'" << std::endl
8418 << ". example: ADD_SEED_TO_FILE_NAMES no" << std::endl
8419 << NOMAD::close_block();
8420 chk = true;
8421 }
8422
8423 // ANISOTROPIC_MESH:
8424 // -------------
8425 if ( display_all || NOMAD::string_find ( "ANISOTROPIC MESH SCALING" , param_names ) ) {
8426 _out << std::endl
8427 << NOMAD::open_block ( "ANISOTROPIC_MESH (advanced)" ) << std::endl
8428 << ". use anisotropic mesh for generating directions" << std::endl
8429 << ". if \'yes\', the mesh size is scaled dynamically" << std::endl
8430 << ". based on direction of success." << std::endl
8431 << ". This option is compatible with Ortho Mads " << std::endl
8432 << ". directions only " << std::endl
8433 << ". default: \'yes\'" << std::endl
8434 << ". example: ANISOTROPIC_MESH no" << std::endl
8435 << NOMAD::close_block();
8436 chk = true;
8437 }
8438
8439
8440 // ASYNCHRONOUS:
8441 // -------------
8442 if ( display_all || NOMAD::string_find ( "ASYNCHRONOUS PARALLELISM MPI \
8443 ADVANCED PMADS" , param_names ) ) {
8444 _out << std::endl
8445 << NOMAD::open_block ( "ASYNCHRONOUS (advanced)" ) << std::endl
8446 << ". asynchronous strategy for the parallel version" << std::endl
8447 << ". if \'yes\', there can be evaluations in progress" << std::endl
8448 << " after an iteration has ended" << std::endl
8449 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8450 << ". default: \'yes\'" << std::endl
8451 << ". example: ASYNCHRONOUS no" << std::endl
8452 << NOMAD::close_block();
8453 chk = true;
8454 }
8455
8456
8457 // BB_INPUT_INCLUDE_SEED:
8458 // ----------------------
8459 if ( display_all || NOMAD::string_find ( "BB_INPUT_INCLUDE_SEED BLACK-BOXES \
8460 BLACKBOXES \
8461 ADVANCED FILES" , param_names ) ) {
8462 _out << std::endl
8463 << NOMAD::open_block ( "BB_INPUT_INCLUDE_SEED (advanced)" ) << std::endl
8464 << ". if \'yes\', the seed (\'SEED\') of the current" << std::endl
8465 << " execution is put as the first entry in" << std::endl
8466 << " all blackbox input files" << std::endl
8467 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8468 << ". default: \'no\'" << std::endl
8469 << ". example: BB_INPUT_INCLUDE_SEED yes" << std::endl
8470 << NOMAD::close_block();
8471 chk = true;
8472 }
8473
8474 // BB_INPUT_INCLUDE_TAG:
8475 // ---------------------
8476 if ( display_all || NOMAD::string_find ( "BB_INPUT_INCLUDE_TAG \
8477 BLACK-BOXES BLACKBOXES \
8478 ADVANCED FILES" , param_names ) ) {
8479 _out << std::endl
8480 << NOMAD::open_block ( "BB_INPUT_INCLUDE_TAG (advanced)" ) << std::endl
8481 << ". if \'yes\', the tag of a point is put as the first" << std::endl
8482 << " entry in all blackbox input files (second" << std::endl
8483 << " entry if BB_INPUT_INCLUDE_SEED=\'yes\')" << std::endl
8484 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8485 << ". default: \'no\'" << std::endl
8486 << ". example: BB_INPUT_INCLUDE_TAG yes" << std::endl
8487 << NOMAD::close_block();
8488 chk = true;
8489 }
8490
8491
8492 // BB_REDIRECTION:
8493 // ---------------
8494 if ( display_all || NOMAD::string_find ( "BB_REDIRECTION BLACK-BOXES BLACKBOXES \
8495 ADVANCED OUTPUT FILES" , param_names ) ) {
8496 _out << std::endl
8497 << NOMAD::open_block ( "BB_REDIRECTION (advanced)" ) << std::endl
8498 << ". if NOMAD uses a redirection (\'>\') to" << std::endl
8499 << " create blackbox output files" << std::endl
8500 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8501 << ". default: \'yes\'" << std::endl
8502 << ". if \'no\', the blackbox has to manage its" << std::endl
8503 << " own output files (see user guide)" << std::endl
8504 << ". example: BB_INPUT_INCLUDE_TAG yes" << std::endl
8505 << NOMAD::close_block();
8506 chk = true;
8507 }
8508
8509
8510 // CACHE_SAVE_PERIOD:
8511 // ------------------
8512 if ( display_all || NOMAD::string_find ( "CACHE_SAVE_PERIOD OUTPUTS \
8513 ITERATIONS ADVANCED FILES" , param_names ) )
8514 {
8515 _out << std::endl
8516 << NOMAD::open_block ( "CACHE_SAVE_PERIOD (advanced)" ) << std::endl
8517 << ". period (iterations) at which the cache file is saved" << std::endl
8518 << " (if CACHE_FILE is defined; disabled for bi-objective)" << std::endl
8519 << ". argument: one nonnegative integer" << std::endl
8520 << ". default: 25" << std::endl
8521 << ". example: CACHE_SAVE_PERIOD 10" << std::endl
8522 << NOMAD::close_block();
8523 chk = true;
8524 }
8525
8526 // CACHE_SEARCH:
8527 // -------------
8528 if ( display_all || NOMAD::string_find ( "CACHE_SEARCH ADVANCED\
8529 CACHE_FILE SGTE_CACHE_FILE" , param_names ) )
8530 {
8531 _out << std::endl
8532 << NOMAD::open_block ( "CACHE_SEARCH (advanced)" ) << std::endl
8533 << ". enable or disable the cache search" << std::endl
8534 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8535 << ". default: \'no\'" << std::endl
8536 << ". the search looks in the cache between iterations" << std::endl
8537 << ". this can be useful when a non-empty initial cache" << std::endl
8538 << " file is provided or with an extern cache that" << std::endl
8539 << " the user updates independently" << std::endl
8540 << ". example: CACHE_SEARCH yes" << std::endl
8541 << NOMAD::close_block();
8542 chk = true;
8543 }
8544
8545 // CLOSED_BRACE:
8546 // -------------
8547 if ( display_all || NOMAD::string_find ( "CLOSED_BRACES INDENTATION TABULATIONS \
8548 BLOCKS ADVANCED DISPLAY" , param_names ) )
8549 {
8550 _out << std::endl
8551 << NOMAD::open_block ( "CLOSED_BRACE (advanced)" ) << std::endl
8552 << ". string displayed at the end of indented" << std::endl
8553 << " blocks in full display mode" << std::endl
8554 << ". argument: one string" << std::endl
8555 << ". default: \'}\'" << std::endl
8556 << ". example: CLOSED_BRACE End" << std::endl
8557 << NOMAD::close_block();
8558 chk = true;
8559 }
8560
8561
8562 // DISABLE MODELS / EVAL_SORT
8563 //-----------
8564 if ( display_all || NOMAD::string_find ( "MODEL DISABLE MODELS DISABLE_MODELS \
8565 MODEL_EVAL_SORT ADVANCED \
8566 EVAL_SORT \
8567 ORTHO N+1 QUAD QUADRATIC MODEL_SEARCH TGP " ,
8568 param_names ) ) {
8569 _out << std::endl
8570 << NOMAD::open_block ( "DISABLE (advanced)" ) << std::endl
8571 << ". this parameter is used to forcefully disable a feature." << std::endl
8572 << ". argument: MODELS or EVAL_SORT" << std::endl
8573 << ". # DISABLE MODELS is equivalent to set: " << std::endl
8574 << " MODEL_EVAL_SORT no " << std::endl
8575 << " MODEL_SEARCH no " << std::endl
8576 << " DIRECTION_TYPE ORTHO N+1 NEG " << std::endl
8577 << " # WARNING: extra settings of MODEL_EVAL_SORT," << std::endl
8578 << " MODEL_SEARCH and DIRECTION_TYPE ORTHO N+1 QUAD" << std::endl
8579 << " will be ignored " << std::endl
8580 << ". # DISABLE EVAL_SORT: ordering by lexicographic order only. " << std::endl
8581 << " # WARNING: setting of MODEL_EVAL_SORT," << std::endl
8582 << " SURROGATE_EVAL_SORT and user priority " << std::endl
8583 << " will be ignored" << std::endl
8584 << ". default: no default" << std::endl
8585
8586 << NOMAD::close_block();
8587 chk = true;
8588 }
8589
8590 // BB_MAX_BLOCK_SIZE
8591 //-----------
8592 if ( display_all || NOMAD::string_find ( "EVAL LIST MAX BLOCK SIZE BB BLACKBOX \
8593 BLACK-BOX OPPORTUNIST OPPORTUNISTIC PARALLEL",
8594 param_names ) ) {
8595 _out << std::endl
8596 << NOMAD::open_block ( "BB_MAX_BLOCK_SIZE (advanced)" ) << std::endl
8597 << ". maximum size of a block of evaluations send to the blackbox" << std::endl
8598 << " executable at once. Blackbox executable can manage parallel" << std::endl
8599 << " evaluations on its own. Opportunistic strategies may apply after" << std::endl
8600 << " each block of evaluations." << std::endl
8601 << " Depending on the algorithm phase, the blackbox executable will" << std::endl
8602 << " receive at most BB_MAX_BLOCK_SIZE points to evaluate." << std::endl
8603 << " When this parameter is greater than one, the number of evaluations"<< std::endl
8604 << " may exceed the MAX_BB_EVAL stopping criterion." << std::endl
8605 << ". argument: integer > 0" << std::endl
8606 << ". example: BB_MAX_BLOCK_SIZE 3," << std::endl
8607 << " The blackbox executable receives blocks of" << std::endl
8608 << " at most 3 points for evaluation." << std::endl
8609 << ". default: 1" << std::endl
8610 << NOMAD::close_block();
8611 chk = true;
8612 }
8613
8614
8615 // EXTENDED_POLL_ENABLED:
8616 // ----------------------
8617 if ( display_all || NOMAD::string_find ( "EXTENDED_POLL_ENABLED \
8618 EXTENDED_POLL_DISABLED \
8619 MIXED MVP CATEGORICAL \
8620 ADVANCED" ,
8621 param_names ) ) {
8622 _out << std::endl
8623 << NOMAD::open_block ( "EXTENDED_POLL_ENABLED (advanced)" ) << std::endl
8624 << ". if \'no\', the extended poll for categorical" << std::endl
8625 << " variables is disabled" << std::endl
8626 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8627 << ". default: \'yes\'" << std::endl
8628 << ". the extended poll uses the surrogate" << std::endl
8629 << " if HAS_SGTE or SGTE_EXE is defined" << std::endl
8630 << ". example: EXTENDED_POLL_ENABLED yes" << std::endl
8631 << NOMAD::close_block();
8632 chk = true;
8633 }
8634
8635 // EXTENDED_POLL_TRIGGER:
8636 // ----------------------
8637 if ( display_all || NOMAD::string_find ( "EXTENDED_POLL_TRIGGER ADVANCED \
8638 MIXED MVP CATEGORICAL" , param_names ) ) {
8639 _out << std::endl
8640 << NOMAD::open_block ( "EXTENDED_POLL_TRIGGER (advanced)" ) << std::endl
8641 << ". extended poll trigger for categorical variables" << std::endl
8642 << ". argument: one positive real (can be relative)" << std::endl
8643 << ". an extended poll around the extended poll point y" << std::endl
8644 << " constructed from an iterate xk is performed if" << std::endl
8645 << " f(y) < f(xk)+trigger or f(y) < f(xk)+|f(x_k)|*trigger" << std::endl
8646 << " (relative value)" << std::endl
8647 << ". see details in user guide" << std::endl
8648 << ". default: r0.1" << std::endl
8649 << ". " << NOMAD::open_block ( "examples" )
8650 << "EXTENDED_POLL_TRIGGER 10.0 # ext poll trigger of 10" << std::endl
8651 << "EXTENDED_POLL_TRIGGER r0.2 # ext poll trigger of 20%" << std::endl
8652 << NOMAD::close_block() << NOMAD::close_block();
8653 chk = true;
8654 }
8655
8656
8657 // FIXED_VARIABLE:
8658 // ---------------
8659 if ( display_all || NOMAD::string_find ( "FIXED_VARIABLE VARIABLES ADVANCED \
8660 FILES" , param_names ) ) {
8661 _out << std::endl
8662 << NOMAD::open_block ( "FIXED_VARIABLE (advanced)" ) << std::endl
8663 << ". fix some variables to some specific values" << std::endl
8664 << ". arguments: variable indexes and values" << std::endl
8665 << ". no default" << std::endl
8666 << ". values are optional if at least one starting point" << std::endl
8667 << " is defined" << std::endl
8668 << ". can be given by a text file containing DIMENSION" << std::endl
8669 << " entrie (use \'-\' for free variables)" << std::endl
8670 << ". variables inside groups defined by VARIABLE_GROUP" << std::endl
8671 << " cannot be fixed" << std::endl
8672 << ". " << NOMAD::open_block ( "examples" )
8673 << "FIXED_VARIABLE ( 0.0 - 0.0 ) # variables 0 and 2 are fixed" << std::endl
8674 << "FIXED_VARIABLE fixed.txt # with a file" << std::endl
8675 << "FIXED_VARIABLE 0-1 3.14 # 2 first variables fixed" << std::endl
8676 << " # to 3.14" << std::endl
8677 << "FIXED_VARIABLE 0 # first variable fixed to" << std::endl
8678 << " # its X0 value" << std::endl
8679 << NOMAD::close_block() << NOMAD::close_block();
8680 chk = true;
8681 }
8682
8683 // H_MAX_0:
8684 // --------
8685 if ( display_all || NOMAD::string_find ( "H_MAX_0 HMAX_0 HMAX ADVANCED \
8686 CONSTRAINTS PB FILTER PEB \
8687 L1 L2 LINF L_INF \
8688 FEASIBILITY \
8689 PROGRESSIVE-BARRIER" , param_names ) ) {
8690 _out << std::endl
8691 << NOMAD::open_block ( "H_MAX_0 (advanced)" ) << std::endl
8692 << ". initial value of h_max (for PB and" << std::endl
8693 << " F constraints handling strategies)" << std::endl
8694 << ". argument: one positive real" << std::endl
8695 << ". default: 1E+20" << std::endl
8696 << ". points x such that h(x) > h_max are" << std::endl
8697 << " rejected (h measures the feasibility)" << std::endl
8698 << ". example: H_MAX_0 100.0" << std::endl
8699 << NOMAD::close_block();
8700 chk = true;
8701 }
8702
8703 // H_MIN:
8704 // ------
8705 if ( display_all || NOMAD::string_find ( "H_MIN HMIN ADVANCED \
8706 CONSTRAINTS PB FILTER PEB \
8707 L1 L2 LINF L_INF \
8708 FEASIBILITY \
8709 PROGRESSIVE-BARRIER" , param_names ) ) {
8710 _out << std::endl
8711 << NOMAD::open_block ( "H_MIN (advanced)" ) << std::endl
8712 << ". value of h_min; x is feasible if h(x) <= h_min" << std::endl
8713 << " (h measures the feasibility)" << std::endl
8714 << ". argument: one positive real" << std::endl
8715 << ". default: 0.0" << std::endl
8716 << ". example: H_MIN 1E-5" << std::endl
8717 << NOMAD::close_block();
8718 chk = true;
8719 }
8720
8721 // H_NORM:
8722 // -------
8723 if ( display_all || NOMAD::string_find ( "H_NORM ADVANCED \
8724 CONSTRAINTS PB FILTER PEB \
8725 L1 L2 LINF L_INF \
8726 FEASIBILITY \
8727 PROGRESSIVE-BARRIER" , param_names ) ) {
8728 _out << std::endl
8729 << NOMAD::open_block ( "H_NORM (advanced)" ) << std::endl
8730 << ". norm used by the F and PB constraints handling" << std::endl
8731 << " strategies to compute h(x) (h measures the" << std::endl
8732 << " feasibility)" << std::endl
8733 << ". argument: one string in {\'L1\', \'L2\', \'Linf\'}" << std::endl
8734 << ". default: \'L2\'" << std::endl
8735 << ". example: H_NORM Linf" << std::endl
8736 << NOMAD::close_block();
8737 chk = true;
8738 }
8739
8740
8741 // HAS_SGTE:
8742 // ---------
8743 if ( display_all || NOMAD::string_find ( "HAS_SGTE SGTE_EXE ADVANCED SURROGATES \
8744 BLACK-BOXES BLACKBOXES \
8745 SGTES" , param_names ) ) {
8746 _out << std::endl
8747 << NOMAD::open_block ( "HAS_SGTE (advanced)" ) << std::endl
8748 << ". to indicate that the problem has a surrogate" << std::endl
8749 << ". argument: one boolean (\'yes\' or \'no\') " << std::endl
8750 << ". default: \'no\' if parameter SGTE_EXE is undefined," << std::endl
8751 << " \'yes\' otherwise" << std::endl
8752 << ". this parameter is not necessary in batch" << std::endl
8753 << " mode, but essential in library mode when" << std::endl
8754 << " no surrogate executable is provided" << std::endl
8755 << ". example: HAS_SGTE yes" << std::endl
8756 << NOMAD::close_block();
8757 chk = true;
8758 }
8759
8760
8761 // INF_STR:
8762 // --------
8763 if ( display_all || NOMAD::string_find ( "INF_STR ADVANCED \
8764 INFINITY DISPLAY REALS" ,
8765 param_names ) ) {
8766 _out << std::endl
8767 << NOMAD::open_block ( "INF_STR (advanced)" ) << std::endl
8768 << ". string used to display infinity" << std::endl
8769 << ". argument: one string" << std::endl
8770 << ". default: \"inf\"" << std::endl
8771 << ". example: INF_STR Infinity" << std::endl
8772 << NOMAD::close_block();
8773 chk = true;
8774 }
8775
8776 // MAX_CACHE_MEMORY:
8777 // -----------------
8778 if ( display_all || NOMAD::string_find ( "MAX_CACHE_MEMORY ADVANCED \
8779 MAXIMUM RAM STOPPING \
8780 MB MEGA-BYTES MEGABYTES \
8781 TERMINATES TERMINATION" , param_names ) ) {
8782 _out << std::endl
8783 << NOMAD::open_block ( "MAX_CACHE_MEMORY (advanced)" ) << std::endl
8784 << ". the program terminates as soon as the cache" << std::endl
8785 << " reaches this memory limit" << std::endl
8786 << ". argument: one positive integer (expressed in MB)" << std::endl
8787 << ". default: 2000" << std::endl
8788 << ". example: MAX_CACHE_MEMORY 1024 # limit of 1GB cache" << std::endl
8789 << " # occupation" << std::endl
8790 << NOMAD::close_block();
8791 chk = true;
8792 }
8793
8794 // MAX_CONSECUTIVE_FAILED_ITERATIONS:
8795 // ----------------------------------
8796 if ( display_all || NOMAD::string_find ( "MAX_CONSECUTIVE_FAILED_ITERATIONS ADVANCED \
8797 TERMINATION STOPPING TERMINATES" , param_names ) ) {
8798 _out << std::endl
8799 << NOMAD::open_block ( "MAX_CONSECUTIVE_FAILED_ITERATIONS (advanced)" ) << std::endl
8800 << ". maximum number of consecutive failed iterations" << std::endl
8801 << ". arguments: one positive integer" << std::endl
8802 << ". no default" << std::endl
8803 << ". example: MAX_CONSECUTIVE_FAILED_ITERATIONS 5" << std::endl
8804 << NOMAD::close_block();
8805 chk = true;
8806 }
8807
8808 // MAX_EVAL:
8809 // ---------
8810 if ( display_all || NOMAD::string_find ( "MAX_EVAL ADVANCED BLACK-BOXES BLACKBOXES \
8811 MAXIMUM CACHE BBEVAL \
8812 NUMBER EVALUATIONS STOPPING \
8813 TERMINATES TERMINATION" , param_names ) ) {
8814 _out << std::endl
8815 << NOMAD::open_block ( "MAX_EVAL (advanced)" ) << std::endl
8816 << ". maximum number of evaluations" << std::endl
8817 << ". argument: one positive integer" << std::endl
8818 << ". no default" << std::endl
8819 << ". includes evaluations taken in" << std::endl
8820 << " the cache (cache hits)" << std::endl
8821 << ". example: MAX_EVAL 1000" << std::endl
8822 << NOMAD::close_block();
8823 chk = true;
8824 }
8825
8826 // MAX_ITERATIONS:
8827 // ---------------
8828 if ( display_all || NOMAD::string_find ( "MAX_ITERATIONS ADVANCED \
8829 MAXIMUM MADS \
8830 NUMBER STOPPING \
8831 TERMINATES TERMINATION" , param_names ) ) {
8832 _out << std::endl
8833 << NOMAD::open_block ( "MAX_ITERATIONS (advanced)" ) << std::endl
8834 << ". maximum number of MADS iterations" << std::endl
8835 << ". argument: one positive integer" << std::endl
8836 << ". no default" << std::endl
8837 << ". example: MAX_ITERATIONS 20" << std::endl
8838 << NOMAD::close_block();
8839 chk = true;
8840 }
8841
8842
8843 // MAX_SGTE_EVAL:
8844 // --------------
8845 if ( display_all || NOMAD::string_find ( "MAX_SGTE_EVAL ADVANCED BLACK-BOXES \
8846 BLACKBOXES \
8847 MAXIMUM SURROGATES BBEVAL SGTES \
8848 NUMBER EVALUATIONS STOPPING \
8849 TERMINATES TERMINATION" , param_names ) ) {
8850 _out << std::endl
8851 << NOMAD::open_block ( "MAX_SGTE_EVAL (advanced)" ) << std::endl
8852 << ". maximum number of surrogate evaluations" << std::endl
8853 << ". argument: one positive integer" << std::endl
8854 << ". no default" << std::endl
8855 << ". example: MAX_SGTE_EVAL 10000" << std::endl
8856 << NOMAD::close_block();
8857 chk = true;
8858 }
8859
8860 // MAX_SIM_BB_EVAL:
8861 // ----------------
8862 if ( display_all || NOMAD::string_find ( "MAX_SIM_BB_EVAL ADVANCED \
8863 BLACK-BOXES BLACKBOXES BBEVAL \
8864 MAXIMUM CACHE SIMULATED \
8865 NUMBER EVALUATIONS STOPPING \
8866 TERMINATES TERMINATION" , param_names ) ) {
8867 _out << std::endl
8868 << NOMAD::open_block ( "MAX_SIM_BB_EVAL (advanced)" ) << std::endl
8869 << ". maximum number of simulated blackbox evaluations" << std::endl
8870 << ". argument: one positive integer" << std::endl
8871 << ". no default" << std::endl
8872 << ". the same as MAX_BB_EVAL except that it considers" << std::endl
8873 << " initial cache hits (cache points that come from" << std::endl
8874 << " a cache file)" << std::endl
8875 << ". simulates the number of blackbox evaluations" << std::endl
8876 << " when no cache file is used" << std::endl
8877 << ". example: MAX_SIM_BB_EVAL 1000" << std::endl
8878 << NOMAD::close_block();
8879 chk = true;
8880 }
8881
8882
8883 // MESH_COARSENING_EXPONENT:
8884 // -------------------------
8885 if ( display_all || NOMAD::string_find ( "MESH_COARSENING_EXPONENT ADVANCED \
8886 MADS W+ \\DELTA" , param_names ) ) {
8887 _out << std::endl
8888 << NOMAD::open_block ( "MESH_COARSENING_EXPONENT (advanced)" ) << std::endl
8889 << ". mesh coarsening exponent w^+ used to update the mesh" << std::endl
8890 << " after successes (\\Delta^m_{k+1}=\\tau^{w^+}\\Delta^m_k)" << std::endl
8891 << ". argument: one nonnegative integer" << std::endl
8892 << ". default: 1" << std::endl
8893 << ". example: MESH_COARSENING_EXPONENT 0 # the mesh size is" << std::endl
8894 << " # not increased" << std::endl
8895 << " # after successes" << std::endl
8896 << NOMAD::close_block();
8897 chk = true;
8898 }
8899
8900 // MESH_REFINING_EXPONENT:
8901 // -----------------------
8902 if ( display_all || NOMAD::string_find ( "MESH_REFINING_EXPONENT ADVANCED \
8903 MADS W- \\DELTA" , param_names ) ) {
8904 _out << std::endl
8905 << NOMAD::open_block ( "MESH_REFINING_EXPONENT (advanced)" ) << std::endl
8906 << ". mesh refining exponent w^- used to update the mesh" << std::endl
8907 << " after failures (\\Delta^m_{k+1} = \\tau^{w^-}\\Delta^m_k)" << std::endl
8908 << ". argument: one negative" << std::endl
8909 << ". default: -1" << std::endl
8910 << ". example: MESH_REFINING_EXPONENT -2" << std::endl
8911 << NOMAD::close_block();
8912 chk = true;
8913 }
8914
8915 // MESH_UPDATE_BASIS:
8916 // ------------------
8917 if ( display_all || NOMAD::string_find ( "MESH_UPDATE_BASIS ADVANCED \
8918 MADS \\TAU \\DELTA" , param_names ) ) {
8919 _out << std::endl
8920 << NOMAD::open_block ( "MESH_UPDATE_BASIS (advanced)" ) << std::endl
8921 << ". mesh update basis \\tau used to update the" << std::endl
8922 << " mesh (\\Delta^m_{k+1} = \\tau^w\\Delta^m_k)" << std::endl
8923 << ". argument: one positive real > 1" << std::endl
8924 << ". default: 4.0" << std::endl
8925 << ". example: MESH_UPDATE_BASIS 2.0" << std::endl
8926 << NOMAD::close_block();
8927 chk = true;
8928 }
8929
8930 // MIN_MESH_SIZE:
8931 // --------------
8932 if ( display_all || NOMAD::string_find ( "MIN_MESH_SIZE ADVANCED \
8933 \\DELTA MINIMUM TERMINATION \
8934 STOPPING TERMINATES" , param_names ) ) {
8935 _out << std::endl
8936 << NOMAD::open_block ( "MIN_MESH_SIZE (advanced)" ) << std::endl
8937 << ". minimum mesh size" << std::endl
8938 << ". arguments: same logic as INITIAL_MESH_SIZE" << std::endl
8939 << " (\'r\' can be used)" << std::endl
8940 << ". no default" << std::endl
8941 << ". example: MIN_MESH_SIZE r1E-5" << std::endl
8942 << NOMAD::close_block();
8943 chk = true;
8944 }
8945
8946 // MIN_POLL_SIZE:
8947 // --------------
8948 if ( display_all || NOMAD::string_find ( "MIN_POLL_SIZE MESH ADVANCED \
8949 \\DELTA^P MINIMUM TERMINATION \
8950 STOPPING TERMINATES" , param_names ) ) {
8951 _out << std::endl
8952 << NOMAD::open_block ( "MIN_POLL_SIZE (advanced)" ) << std::endl
8953 << ". minimum poll size" << std::endl
8954 << ". arguments: same logic as INITIAL_MESH_SIZE" << std::endl
8955 << " (\'r\' can be used)" << std::endl
8956 << ". default: 1.0 for integer or binary variables, no default otherwise"
8957 << std::endl
8958 << ". example: MIN_POLL_SIZE r1E-5" << std::endl
8959 << NOMAD::close_block();
8960 chk = true;
8961 }
8962
8963
8964 // MODEL_EVAL_SORT:
8965 // ----------------
8966 if ( display_all || NOMAD::string_find ( "MODEL_ORDERING MODEL_EVAL_SORT ADVANCED \
8967 MODELS INTERPOLATION REGRESSION \
8968 MFN FROBENIUS QUADRATIC \
8969 TGP" , param_names ) ) {
8970 _out << std::endl
8971 << NOMAD::open_block ( "MODEL_EVAL_SORT (advanced)" ) << std::endl
8972 << ". if models are used to sort the trial points" << std::endl
8973 << ". disabled for more than 50 variables" << std::endl
8974 << ". disabled with categorical variables" << std::endl
8975 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
8976 << " or one string in {\'QUADRATIC\', \'TGP\'}" << std::endl
8977 << ". default: \'QUADRATIC\'" << std::endl
8978 << ". examples: MODEL_EVAL_SORT quadratic" << std::endl
8979 << " MODEL_EVAL_SORT yes # quadratic is used" << std::endl
8980 << " MODEL_EVAL_SORT no # no MES" << std::endl
8981 << NOMAD::close_block();
8982 chk = true;
8983 }
8984
8985
8986 // MODEL_SEARCH:
8987 // -------------
8988 if ( display_all || NOMAD::string_find ( "MODEL_SEARCH ADVANCED CATEGORICAL \
8989 MODELS INTERPOLATION REGRESSION \
8990 MFN FROBENIUS QUADRATIC PARALLEL \
8991 TGP" , param_names ) ) {
8992 _out << std::endl
8993 << NOMAD::open_block ( "MODEL_SEARCH (advanced)" ) << std::endl
8994 << ". model search (MS)" << std::endl
8995 << ". can be entered twice in order to define two searches" << std::endl
8996 << ". disabled for more than 50 variables" << std::endl
8997 << ". disabled with categorical variables" << std::endl
8998 << ". disabled in parallel mode" << std::endl
8999 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9000 << " or one string in {\'QUADRATIC\', \'TGP\'}" << std::endl
9001 << ". default: \'QUADRATIC\'" << std::endl
9002 << ". example: MODEL_SEARCH QUADRATIC" << std::endl
9003 << " MODEL_SEARCH TGP" << std::endl
9004 << NOMAD::close_block();
9005 chk = true;
9006 }
9007
9008
9009
9010 // MODEL_SEARCH_OPTIMISTIC:
9011 // ------------------------
9012 if ( display_all || NOMAD::string_find ( "MODEL_SEARCH_OPTIMISTIC ADVANCED \
9013 MODELS INTERPOLATION REGRESSION \
9014 MFN FROBENIUS QUADRATIC \
9015 TGP" , param_names ) ) {
9016 _out << std::endl
9017 << NOMAD::open_block ( "MODEL_SEARCH_OPTIMISTIC (advanced)" ) << std::endl
9018 << ". model search (MS) is optimistic or not" << std::endl
9019 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9020 << ". default: \'yes\'" << std::endl
9021 << ". example: MODEL_SEARCH_OPTIMISTIC no" << std::endl
9022 << NOMAD::close_block();
9023 chk = true;
9024 }
9025
9026
9027 // MULTI_F_BOUNDS:
9028 // ---------------
9029 if ( display_all || NOMAD::string_find ( "MULTI_F_BOUNDS ADVANCED PARETO \
9030 BI-OBJECTIVES MULTI-OBJECTIVES \
9031 BIOBJECTIVES MULTIOBJECTIVES \
9032 BI-MADS BIMADS SURF" ,
9033 param_names ) ) {
9034 _out << std::endl
9035 << NOMAD::open_block ( "MULTI_F_BOUNDS (advanced)" ) << std::endl
9036 << ". multi-objective optimization: bounds on the two" << std::endl
9037 << " objective functions" << std::endl
9038 << ". arguments: 4 reals: f1_min f1_max f2_min f2_max" << std::endl
9039 << ". default: none" << std::endl
9040 << ". these values are used to display the \'surf\' statistics" << std::endl
9041 << " on Pareto fronts (useful to compare different Pareto" << std::endl
9042 << " fronts)" << std::endl
9043 << ". \'surf\' will not be displayed with invalid values (for example"
9044 << std::endl
9045 << " if a dominant point has a f2 value greater than f2_max)" << std::endl
9046 << ". example: MULTI_F_BOUNDS 0 10 0 10" << std::endl
9047 << NOMAD::close_block();
9048 chk = true;
9049 }
9050
9051
9052 // MULTI_NB_MADS_RUNS:
9053 // -------------------
9054 if ( display_all || NOMAD::string_find ( "MULTI_NB_MADS_RUNS ADVANCED \
9055 BI-OBJECTIVES MULTI-OBJECTIVES \
9056 BIOBJECTIVES MULTIOBJECTIVES \
9057 BI-MADS BIMADS \
9058 NUMBER" , param_names ) ) {
9059 _out << std::endl
9060 << NOMAD::open_block ( "MULTI_NB_MADS_RUNS (advanced)" ) << std::endl
9061 << ". multi-objective optimization:" << std::endl
9062 << " number of MADS runs" << std::endl
9063 << ". argument: one positive integer" << std::endl
9064 << ". default: see user guide" << std::endl
9065 << ". example: MULTI_NB_MADS_RUNS 30" << std::endl
9066 << NOMAD::close_block();
9067 chk = true;
9068 }
9069
9070 // MULTI_OVERALL_BB_EVAL:
9071 // ---------------------
9072 if ( display_all || NOMAD::string_find ( "MULTI_OVERALL_BB_EVAL ADVANCED \
9073 BI-OBJECTIVES MULTI-OBJECTIVES \
9074 BIOBJECTIVES MULTIOBJECTIVES \
9075 BI-MADS BIMADS \
9076 NUMBER BLACK-BOXES BLACKBOXES BBEVAL \
9077 EVALUATIONS TERMINATION \
9078 STOPPING TERMINATES" , param_names ) ) {
9079 _out << std::endl
9080 << NOMAD::open_block ( "MULTI_OVERALL_BB_EVAL (advanced)" ) << std::endl
9081 << ". multi-objective optimization: maximum" << std::endl
9082 << " number of blackbox evaluations" << std::endl
9083 << ". argument: one positive integer" << std::endl
9084 << ". default: see user guide" << std::endl
9085 << ". example: MULTI_OVERALL_BB_EVAL 1000" << std::endl
9086 << NOMAD::close_block();
9087 chk = true;
9088 }
9089
9090
9091
9092 // NEIGHBORS_EXE:
9093 // --------------
9094 if ( display_all || NOMAD::string_find ( "NEIGHBORS_EXE NEIGHBOURS \
9095 NEIGHBORHOODS NEIGHBOURHOODS \
9096 EXTENDED_POLL \
9097 MIXED MVP CATEGORICAL \
9098 ADVANCED" ,
9099 param_names ) ) {
9100 _out << std::endl
9101 << NOMAD::open_block ( "NEIGHBORS_EXE (advanced)" ) << std::endl
9102 << ". to indicate a neighborhood executable for categorical" << std::endl
9103 << " variables in batch mode" << std::endl
9104 << ". arguments: one string" << std::endl
9105 << ". no default" << std::endl
9106 << ". the executable must take a file with the coordinates of" << std::endl
9107 << " a point as argument and displays a list of neighbors" << std::endl
9108 << ". the number of variables must be the same" << std::endl
9109 << ". when the \'$\' character is put in first position of a" << std::endl
9110 << " string, it is considered as global and no path is added" << std::endl
9111 << ". see user guide for details" << std::endl
9112 << ". example: NEIGHBORS_EXE neighbors.exe" << std::endl
9113 << NOMAD::close_block();
9114 chk = true;
9115 }
9116
9117 // OPEN_BRACE:
9118 // -----------
9119 if ( display_all || NOMAD::string_find ( "OPEN_BRACES INDENTATION TABULATIONS \
9120 BLOCKS ADVANCED DISPLAY" , param_names ) )
9121 {
9122 _out << std::endl
9123 << NOMAD::open_block ( "OPEN_BRACE (advanced)" ) << std::endl
9124 << ". string displayed at the beginning of indented" << std::endl
9125 << " blocks in full display mode" << std::endl
9126 << ". argument: one string" << std::endl
9127 << ". default: \'{\'" << std::endl
9128 << ". example: OPEN_BRACE Begin" << std::endl
9129 << NOMAD::close_block();
9130 chk = true;
9131 }
9132
9133 // OPPORTUNISTIC_CACHE_SEARCH:
9134 // ---------------------------
9135 if ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_CACHE_SEARCH ADVANCED \
9136 BLACK-BOXES BLACKBOXES EVALUATIONS \
9137 SUCCESSES CACHE SEARCH" ,
9138 param_names ) ) {
9139 _out << std::endl
9140 << NOMAD::open_block ( "OPPORTUNISTIC_CACHE_SEARCH (advanced)" ) << std::endl
9141 << ". opportunistic strategy for cache search" << std::endl
9142 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9143 << ". default: \'no\'" << std::endl
9144 << ". example: OPPORTUNISTIC_CACHE_SEARCH yes" << std::endl
9145 << NOMAD::close_block();
9146 chk = true;
9147 }
9148
9149 // OPPORTUNISTIC_EVAL:
9150 // -------------------
9151 if ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_EVAL ADVANCED \
9152 BLACK-BOXES BLACKBOXES EVALUATIONS \
9153 SUCCESSES" , param_names ) ) {
9154 _out << std::endl
9155 << NOMAD::open_block ( "OPPORTUNISTIC_EVAL (advanced)" ) << std::endl
9156 << ". opportunistic strategy (terminate a list of" << std::endl
9157 << " evaluations after successes)" << std::endl
9158 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9159 << ". default: \'yes\'" << std::endl
9160 << ". type \'nomad -h opportunistic\' to see advanced options" << std::endl
9161 << ". example: OPPORTUNISTIC_EVAL no # complete evaluations" << std::endl
9162 << NOMAD::close_block();
9163 chk = true;
9164 }
9165
9166
9167 // OPPORTUNISTIC_LH:
9168 // -----------------
9169 if ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_LH ADVANCED \
9170 BLACK-BOXES BLACKBOXES EVALUATIONS \
9171 SUCCESSES LATIN-HYPERCUBE SEARCH" ,
9172 param_names ) ) {
9173 _out << std::endl
9174 << NOMAD::open_block ( "OPPORTUNISTIC_LH (advanced)" ) << std::endl
9175 << ". opportunistic strategy for Latin-Hypercube search" << std::endl
9176 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9177 << ". default: same value as OPPORTUNISTIC_EVAL" << std::endl
9178 << ". example: OPPORTUNISTIC_LH no # complete evaluations" << std::endl
9179 << NOMAD::close_block();
9180 chk = true;
9181 }
9182
9183
9184
9185 // OPPORTUNISTIC_MIN_EVAL:
9186 // -----------------------
9187 if ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_MIN_EVAL ADVANCED \
9188 BLACK-BOXES BLACKBOXES EVALUATIONS \
9189 SUCCESSES" , param_names ) ) {
9190 _out << std::endl
9191 << NOMAD::open_block ( "OPPORTUNISTIC_MIN_EVAL (advanced)" ) << std::endl
9192 << ". advanced parameter for the opportunistic" << std::endl
9193 << " strategy (see user guide)" << std::endl
9194 << ". argument: one nonnegative integer" << std::endl
9195 << ". no default" << std::endl
9196 << ". example: OPPORTUNISTIC_MIN_EVAL 3" << std::endl
9197 << NOMAD::close_block();
9198 chk = true;
9199 }
9200
9201
9202 // PERIODIC_VARIABLE:
9203 // ------------------
9204 if ( display_all || NOMAD::string_find ( "PERIODIC_VARIABLE VARIABLES ADVANCED \
9205 BOUNDS LB UB CYCLIC MADS" , param_names ) )
9206 {
9207 _out << std::endl
9208 << NOMAD::open_block ( "PERIODIC_VARIABLE (advanced)" ) << std::endl
9209 << ". specify that some variables are periodic" << std::endl
9210 << ". arguments: variable indexes" << std::endl
9211 << ". no default" << std::endl
9212 << ". bounds must be defined for these variables" << std::endl
9213 << ". " << NOMAD::open_block ( "examples" )
9214 << "PERIODIC_VARIABLE * # all variables are periodic" << std::endl
9215 << "PERIODIC_VARIABLE 0-1 # 2 first var. are periodic" << std::endl
9216 << NOMAD::close_block() << NOMAD::close_block();
9217 chk = true;
9218 }
9219
9220 // POINT_DISPLAY_LIMIT:
9221 // --------------------
9222 if ( display_all || NOMAD::string_find ( "POINT_DISPLAY_LIMIT OUTPUTS \
9223 ADVANCED PRECISION" , param_names ) ) {
9224 _out << std::endl
9225 << NOMAD::open_block ( "POINT_DISPLAY_LIMIT (advanced)" ) << std::endl
9226 << ". maximum number of point coordinates" << std::endl
9227 << " that are displayed" << std::endl
9228 << ". argument: one positive integer" << std::endl
9229 << ". default: 20" << std::endl
9230 << ". example: POINT_DISPLAY_LIMIT 10" << std::endl
9231 << NOMAD::close_block();
9232 chk = true;
9233 }
9234
9235 // POLL_UPDATE_BASIS:
9236 // ------------------
9237 if ( display_all || NOMAD::string_find ( "POLL_UPDATE_BASIS ADVANCED \
9238 MADS ANISOTROPIC MESH \\TAU \\DELTA" , param_names ) ) {
9239 _out << std::endl
9240 << NOMAD::open_block ( "POLL_UPDATE_BASIS (advanced)" ) << std::endl
9241 << ". poll update basis \\tau used to update the" << std::endl
9242 << " poll (\\Delta^{k+1} = \\tau^w\\Delta^k)" << std::endl
9243 << ". argument: one positive real > 1" << std::endl
9244 << ". default: 2.0" << std::endl
9245 << ". example: POLL_UPDATE_BASIS 1.5" << std::endl
9246 << NOMAD::close_block();
9247 chk = true;
9248 }
9249
9250 // RHO:
9251 // ----
9252 if ( display_all || NOMAD::string_find ( "RHO ADVANCED MADS CONSTRAINTS \
9253 PROGRESSIVE-BARRIER PB PEB \
9254 FILTER TRIGGER" , param_names ) ) {
9255 _out << std::endl
9256 << NOMAD::open_block ( "RHO (advanced)" ) << std::endl
9257 << ". rho parameter of the progressive barrier" << std::endl
9258 << ". argument: one nonnegative real" << std::endl
9259 << ". default: 0.1" << std::endl
9260 << ". example: RHO 0.5" << std::endl
9261 << NOMAD::close_block();
9262 chk = true;
9263 }
9264
9265 // SCALING:
9266 // --------
9267 if ( display_all || NOMAD::string_find ( "SCALING SCALE ADVANCED \
9268 FILES" , param_names ) ) {
9269 _out << std::endl
9270 << NOMAD::open_block ( "SCALING (advanced)" ) << std::endl
9271 << ". variable scaling" << std::endl
9272 << ". arguments: variable indexes and values" << std::endl
9273 << ". no default" << std::endl
9274 << ". variables are multiplied by these values: they are scaled" << std::endl
9275 << " before an evaluation and the call to Evaluator::eval_x()," << std::endl
9276 << " and unscaled after the evaluation" << std::endl
9277 << ". all NOMAD outputs (including files) display unscaled values" << std::endl
9278 << ". all variable-related parameters (bounds, starting points," << std::endl
9279 << " fixed variables) must be specified without scaling" << std::endl
9280 << ". can be given by a text file containing DIMENSION entries" << std::endl
9281 << " (use \'-\' for unscaled variables)" << std::endl
9282 << ". " << NOMAD::open_block ( "examples" )
9283 << "SCALING ( 0.1 - 100 ) # variables 0 and 2 are scaled" << std::endl
9284 << "SCALING scaling.txt # with a file" << std::endl
9285 << "SCALING 0-1 10.0 # 2 first variables scaled" << std::endl
9286 << " # by factor 10" << std::endl
9287 << NOMAD::close_block() << NOMAD::close_block();
9288 chk = true;
9289 }
9290
9291
9292 // SEED:
9293 // -----
9294 if ( display_all || NOMAD::string_find ( "SEED ADVANCED \
9295 RANDOM FILES ORTHOMADS LT-MADS LTMADS \
9296 LATIN-HYPERCUBE LH TGP \
9297 SAMPLING SEARCH" , param_names ) ) {
9298 _out << std::endl
9299 << NOMAD::open_block ( "SEED (advanced)" ) << std::endl
9300 << ". random seed" << std::endl
9301 << ". argument: one integer in [0," << UINT32_MAX << "] U {-1} or the string \'DIFF\'" << std::endl
9302 << ". default: \'" << NOMAD::RNG::get_seed() << "\'" << std::endl
9303 << ". the default value is used for each run if" << std::endl
9304 << " the parameter is not provided. " << std::endl
9305 << ". if '-1' or \'DIFF\' is entered " << std::endl
9306 << " the seed is different for each run (PID is used)." << std::endl
9307 << ". the seed is used in the output file names" << std::endl
9308 << ". the seed affects the randomness of " << std::endl
9309 << " Ortho-MADS and LT-MADS directions," << std::endl
9310 << " Latin-Hypercube search, and TGP search." << std::endl
9311 << ". example: SEED 123456" << std::endl
9312 << NOMAD::close_block();
9313 chk = true;
9314 }
9315
9316
9317
9318 // SGTE_CACHE_FILE:
9319 // ----------------
9320 if ( display_all || NOMAD::string_find ( "SGTE_CACHE_FILE ADVANCED \
9321 SURROGATES SGTES \
9322 FILES OUTPUTS" , param_names ) ) {
9323 _out << std::endl
9324 << NOMAD::open_block ( "SGTE_CACHE_FILE (advanced)" ) << std::endl
9325 << ". surrogate cache file; cannot be the same" << std::endl
9326 << " as CACHE_FILE" << std::endl
9327 << ". argument: one string" << std::endl
9328 << ". no default" << std::endl
9329 << ". points already in the file will be tagged" << std::endl
9330 << " as surrogate evaluations" << std::endl
9331 << ". example: SGTE_CACHE_FILE sgte_cache.bin" << std::endl
9332 << NOMAD::close_block();
9333 chk = true;
9334 }
9335
9336 // SGTE_COST:
9337 // ----------
9338 if ( display_all || NOMAD::string_find ( "SGTE_COST SURROGATES SGTES ADVANCED \
9339 BLACK-BOXES BLACKBOXES" , param_names ) )
9340 {
9341 _out << std::endl
9342 << NOMAD::open_block ( "SGTE_COST (advanced)" ) << std::endl
9343 << ". cost of the surrogate function relatively" << std::endl
9344 << " to the true function" << std::endl
9345 << ". argument: one nonnegative integer" << std::endl
9346 << ". default: infinity (no surrogate cost)" << std::endl
9347 << ". " << NOMAD::open_block ( "examples" )
9348 << "SGTE_COST 3 # three surrogate evaluations" << std::endl
9349 << " # count as one blackbox" << std::endl
9350 << " # evaluation (the surrogate" << std::endl
9351 << " # is three times faster)" << std::endl
9352 << "SGTE_COST -1 # set to infinity" << std::endl
9353 << NOMAD::close_block() << NOMAD::close_block();
9354 chk = true;
9355 }
9356
9357 // SGTE_EVAL_SORT:
9358 // ---------------
9359 if ( display_all || NOMAD::string_find ( "SGTE_EVAL_SORT ADVANCED SURROGATES \
9360 SGTE_ORDERING SGTES BLACK-BOXES \
9361 BLACKBOXES" , param_names ) ) {
9362 _out << std::endl
9363 << NOMAD::open_block ( "SGTE_EVAL_SORT (advanced)" ) << std::endl
9364 << ". if surrogate is used to sort the trial points" << std::endl
9365 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9366 << ". default: \'yes\'" << std::endl
9367 << ". example: SGTE_EVAL_SORT NO" << std::endl
9368 << NOMAD::close_block();
9369 chk = true;
9370 }
9371
9372 // SGTE_EXE:
9373 // ----------
9374 if ( display_all || NOMAD::string_find ( "SGTE_EXE HAS_SGTE ADVANCED SURROGATES \
9375 SGTES BLACK-BOXES BLACKBOXES \
9376 FILES EXECUTABLE" , param_names ) ) {
9377 _out << std::endl
9378 << NOMAD::open_block ( "SGTE_EXE (advanced)" ) << std::endl
9379 << ". to indicate a surrogate executable" << std::endl
9380 << ". arguments: one or two strings" << std::endl
9381 << ". no default" << std::endl
9382 << ". surrogate(s) and blackbox(es) must have the same" << std::endl
9383 << " number of outputs" << std::endl
9384 << ". if surrogates are used, every blackbox executable" << std::endl
9385 << " must have a surrogate"
9386 << std::endl
9387 << ". automatically sets HAS_SGTE to \'yes\'" << std::endl
9388 << ". " << NOMAD::open_block ( "examples" ) << std::endl
9389 << "SGTE_EXE b1.exe s1.exe # \'s1.exe\' is a surrogate" << std::endl
9390 << " # for \'b1.exe\'" << std::endl << std::endl
9391 << "SGTE_EXE sgte.exe # only if one blackbox" << std::endl
9392 << " # executable is used" << std::endl
9393 << NOMAD::close_block() << NOMAD::close_block();
9394 chk = true;
9395 }
9396
9397 // SNAP_TO_BOUNDS:
9398 // ---------------
9399 if ( display_all || NOMAD::string_find ( "SNAP_TO_BOUNDS PROJECTION \
9400 ADVANCED" , param_names ) )
9401 {
9402 _out << std::endl
9403 << NOMAD::open_block ( "SNAP_TO_BOUNDS (advanced)" ) << std::endl
9404 << ". if \'yes\', snap to bounds points generated" << std::endl
9405 << " outside boundaries" << std::endl
9406 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9407 << ". default: \'yes\'" << std::endl
9408 << ". example: SNAP_TO_BOUNDS no" << std::endl
9409 << NOMAD::close_block();
9410 chk = true;
9411 }
9412
9413
9414 // SPECULATIVE_SEARCH:
9415 // -------------------
9416 if ( display_all || NOMAD::string_find ( "SPECULATIVE_SEARCH MADS OPTIMISTIC \
9417 ADVANCED" , param_names ) ) {
9418 _out << std::endl
9419 << NOMAD::open_block ( "SPECULATIVE_SEARCH (advanced)" ) << std::endl
9420 << ". MADS speculative_search (optimistic strategy)" << std::endl
9421 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9422 << ". default: \'yes\'" << std::endl
9423 << ". example: SPECULATIVE_SEARCH no" << std::endl
9424 << NOMAD::close_block();
9425 chk = true;
9426 }
9427
9428 // STAT_SUM_TARGET:
9429 // ----------------
9430 if ( display_all || NOMAD::string_find ( "STAT_SUM_TARGET ADVANCED TERMINATION \
9431 STOPPING TERMINATES STATS" , param_names ) )
9432 {
9433 _out << std::endl
9434 << NOMAD::open_block ( "STAT_SUM_TARGET (advanced)" ) << std::endl
9435 << ". MADS terminates if STAT_SUM reaches the value of this" << std::endl
9436 << " parameter (STAT_SUM is one of the possible outputs" << std::endl
9437 << " defined in BB_OUTPUT_TYPE)" << std::endl
9438 << ". argument: one real" << std::endl
9439 << ". no default" << std::endl
9440 << ". example: STAT_SUM_TARGET 100.0" << std::endl
9441 << NOMAD::close_block();
9442 chk = true;
9443 }
9444
9445
9446 // STOP_IF_FEASIBLE:
9447 // -----------------
9448 if ( display_all || NOMAD::string_find ( "STOP_IF_FEASIBLE ADVANCED \
9449 TERMINATES TERMINATION STOPPING" ,
9450 param_names ) ) {
9451 _out << std::endl
9452 << NOMAD::open_block ( "STOP_IF_FEASIBLE (advanced)" ) << std::endl
9453 << ". the algorithm terminates if it generates" << std::endl
9454 << " a feasible solution" << std::endl
9455 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9456 << ". default: \'no\'" << std::endl
9457 << ". example: STOP_IF_FEASIBLE yes" << std::endl
9458 << NOMAD::close_block();
9459 chk = true;
9460 }
9461
9462
9463 // UNDEF_STR:
9464 // ----------
9465 if ( display_all || NOMAD::string_find ( "UNDEF_STR ADVANCED \
9466 UNDEFINED DISPLAY REALS" ,
9467 param_names ) ) {
9468 _out << std::endl
9469 << NOMAD::open_block ( "UNDEF_STR (advanced)" ) << std::endl
9470 << ". string used to display undefined real values" << std::endl
9471 << ". argument: one string" << std::endl
9472 << ". default: \"-\"" << std::endl
9473 << ". example: UNDEF_STR Undefined" << std::endl
9474 << NOMAD::close_block();
9475 chk = true;
9476 }
9477
9478
9479 // USER_CALLS_ENABLED:
9480 // -------------------
9481 if ( display_all || NOMAD::string_find ( "USER_CALLS_ENABLED USER_CALLS_DISABLED \
9482 ADVANCED LIBRARY" ,
9483 param_names ) ) {
9484 _out << std::endl
9485 << NOMAD::open_block ( "USER_CALLS_ENABLED (advanced)" ) << std::endl
9486 << ". if \'no\', the automatic calls to user" << std::endl
9487 << " functions are disabled" << std::endl
9488 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9489 << ". default: \'yes\'" << std::endl
9490 << ". example: USER_CALLS_ENABLED yes" << std::endl
9491 << NOMAD::close_block();
9492 chk = true;
9493 }
9494
9495 // VARIABLE_GROUP:
9496 // --------------
9497 if ( display_all || NOMAD::string_find ( "VARIABLE_GROUP GROUPS PSD-MADS PSDMADS \
9498 VARIABLES ADVANCED" , param_names ) ) {
9499 _out << std::endl
9500 << NOMAD::open_block ( "VARIABLE_GROUP (advanced)" ) << std::endl
9501 << ". defines groups of variables" << std::endl
9502 << ". MADS directions are applied separately for" << std::endl
9503 << " each group" << std::endl
9504 << ". also used by PSD-MADS (not yet implemented)" << std::endl
9505 << ". groups cannot include fixed variables" << std::endl
9506 << ". arguments: variable indexes" << std::endl
9507 << ". default groups are created for different types" << std::endl
9508 << " of variables" << std::endl
9509 << ". no other default" << std::endl
9510 << ". advanced options only available in library mode" << std::endl
9511 << " (see user guide)" << std::endl
9512 << ". " << NOMAD::open_block ( "examples" )
9513 << "VARIABLE_GROUP 2-5" << std::endl
9514 << "VARIABLE_GROUP 0 1 3" << std::endl
9515 << NOMAD::close_block() << NOMAD::close_block();
9516 chk = true;
9517 }
9518
9519 // VNS_SEARCH:
9520 // -----------
9521 if ( display_all || NOMAD::string_find ( "VNS_SEARCH NEIGHBORHOOD \
9522 METAHEURISTICS META-HEURISTICS \
9523 GLOBAL ADVANCED \
9524 TRIGGER" ,
9525 param_names ) ) {
9526
9527 if ( !NOMAD::string_find ( "RHO" , param_names ) ) {
9528
9529 _out << std::endl
9530 << NOMAD::open_block ( "VNS_SEARCH (advanced)" ) << std::endl
9531 << ". Variable Neighborhood Search (VNS) search" << std::endl
9532 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9533 << " or one real in [0;1] for the VNS trigger" << std::endl
9534 << ". default: \'no\' (same as 0.0)" << std::endl
9535 << ". the VNS trigger is the maximum desired ratio of" << std::endl
9536 << " VNS blackbox evaluations over the total number" << std::endl
9537 << " of blackbox evaluations" << std::endl
9538 << ". the VNS search is never executed with a null trigger" << std::endl
9539 << " while a value of 1 allows the search at every" << std::endl
9540 << " iteration" << std::endl
9541 << ". if VNS_SEARCH=\'yes\', the default value of 0.75 is" << std::endl
9542 << " taken for the trigger" << std::endl
9543 << ". VNS search uses the surrogate if HAS_SGTE or" << std::endl
9544 << " SGTE_EXE is defined" << std::endl
9545 << ". " << NOMAD::open_block ( "examples" )
9546 << "VNS_SEARCH yes # VNS trigger of 75%" << std::endl
9547 << "VNS_SEARCH 0.5 # VNS trigger of 50%" << std::endl
9548 << NOMAD::close_block() << NOMAD::close_block();
9549 chk = true;
9550 }
9551 }
9552
9553
9554
9555 // last display:
9556 if ( !chk && !developer) {
9557
9558 std::string pname = ( pnames.size() == 1 ) ?
9559 ("\'" + *pnames.begin() + "\'") :
9560 "the specified list of parameter names";
9561
9562 _out << std::endl << "no help available for " << pname << std::endl
9563 << "help example: \'nomad -h mesh\' displays help on the mesh parameters"
9564 << std::endl;
9565 }
9566
9567 if (developer && NOMAD::string_find(registered_key_developer,param_names))
9568 {
9569 _out << "--------------------------------------------------------------" << endl;
9570 _out << "---------------------DEVELOPER PARAMETERS---------------------" << endl;
9571 _out << "--------------------------------------------------------------" << endl;
9572 }
9573
9574 // EPSILON:
9575 // --------
9576 if ( developer && (display_all || NOMAD::string_find ( "EPSILON DEVELOPPER \
9577 PRECISION REALS COMPARISONS" ,
9578 param_names ) ) ) {
9579 _out << std::endl
9580 << NOMAD::open_block ( "EPSILON (developer)" ) << std::endl
9581 << ". precision on reals" << std::endl
9582 << ". argument: one positive real" << std::endl
9583 << ". default: 1E-13" << std::endl
9584 << ". example: EPSILON 1E-8" << std::endl
9585 << NOMAD::close_block();
9586 chk = true;
9587 }
9588
9589
9590 // INITIAL_MESH_INDEX:
9591 // -------------------
9592 if ( developer && ( display_all || NOMAD::string_find ( "INITIAL_MESH_INDEX DEVELOPER SMESH \
9593 \\DELTA MADS L0 L_0 \\ELL_0" , param_names ) ) ) {
9594 _out << std::endl
9595 << NOMAD::open_block ( "INITIAL_MESH_INDEX (developer)" ) << std::endl
9596 << ". initial mesh index for SMesh \\ell_0" << std::endl
9597 << ". argument: one integer (can be negative)" << std::endl
9598 << ". default: 0" << std::endl
9599 << ". example: INITIAL_MESH_INDEX -1" << std::endl
9600 << NOMAD::close_block();
9601 chk = true;
9602 }
9603
9604
9605
9606 // L_CURVE_TARGET:
9607 // ---------------
9608 if ( developer && ( display_all || NOMAD::string_find ( "L_CURVE_TARGET DEVELOPER TERMINATION \
9609 STOPPING TERMINATES" , param_names ) ) ){
9610 _out << std::endl
9611 << NOMAD::open_block ( "L_CURVE_TARGET (developer)" ) << std::endl
9612 << ". MADS terminates if it detects that the objective will" << std::endl
9613 << " not reach this value (based on an approximation" << std::endl
9614 << " of the L-shaped curve obj_value v.s. bb_eval)" << std::endl
9615 << ". argument: one real" << std::endl
9616 << ". no default" << std::endl
9617 << ". example: L_CURVE_TARGET 10.0" << std::endl
9618 << NOMAD::close_block();
9619 chk = true;
9620 }
9621
9622
9623
9624 // MODEL_EVAL_SORT_CAUTIOUS:
9625 // -------------------------
9626 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_ORDERING MODEL_EVAL_SORT_CAUTIOUS \
9627 MODELS INTERPOLATION REGRESSION \
9628 MFN FROBENIUS DEVELOPER \
9629 QUADRATIC TGP" , param_names ) ) ) {
9630 _out << std::endl
9631 << NOMAD::open_block ( "MODEL_EVAL_SORT_CAUTIOUS (developer)" ) << std::endl
9632 << ". if the model ordering strategy is cautious, meaning" << std::endl
9633 << " that models are evaluated only within a trust radius" << std::endl
9634 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9635 << ". default: \'no\'" << std::endl
9636 << ". example: MODEL_EVAL_SORT_CAUTIOUS no" << std::endl
9637 << NOMAD::close_block();
9638 chk = true;
9639 }
9640
9641 // MODEL_QUAD_MAX_Y_SIZE:
9642 // ----------------------
9643 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_QUAD_MAX_Y_SIZE MODEL_SEARCH DEVELOPER \
9644 MODELS INTERPOLATION REGRESSION \
9645 MFN FROBENIUS QUADRATIC" , param_names ) ) ) {
9646 _out << std::endl
9647 << NOMAD::open_block ( "MODEL_QUAD_MAX_Y_SIZE (developer)" ) << std::endl
9648 << ". Sup. limit on the size of interp. set Y for quadr. models" << std::endl
9649 << ". arguments: one integer greater than the number of variables" << std::endl
9650 << ". default: 500" << std::endl
9651 << ". example: MODEL_QUAD_MAX_Y_SIZE 10" << std::endl
9652 << NOMAD::close_block();
9653 chk = true;
9654 }
9655
9656 // MODEL_QUAD_MIN_Y_SIZE:
9657 // ----------------------
9658 if ( developer && (display_all || NOMAD::string_find ( "MODEL_QUAD_MIN_Y_SIZE MODEL_SEARCH DEVELOPER \
9659 MODELS INTERPOLATION REGRESSION \
9660 MFN FROBENIUS QUADRATIC" , param_names ) ) ) {
9661 _out << std::endl
9662 << NOMAD::open_block ( "MODEL_QUAD_MIN_Y_SIZE (developer)" ) << std::endl
9663 << ". Inf. limit on the size of interp. set Y for quadr. models" << std::endl
9664 << ". arguments: one integer > 1 or the string \'N+1\'" << std::endl
9665 << ". default: N+1" << std::endl
9666 << ". examples: MODEL_QUAD_MIN_Y_SIZE N+1" << std::endl
9667 << " MODEL_QUAD_MIN_Y_SIZE -1 # same as N+1" << std::endl
9668 << " MODEL_QUAD_MIN_Y_SIZE 2" << std::endl
9669 << NOMAD::close_block();
9670 chk = true;
9671 }
9672
9673 // MODEL_QUAD_RADIUS_FACTOR:
9674 // -------------------------
9675 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_QUAD_RADIUS_FACTOR MODEL_SEARCH \
9676 DEVELOPER MODELS INTERPOLATION REGRESSION \
9677 MFN FROBENIUS QUADRATIC" , param_names ) ) ) {
9678 _out << std::endl
9679 << NOMAD::open_block ( "MODEL_QUAD_RADIUS_FACTOR (developer)" ) << std::endl
9680 << ". quadratic model search radius factor (see user guide)" << std::endl
9681 << ". arguments: one strictly positive real" << std::endl
9682 << ". default: 2.0" << std::endl
9683 << ". example: MODEL_QUAD_RADIUS_FACTOR 1.0" << std::endl
9684 << NOMAD::close_block();
9685 chk = true;
9686 }
9687
9688 // MODEL_SEARCH_MAX_TRIAL_PTS:
9689 // ---------------------------
9690 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_SEARCH_MAX_TRIAL_PTS \
9691 DEVELOPER MODELS INTERPOLATION REGRESSION \
9692 MFN FROBENIUS QUADRATIC \
9693 TGP" , param_names ) ) ) {
9694 _out << std::endl
9695 << NOMAD::open_block ( "MODEL_SEARCH_MAX_TRIAL_PTS (developer)" ) << std::endl
9696 << ". limit on the number of trial points for one model search" << std::endl
9697 << ". arguments: one integer greater than or equal to 1" << std::endl
9698 << ". the quadratic model search will not generate more than 4 points" << std::endl
9699 << ". default: 10" << std::endl
9700 << ". example: MODEL_SEARCH_MAX_TRIAL_PTS 1" << std::endl
9701 << NOMAD::close_block();
9702 chk = true;
9703 }
9704
9705 // MODEL_SEARCH_PROJ_TO_MESH:
9706 // --------------------------
9707 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_SEARCH_PROJ_TO_MESH DEVELOPER \
9708 MODELS INTERPOLATION REGRESSION \
9709 MFN FROBENIUS QUADRATIC PROJECTION \
9710 TGP" , param_names ) ) ) {
9711 _out << std::endl
9712 << NOMAD::open_block ( "MODEL_SEARCH_PROJ_TO_MESH (developer)" ) << std::endl
9713 << ". if model search trial points are projected to the mesh" << std::endl
9714 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9715 << ". default: \'yes\'" << std::endl
9716 << ". example: MODEL_SEARCH_PROJ_TO_MESH no" << std::endl
9717 << NOMAD::close_block();
9718 chk = true;
9719 }
9720
9721 // MODEL_QUAD_USE_WP:
9722 // ------------------
9723 if ( developer && ( display_all || NOMAD::string_find ( "MODEL_QUAD_USE_WP DEVELOPER \
9724 WELL-POISEDNESS \
9725 MODELS INTERPOLATION REGRESSION \
9726 MFN FROBENIUS QUADRATIC" , param_names ) ) ){
9727 _out << std::endl
9728 << NOMAD::open_block ( "MODEL_QUAD_USE_WP (developer)" ) << std::endl
9729 << ". enable the strategy to maintain WP with quadr. models" << std::endl
9730 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9731 << ". default: \'no\'" << std::endl
9732 << ". example: MODEL_QUAD_USE_WP yes" << std::endl
9733 << NOMAD::close_block();
9734 chk = true;
9735 }
9736
9737
9738 // MODEL_NP1_QUAD_EPSILON :
9739 // ---------------
9740 if ( developer && (display_all || NOMAD::string_find ( "MODEL MODELS NP1 QUAD EPSILON \
9741 ORTHO N+1 QUAD DEVELOPER" ,
9742 param_names ) ) ){
9743 _out << std::endl
9744 << NOMAD::open_block ( "MODEL_NP1_QUAD_EPSILON (developer)" ) << std::endl
9745 << ". with the direction type ORTHO N+1 QUAD selected the" << std::endl
9746 << " (n+1)-th direction is determined within a truncated " << std::endl
9747 << " unit hypercube ]epsilon;1[^n defined by the first " << std::endl
9748 << " n-th directions. The truncation is on lower limit " << std::endl
9749 << " and is defined with a single argument (epsilon)." << std::endl
9750 << ". argument: real in ]0;1[" << std::endl
9751 << ". default: 0.01" << std::endl
9752 << NOMAD::close_block();
9753 chk = true;
9754 }
9755
9756
9757 // MODEL_TGP_MODE:
9758 // ---------------
9759 if ( developer && (display_all || NOMAD::string_find ( "MODEL_TGP_MODE MODEL_SEARCH DEVELOPER \
9760 MODELS INTERPOLATION REGRESSION \
9761 TGP" , param_names ) ) ) {
9762 _out << std::endl
9763 << NOMAD::open_block ( "MODEL_TGP_MODE (developer)" ) << std::endl
9764 << ". TGP mode (fast or precise)" << std::endl
9765 << ". arguments: one string in {\'FAST\', \'PRECISE\'}" << std::endl
9766 << ". default: \'FAST\'" << std::endl
9767 << ". example: MODEL_TGP_MODE PRECISE" << std::endl
9768 << NOMAD::close_block();
9769 chk = true;
9770 }
9771
9772 // MODEL_TGP_REUSE_MODEL:
9773 // ----------------------
9774 if (developer && ( display_all || NOMAD::string_find ( "MODEL_TGP_REUSE_MODEL DEVELOPER \
9775 MODELS INTERPOLATION REGRESSION \
9776 TGP" , param_names ) ) ){
9777 _out << std::endl
9778 << NOMAD::open_block ( "MODEL_TGP_REUSE_MODEL (developer)" ) << std::endl
9779 << ". enable to use the last model from the TGP search for" << std::endl
9780 << " the TGP model eval sort strategy." << std::endl
9781 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9782 << ". default: \'yes\'" << std::endl
9783 << ". example: MODEL_TGP_REUSE_MODEL no" << std::endl
9784 << NOMAD::close_block();
9785 chk = true;
9786 }
9787
9788 // MULTI_FORMULATION:
9789 // -----------------
9790 if ( developer && (display_all || NOMAD::string_find ( "MULTI_FORMULATION DEVELOPER PARETO \
9791 BI-OBJECTIVES MULTI-OBJECTIVES\
9792 BIOBJECTIVES MULTIOBJECTIVES \
9793 BI-MADS BIMADS" ,
9794 param_names ) ) ) {
9795 _out << std::endl
9796 << NOMAD::open_block ( "MULTI_FORMULATION (developer)" ) << std::endl
9797 << ". multi-objective optimization: single-objective reformulation"
9798 << std::endl
9799 << ". argument: one string in {\'NORMALIZED\', \'PRODUCT\', \'DIST_L1\',"
9800 << std::endl
9801 << " \'DIST_L2\', \'DIST_LINF\'}" << std::endl
9802 << " (\'NORMALIZED\' and \'DIST_LINF\' are equivalent)" << std::endl
9803 << ". default: \'PRODUCT\' or \'DIST_L2\' if VNS_SEARCH is set to \'yes\'"
9804 << std::endl
9805 << ". example: MULTI_FORMULATION DIST_L1" << std::endl
9806 << NOMAD::close_block();
9807 chk = true;
9808 }
9809
9810
9811 // MULTI_USE_DELTA_CRIT:
9812 // ---------------------
9813 if ( developer && ( display_all || NOMAD::string_find ( "MULTI_USE_DELTA_CRITERION DEVELOPER PARETO \
9814 BIOBJECTIVES MULTIOBJECTIVES \
9815 BI-MADS BIMADS \
9816 BI-OBJECTIVES MULTI-OBJECTIVES" ,
9817 param_names ) ) ){
9818 _out << std::endl
9819 << NOMAD::open_block ( "MULTI_USE_DELTA_CRIT (developer)" ) << std::endl
9820 << ". multi-objective optimization: use the delta criterion" << std::endl
9821 << " (can result in a better distributed Pareto front)" << std::endl
9822 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9823 << ". default: \'no\'" << std::endl
9824 << ". example: MULTI_USE_DELTA_CRIT yes" << std::endl
9825 << NOMAD::close_block();
9826 chk = true;
9827 }
9828
9829 // OPPORTUNISTIC_LUCKY_EVAL:
9830 // -------------------------
9831 if ( developer && ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_LUCKY_EVAL DEVELOPER \
9832 BLACK-BOXES BLACKBOXES EVALUATIONS \
9833 SUCCESSES" , param_names ) ) ) {
9834 _out << std::endl
9835 << NOMAD::open_block ( "OPPORTUNISTIC_LUCKY_EVAL (developer)" ) << std::endl
9836 << ". developer parameter for the opportunistic" << std::endl
9837 << " strategy" << std::endl
9838 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9839 << ". default: \'no\'" << std::endl
9840 << ". example: OPPORTUNISTIC_LUCKY_EVAL yes" << std::endl
9841 << NOMAD::close_block();
9842 chk = true;
9843 }
9844
9845 // OPPORTUNISTIC_MIN_F_IMPRVMT:
9846 // ----------------------------
9847 if ( developer && ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_MIN_F_IMPRVMT DEVELOPER \
9848 OBJECTIVE \
9849 BLACK-BOXES BLACKBOXES EVALUATIONS \
9850 SUCCESSES IMPROVEMENT" , param_names ) ) ) {
9851 _out << std::endl
9852 << NOMAD::open_block ( "OPPORTUNISTIC_MIN_F_IMPRVMT (developer)" ) << std::endl
9853 << ". advanced parameter for the opportunistic" << std::endl
9854 << " strategy (see user guide)" << std::endl
9855 << ". argument: one real" << std::endl
9856 << ". no default" << std::endl
9857 << ". example: OPPORTUNISTIC_MIN_F_IMPRVMT 0.1" << std::endl
9858 << NOMAD::close_block();
9859 chk = true;
9860 }
9861
9862 // OPPORTUNISTIC_MIN_NB_SUCCESS:
9863 // -----------------------------
9864 if ( developer && ( display_all || NOMAD::string_find ( "OPPORTUNISTIC_MIN_NB_SUCCESSES DEVELOPER \
9865 BLACK-BOXES BLACKBOXES \
9866 EVALUATIONS" , param_names ) ) ){
9867 _out << std::endl
9868 << NOMAD::open_block ( "OPPORTUNISTIC_MIN_NB_SUCCESS (developer)" ) << std::endl
9869 << ". advanced parameter for the opportunistic" << std::endl
9870 << " strategy (see user guide)" << std::endl
9871 << ". argument: one nonnegative integer" << std::endl
9872 << ". no default" << std::endl
9873 << ". example: OPPORTUNISTIC_MIN_NB_SUCCESS 2" << std::endl
9874 << NOMAD::close_block();
9875 chk = true;
9876 }
9877
9878 // OPT_ONLY_SGTE:
9879 // --------------
9880 if (developer && ( display_all || NOMAD::string_find ( "OPT_ONLY_SGTES DEVELOPER SURROGATES \
9881 BLACK-BOXES BLACKBOXES \
9882 SGTES" , param_names ) ) ){
9883 _out << std::endl
9884 << NOMAD::open_block ( "OPT_ONLY_SGTE (developer)" ) << std::endl
9885 << ". NOMAD will only minimize the surrogate" << std::endl
9886 << ". argument: one boolean (\'yes\' or \'no\')" << std::endl
9887 << ". SGTE_EXE or HAS_SGTE must be defined" << std::endl
9888 << ". default: \'no\'" << std::endl
9889 << ". example: OPT_ONLY_SGTE yes" << std::endl
9890 << NOMAD::close_block();
9891 chk = true;
9892 }
9893
9894 // SEC_POLL_DIR_TYPES:
9895 // -------------------
9896 if ( developer && ( display_all || NOMAD::string_find ( "SEC_POLL_DIR_TYPES DEVELOPER MADS \
9897 POLL DIRECTIONS PB PEB \
9898 PROGRESSIVE-BARRIER" , param_names ) ) ){
9899 _out << std::endl
9900 << NOMAD::open_block ( "SEC_POLL_DIR_TYPES (developer)" ) << std::endl
9901 << ". types of directions for the secondary poll" << std::endl
9902 << ". arguments: same logic as DIRECTION_TYPE" << std::endl
9903 << ". default: see user guide" << std::endl
9904 << ". example: SEC_POLL_DIR_TYPES ORTHO 1" << std::endl
9905 << NOMAD::close_block();
9906 chk = true;
9907 }
9908
9909 // USE_SMESH:
9910 // -------------------
9911 if ( developer && ( display_all || NOMAD::string_find ( "USE_SMESH SMESH MESH \
9912 ANISO" , param_names ) ) ){
9913 _out << std::endl
9914 << NOMAD::open_block ( "USE_SMESH (developer)" ) << std::endl
9915 << ". forces the use of the standard mesh (older version of mesh)" << std::endl
9916 << ". default: no" << std::endl
9917 << ". example: USE_SMESH 1" << std::endl
9918 << NOMAD::close_block();
9919 chk = true;
9920 }
9921
9922
9923 // last display:
9924 if ( !chk && developer) {
9925
9926 std::string pname = ( pnames.size() == 1 ) ?
9927 ("\'" + *pnames.begin() + "\'") :
9928 "the specified list of parameter names";
9929
9930 _out << std::endl << "no help available for " << pname << std::endl
9931 << "Developer help example: \'nomad -d mesh\' displays developer " << std::endl
9932 << " help on the mesh parameters." << std::endl
9933 << std::endl;
9934 }
9935
9936
9937 _out.close_block();
9938 }
9939