[gecode-users] Question about Gist

Guido Tack tack at ps.uni-sb.de
Thu Jun 12 16:43:12 CEST 2008


Jose Luis _ wrote:

> 2008/6/12 Guido Tack <tack at ps.uni-sb.de>:
> Jose Luis _ wrote:
>
> Greetings,
> I wonder if I can have a small simple example in how to use Gist.
> From what Ive read I must implement a class which extends from  
> Inspector.
> But I couldnt get it to work.
>
> Are you using Java or C++?
>
> I Am using C++, thanks.

The easiest way is to use the Gist::PrintingInspector.  For this, just  
implement a function

void  print(std::ostream& os) {...}

that outputs the current state to the stream os (look at the examples  
that come with Gecode, like queens.cc).  Then call Gist like this:

Gecode::Gist::PrintingInspector<YourModelClass> pi("Name of your  
model");
YourModelClass* s = new YourModelClass();
Gecode::explore(s, &pi);
delete s;

If you want something more fancy, just write your own inspector.  All  
you have to do is implement the function inspect, which gets the space  
of the node that has been double-clicked.

Cheers,
	Guido

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080612/b420d41a/attachment.htm>


More information about the gecode-users mailing list