bab() is a function that returns either NULL (there is no solution) or something different from NULL (the best solution).
So just write: Manel* m = new Manel(.), If (Manel* s = bab(m)) { s->print(); delete s; //Or whatever } Christian -- Christian Schulte, www.ict.kth.se/~cschulte From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of lana light Sent: Tuesday, December 3, 2013 05:48 PM To: users@gecode.org Subject: [gecode-users] how to use the bab() function Hi I'm new with gecode , so i tried to use the BAB engine to solve my model because i want just to gt the bst solution so i found in the MPG the function bab() that can help me do it my problem here that i don't know when to put it : this is my main : int main(int argc, char* argv[]) { manel* m = new manel; BAB<manel> e(m); delete m; while (manel* s = e.next()) { s->print(); delete s; } system("pause"); return 0; } so here i try to get all the solution but i want just the best so could you tell me where to put bab() exactly , it seems stupid but i don't konw Thankx LANA
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users