Hi,
I have a suspicion here. The easiest might be to send me your implementation of the constrain() member function so that I can have a look. Best Christian -- Christian Schulte, www.gecode.org/~schulte Professor of Computer Science, KTH, <mailto:[email protected]> [email protected] Expert Researcher, SICS, <mailto:[email protected]> [email protected] From: Juan Carlos Hernandez [mailto:[email protected]] Sent: Sunday, January 31, 2016 09:10 AM To: Alexander Schiendorfer; Christian Schulte Subject: Re: [gecode-users] users Digest, Vol 124, Issue 6 Hi again, I just wanted to say that the lexicographic search worked perfectly. Thanks! Now, I am stuck at a segmentation fault that appears when I try to run it in parallel mode (say, using 8 threads). The error happens irregularly, but more often when I increase the thread count. I will see if I can make a small code that reproduces the error. Here is the Visual Studio trace, in case it is a known bug. Unhandled exception at 0x0F5A81BA (GecodeInt-4-4-0-d-x86.dll) in cpsolver.exe: 0xC0000005: Access violation reading location 0x0194379C. > GecodeInt-4-4-0-d-x86.dll!Gecode::Int::IntVarImp::RangeList::min() Line 103 > C++ GecodeInt-4-4-0-d-x86.dll!Gecode::Int::IntVarImp::min() Line 230 C++ GecodeInt-4-4-0-d-x86.dll!Gecode::Int::IntView::min() Line 60 C++ GecodeInt-4-4-0-d-x86.dll!Gecode::Int::Rel::LexLqLe<Gecode::Int::IntView>::propagate(Gecode::Space & home, const int & __formal) Line 93 C++ GecodeKernel-4-4-0-d-x86.dll!Gecode::Space::status(Gecode::StatusStatistics & stat) Line 270 C++ GecodeSearch-4-4-0-d-x86.dll!Gecode::Search::Parallel::BAB::Worker::run() Line 120 C++ GecodeSupport-4-4-0-d-x86.dll!Gecode::Support::Thread::Run::exec() Line 64 C++ GecodeSupport-4-4-0-d-x86.dll!Gecode::Support::bootstrap(void * p) Line 48 C++ Thanks, JC 2016-01-29 15:10 GMT+01:00 Alexander Schiendorfer <[email protected]>: Yes it's godly :)! Let me jump on the bandwagon of showing off - http://isse-augsburg.github.io/constraint-relationships/ does really benefit from that feature (well, accessed by MiniSearch, but still!) Cheers, have a good weekend On 29.01.2016 14:05, Christian Schulte wrote: Actually, this is the very reason that Gecode has a constrain() function as its primitive: it is way more powerful than a simple cost variable. Just showing off a little ;-) Cheers Christian -- Christian Schulte, <http://www.gecode.org/%7Eschulte> www.gecode.org/~schulte Professor of Computer Science, KTH, <mailto:[email protected]> [email protected] Expert Researcher, SICS, <mailto:[email protected]> [email protected] From: Juan Carlos Hernandez [mailto:[email protected]] Sent: Friday, January 29, 2016 01:39 PM To: Christian Schulte <mailto:[email protected]> <[email protected]>; [email protected] Subject: Re: [gecode-users] users Digest, Vol 124, Issue 6 Dear Alex and Christian, thanks a lot! A very elegant solution - I will try it out at once. Cheers, JC 2016-01-29 12:15 GMT+01:00 Christian Schulte <[email protected]>: Alex is spot on here: but let me expand a little. You might have used the cost() member function for B&B. However the cost() member function is just implemented in terms of the constrain() member function. So what I would do is the following: - Have a integer variable array cost containing the two cost variables you have in mind. - implement a constrain(const Space& _b) member function: _b refers to the so-far best solution. Cast this to your script type, say b. Then this just posts rel(*this, cost, IRT_LQ, b.cost); This enforces that this->cost is lexicographically smaller then the so far best cost b.cost. That's it. More on the constrain() function you can find in Chapter 2 of MPG. Cheers Christian -- Christian Schulte, www.gecode.org/~schulte <http://www.gecode.org/%7Eschulte> Professor of Computer Science, KTH, [email protected] Expert Researcher, SICS, [email protected] -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Alexander Schiendorfer Sent: Friday, January 29, 2016 12:06 PM To: [email protected] Subject: Re: [gecode-users] users Digest, Vol 124, Issue 6 Hi Juan, it seems to me that you're searching for lexicographic branch-and-bound. There is a global constraint lex_lesseq that you might want to consider for posting in the constrain method of a Space. Cheers, Alex On 29.01.2016 12:00, [email protected] wrote: > Send users mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.gecode.org/cgi-bin/mailman/listinfo/users > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of users digest..." > > > Today's Topics: > > 1. Best way to implement multi-criterion optimization in Gecode? > (Juan Carlos Hernandez) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 28 Jan 2016 12:30:54 +0100 > From: Juan Carlos Hernandez <[email protected]> > To: [email protected] > Subject: [gecode-users] Best way to implement multi-criterion > optimization in Gecode? > Message-ID: > <CAFd=f3eau+xpqjo02kpt9swibpjxkifw-f2so-4me+x4kv7...@mail.gmail.com > <mailto:f3eau%2bxpqjo02kpt9swibpjxkifw-f2so-4me%[email protected]> > > Content-Type: text/plain; charset="utf-8" > > Hi everyone, > > > I am trying to use Gecode to solve a multi-criterion problem > > > minimize (F1(x,z), F2(x,z) ) > > subject to constraints on x,z > > > The objectives are ordered in order of importance, so I would like to > first solve the problem P1 > > > minimize F1(x,z) > > subject to original constraints on x,z > > > and then consider the modified problem P2 > > > minimize F2(x,z) > > subject to original constraints on x,z > > F1(x,z) = F1opt > > > where F1opt is the optimal value of P1. > > > What is the most efficient way to implement this in Gecode? > > > > I am now doing two completely separate searches, in the sense that I > create a new Space and run BAB on it for each of the problems. I am > sure that this cannot be the most efficient way of dealing with the > problem, but am unable to figure out how to do it "the right way". > Essentially, when solving P2 I should be able to make use of the work done while solving P1... > > > Any feedback is very much appreciated! > > > Thanks, > > JC > -------------- next part -------------- An HTML attachment was > scrubbed... > URL: > <http://www.gecode.org/pipermail/users/attachments/20160128/06e6ff75/a > ttachment-0001.html> > > ------------------------------ > > _______________________________________________ > Gecode users mailing list > [email protected] > https://www.gecode.org/mailman/listinfo/gecode-users > > > End of users Digest, Vol 124, Issue 6 > ************************************* -- Alexander Schiendorfer, M.Sc. Institute for Software & Systems Engineering Raum 3043, Gebäude N Universität Augsburg Web: http://www.informatik.uni-augsburg.de/lehrstuehle/swt/se/staff/aschiendorfer / Tel.: +49 (821) 598 - 2196 <tel:%2B49%20%28821%29%20598%20-%202196> E-Mail: [email protected] _______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users -- Alexander Schiendorfer, M.Sc. Institute for Software & Systems Engineering Raum 3043, Gebäude N Universität Augsburg Web: http://www.informatik.uni-augsburg.de/lehrstuehle/swt/se/staff/aschiendorfer/ Tel.: +49 (821) 598 - 2196 <tel:%2B49%20%28821%29%20598%20-%202196> E-Mail: [email protected]
_______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
