Generated on Thu Apr 5 2018 19:44:19 for Gecode by doxygen 1.8.13
dfs.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2009
8  *
9  * Last modified:
10  * $Date$ by $Author$
11  * $Revision$
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #ifndef __GECODE_SEARCH_PAR_DFS_HH__
39 #define __GECODE_SEARCH_PAR_DFS_HH__
40 
42 
43 namespace Gecode { namespace Search { namespace Par {
44 
46  template<class Tracer>
47  class DFS : public Engine<Tracer> {
48  protected:
59  using Engine<Tracer>::opt;
70  class Worker : public Engine<Tracer>::Worker {
71  public:
84  Worker(Space* s, DFS& e);
86  DFS& engine(void) const;
88  virtual void run(void);
90  void find(void);
92  void reset(Space* s, unsigned int ngdl);
93  };
96  public:
98  Worker* worker(unsigned int i) const;
99 
101 
102  void solution(Space* s);
105 
107 
108  DFS(Space* s, const Options& o);
111  virtual Statistics statistics(void) const;
113  virtual void reset(Space* s);
115  virtual NoGoods& nogoods(void);
117  virtual ~DFS(void);
119  };
120 
121 }}}
122 
123 #include <gecode/search/par/dfs.hpp>
124 
125 #endif
126 
127 // STATISTICS: search-par
Statistics statistics(void)
Return statistics.
Definition: engine.hpp:138
void solution(Space *s)
Report solution s.
Definition: dfs.hpp:110
Worker(void)
Initialize.
Definition: worker.hh:74
Search engine statistics
Definition: search.hh:149
DFS & engine(void) const
Provide access to engine.
Definition: dfs.hpp:45
Search engine options
Definition: search.hh:748
Parallel depth-first search engine
Definition: engine.hh:50
Computation spaces.
Definition: core.hpp:1668
Gecode::IntArgs i(4, 1, 2, 3, 4)
Parallel depth-first search worker
Definition: dfs.hh:70
Parallel depth-first search engine
Definition: dfs.hh:47
Worker ** _worker
Array of worker references.
Definition: dfs.hh:95
virtual void run(void)
Start execution of worker.
Definition: dfs.hpp:166
virtual ~DFS(void)
Destructor.
Definition: dfs.hpp:363
No-goods recorded from restarts.
Definition: core.hpp:1514
void find(void)
Try to find some work.
Definition: dfs.hpp:126
NoGoods & nogoods(void)
Return no-goods.
Definition: engine.hpp:293
Gecode toplevel namespace
DFS(Space *s, const Options &o)
Initialize for space s with options o.
Definition: dfs.hpp:64
Worker * worker(unsigned int i) const
Provide access to worker i.
Definition: dfs.hpp:50
void reset(void)
Reset.
Definition: statistics.hpp:43