[gecode-users] how to use the bab() function

Christian Schulte cschulte at kth.se
Tue Dec 3 20:49:14 CET 2013


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-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of lana light
Sent: Tuesday, December 3, 2013 05:48 PM
To: users at 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 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20131203/9d20e7dd/attachment.html>


More information about the users mailing list