Hi!
Alberto Delgado wrote:
I downloaded the source code and compiled gecode gist [...]
Now i'd like to explore the variables in each nodes, i mean the
domain of the variables. I tried double-click and it didn't work
and the menu displayed by right-click doesn't include any action
related with the variables.
The file qtgist/gist.hh defines a class Gecode::Gist::Inspector. You
have to inherit from this class, and override the virtual function
void inspect(Space* s). The you create an object of your new
inspector and pass it to the explore function. The inspector is then
registered with gist, and double-clicking a node will invoke the
inspect function. You just have to static_cast the Space* into the
specific type of your constraint problem, and output the variables in
any way you like.
A simple example (not tested, but you'll get the idea):
using namespace Gecode;
class A : public Space {
public:
IntVarArray x;
// the rest of your code defining your constraint problem
};
class I : public Gist::Inspector {
public:
virtual void inspect(Space* s) {
A* a = static_cast<A*>(s);
for (int i=0; i<a.x.size(); i++) std::cout << a.x[i] <<
std::endl;
}
};
int main(void) {
A a = new A();
I i = new I();
explore(a, i);
return 0;
}
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Germany
http://www.ps.uni-sb.de/~tack
_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users