From 8ab38125dbb4ff9c01fbff8616e9b301d6dfbda5 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 19 Mar 2018 11:43:41 +0000 Subject: [PATCH] gecide6_first_try --- .../gecode_yap_cc_impl_auto_generated.icc | 4 +- packages/gecode/gecode6-common.icc | 59 +++++++++---------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/packages/gecode/6.0.0/gecode_yap_cc_impl_auto_generated.icc b/packages/gecode/6.0.0/gecode_yap_cc_impl_auto_generated.icc index c170ac3c2..f0d153de9 100644 --- a/packages/gecode/6.0.0/gecode_yap_cc_impl_auto_generated.icc +++ b/packages/gecode/6.0.0/gecode_yap_cc_impl_auto_generated.icc @@ -112,8 +112,8 @@ static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term X) if (X==gecode_IPL_VAL) return IPL_VAL; if (X==gecode_IPL_BND) return IPL_BND; if (X==gecode_IPL_DOM) return IPL_DOM; - if (X==gecode_IPL_SPEED) return IPL_SPEED; - if (X==gecode_IPL_MEMORY) return IPL_MEMORY; + // if (X==gecode_IPL_SPEED) return IPL_SPEED; + // if (X==gecode_IPL_MEMORY) return IPL_MEMORY; if (X==gecode_IPL_BASIC) return IPL_BASIC; if (X==gecode_IPL_ADVANCED) return IPL_ADVANCED; if (X==gecode_IPL_BASIC_ADVANCED) return IPL_BASIC_ADVANCED; diff --git a/packages/gecode/gecode6-common.icc b/packages/gecode/gecode6-common.icc index a912c5d1d..d527131b2 100644 --- a/packages/gecode/gecode6-common.icc +++ b/packages/gecode/gecode6-common.icc @@ -67,42 +67,39 @@ namespace generic_gecode class GenericSpace; - struct GenericEngine { - GenericSpace* next(void); - // virtual ~GenericEngine() {}; + virtual GenericSpace* next(void)=0; + virtual ~GenericEngine() {}; }; - struct GenericDFS: GenericEngine - { - DFS engine; - GenericDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} - GenericSpace* next(void) { return engine.next(); } - }; - - struct GenericRestartDFS: GenericEngine - { - RBS engine; - GenericRestartDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} - GenericSpace* next(void) { return engine.next(); } - }; - + struct GenericDFS: GenericEngine + { + DFS engine; + GenericDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; + struct GenericRestartDFS: GenericEngine + { + RBS engine; + GenericRestartDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; struct GenericBAB: GenericEngine - { - BAB engine; - GenericBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} - GenericSpace* next(void) { return engine.next(); } - }; + { + BAB engine; + GenericBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; - struct GenericRestartBAB: GenericEngine - { - RBS engine; - GenericRestartBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} - GenericSpace* next(void) { return engine.next(); } - }; + struct GenericRestartBAB: GenericEngine + { + RBS engine; + GenericRestartBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; #ifdef OLD struct GenericRestart: GenericEngine @@ -226,10 +223,10 @@ namespace generic_gecode public: Space* space() { return this; } - GenericSpace copy(bool share) - { freeze(); return *new GenericSpace(share, *this); } - + Space* copy(bool share) + { freeze(); return new GenericSpace(share, *this); } + Space* copy(void) {return copy(false);} GenericSpace(bool share, GenericSpace& s) : Space( s), optim(s.optim), dock(NULL), keeping_some(s.keeping_some) {