[gecode-users] Newbie: space/solution copying & dynamically addedconstraints

Christian Schulte schulte at imit.kth.se
Thu Sep 21 13:26:28 CEST 2006


Oh, I see: you can reset a stop object!

It goes as follows:
 - if you get NULL as a solution you check on the search engine whether
search is done (no solution found)
   or whether search has been stopped (stopped()).
 - If it is has been stopped, just reset the stop object to your liking (for
time, reset the time, for failures increase the afilure limit, etc).

If you need your own stop object just make it resetable.

Cheers
Christian

--
Christian Schulte, http://www.imit.kth.se/~schulte/ 

-----Original Message-----
From: Pieter Thysebaert [mailto:pieter.thysebaert at intec.ugent.be] 
Sent: Thursday, September 21, 2006 12:24 PM
To: schulte at imit.kth.se
Subject: Re: [gecode-users] Newbie: space/solution copying & dynamically
addedconstraints


Christian Schulte wrote:
> Hi Peter,
>
> could you rephrase your issue with stop objects? I kind of miss the 
> problem... Sorry for that.
>
> Christian
>   

Basically, what I'd like is to repat a loop like

search for 10 minutes
check for pending MPI messages and respond
continue search

Attaching a 10-minute stop object to the search engine will indeed return
after some 10 minutes. But how do I continue the search?

Do I simply call engine.next() again to continue?

Thanks,
Pieter

> --
> Christian Schulte, http://www.imit.kth.se/~schulte/
>
> -----Original Message-----
> From: Pieter Thysebaert [mailto:pthyseba at intec.ugent.be]
> Sent: Thursday, September 21, 2006 11:03 AM
> To: Christian Schulte
> Cc: 'Pieter Thysebaert'; users at gecode.org
> Subject: RE: [gecode-users] Newbie: space/solution copying & dynamically
> addedconstraints
>
>
>
> Hi,
>
> On Wed, 20 Sep 2006, Christian Schulte wrote:
>
>   
>> Hi Peter,
>>
>> looks interesting ;-)
>>     
>
> ....
>
>   
>> What you could do to make the search distributed is to cook up an
>> operation for a branching description that turns it into something 
>> that can be send over the wire: should not be to hard, the typical 
>> description contains just two integers. Then in order to hand out a 
>> node, you just start from the same basic space and add all branching 
>> descriptions corresponding to the path leading to the node you want to 
>> explore (this is recomputation and looking how recomputation is done 
>> in the search engines should give you an idea).
>>     
>
> Well, for the time being, I'm distributing variable-range restrictions 
> to remote nodes as branching descriptions. I then construct a new 
> problem instance with these extra variable-range restrictions and 
> start a new search engine. The problem I had been bitten by previously 
> (having difficulties in passing dynamic information to the search) 
> which presumably had to do with copying spaces etc. has been "solved" 
> by observing that I'm only running one search engine per MPI process, 
> so I can do with global variables (ugh).
>
>   
>> Much of the way search is done has been inherited from Mozart (apart
>> from batch recomputation). If you want to see an architecture for 
>> distributed parallel search based on spaces, you might want to check:
>> 	http://web.it.kth.se/~schulte/paper.html?id=Schulte:TRICS:2000
>> or, if you prefer the full story:
>> 	http://web.it.kth.se/~schulte/paper.html?id=Schulte:LNAI:2002
>>     
>
> I might fall back to the worker/manager paradigm described there, as I 
> started out with a set of worker-peers (no central manager) but that 
> might be more difficult - less efficient.
>
>   
>> As it comes to pause resume, check
>> http://www.gecode.org/gecode-doc-latest/group__TaskIntSearchStop.html
>>     
>
> Can you enlighten me: I've only used stop objects to, well, stop (i.e.
> terminate) searches.
>
> Suppose I'm in a loop like
>
> do {
>   solution* currentSolution = engine.next();
>   statement;
> }
>
> For testing purposes, I have initialized the search engine with a 
> custom Stop object whose stop() function always returns true, and it 
> turns out that upon termination currentSolution becomes NULL.
>
> I thought about implementing pause/restart by creating a new engine 
> using the last value of currentSolution as root node, but as 
> currentSolution is NULL upon termination of the search this seems 
> impossible or is it not?
>
> Pieter
>
>
>
>   






More information about the gecode-users mailing list