@@ -223,6 +223,7 @@ namespace Gecode { namespace FlatZinc {
223223 Gecode::Driver::BoolOption _nogoods; // /< Whether to use no-goods
224224 Gecode::Driver::UnsignedIntOption _nogoods_limit; // /< Depth limit for extracting no-goods
225225 Gecode::Driver::BoolOption _interrupt; // /< Whether to catch SIGINT
226+ Gecode::Driver::DoubleOption _step; // /< Step option
226227 // @}
227228
228229 // / \name Execution options
@@ -255,6 +256,7 @@ namespace Gecode { namespace FlatZinc {
255256 Search::Config::nogoods_limit),
256257 _interrupt(" -interrupt" ," whether to catch Ctrl-C (true) or not (false)" ,
257258 true ),
259+ _step(" -step" ," step distance for float optimization" ,0.0 ),
258260 _mode(" -mode" ," how to execute script" ,Gecode::SM_SOLUTION),
259261 _stat(" -s" ," emit statistics" ),
260262 _output(" -o" ," file to send output to" ) {
@@ -274,6 +276,7 @@ namespace Gecode { namespace FlatZinc {
274276 add (_decay);
275277 add (_node); add (_fail); add (_time); add (_interrupt);
276278 add (_seed);
279+ add (_step);
277280 add (_restart); add (_r_base); add (_r_scale);
278281 add (_nogoods); add (_nogoods_limit);
279282 add (_mode); add (_stat);
@@ -306,6 +309,7 @@ namespace Gecode { namespace FlatZinc {
306309 unsigned int fail (void ) const { return _fail.value (); }
307310 unsigned int time (void ) const { return _time.value (); }
308311 int seed (void ) const { return _seed.value (); }
312+ double step (void ) const { return _step.value (); }
309313 const char * output (void ) const { return _output.value (); }
310314 Gecode::ScriptMode mode (void ) const {
311315 return static_cast <Gecode::ScriptMode>(_mode.value ());
@@ -452,6 +456,8 @@ namespace Gecode { namespace FlatZinc {
452456 Gecode::FloatVarArray fv_aux;
453457 // / Indicates whether a float variable is introduced by mzn2fzn
454458 std::vector<bool > fv_introduced;
459+ // / Step by which a next solution has to have lower cost
460+ Gecode::FloatNum step;
455461#endif
456462 // / Whether the introduced variables still need to be copied
457463 bool needAuxVars;
0 commit comments