[gecode-users] Adding restart-based search to ECLiPSe's interface to Gecode

Kish Shen kisshen at cisco.com
Thu Aug 22 09:44:34 CEST 2013


Hi Christian,

Thanks again!

On 21/08/2013 19:17, Christian Schulte wrote:
> Try to avoid the Gecode::Search::bab .... functions. Just create as follows:
> 	Gecode::Search::Engine* e = new Gecode::BAB(...)
> Then it also will work for RBS, and you do not have to create a second
> engine yourself, this will the RBS class do for you.
>
> And do not forget to delete e eventually!
>

This is the part that I don't know how to do correct -- probably because 
of my lack of C++ knowledge, but as far as I can tell,
Gecode::DFS etc are not of class Engine*, according to the doc:

template<class T>
class Gecode::DFS<T>

for subclasses T of Space

T is GecodeSpace in my case, I assume. I am not sure what class DFS is, 
but I can't see how it could be Engine*.

Anway, I tried to do the assignment as you suggested:


Search::Engine* segine;
...
sengine = new DFS<GecodeSpace>(solver, o); and indeed I get the error

cannot convert 'Gecode::DFS<GecodeSpace>*' to 'Gecode::Search::Engine*'

(I first tried sengine = new DFS(solver, o) but got an error 'expected 
type-specifier')

So I am not sure what to do -- do I need to change the type of sengine, 
and/or the way I assign an engine to sengine?

Cheers,

Kish






More information about the users mailing list