Jose Luis _ wrote:

2008/6/12 Guido Tack <[EMAIL PROTECTED]>:
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

_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to