main page
modules
namespaces
classes
files
Gecode home
Generated on Fri Jan 10 2020 11:38:25 for Gecode by
doxygen
1.8.16
gecode
search
par
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
* This file is part of Gecode, the generic constraint
10
* development environment:
11
* http://www.gecode.org
12
*
13
* Permission is hereby granted, free of charge, to any person obtaining
14
* a copy of this software and associated documentation files (the
15
* "Software"), to deal in the Software without restriction, including
16
* without limitation the rights to use, copy, modify, merge, publish,
17
* distribute, sublicense, and/or sell copies of the Software, and to
18
* permit persons to whom the Software is furnished to do so, subject to
19
* the following conditions:
20
*
21
* The above copyright notice and this permission notice shall be
22
* included in all copies or substantial portions of the Software.
23
*
24
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
*
32
*/
33
34
#ifndef __GECODE_SEARCH_PAR_DFS_HH__
35
#define __GECODE_SEARCH_PAR_DFS_HH__
36
37
#include <
gecode/search/par/engine.hh
>
38
39
namespace
Gecode
{
namespace
Search {
namespace
Par {
40
42
template
<
class
Tracer>
43
class
DFS
:
public
Engine
<Tracer> {
44
protected
:
45
using
Engine<Tracer>::idle
;
46
using
Engine<Tracer>::busy
;
47
using
Engine<Tracer>::stop
;
48
using
Engine<Tracer>::block
;
49
using
Engine<Tracer>::e_search
;
50
using
Engine<Tracer>::e_reset_ack_start
;
51
using
Engine<Tracer>::e_reset_ack_stop
;
52
using
Engine<Tracer>::n_busy
;
53
using
Engine<Tracer>::m_search
;
54
using
Engine<Tracer>::m_wait_reset
;
55
using
Engine<Tracer>::opt
;
56
using
Engine<Tracer>::release
;
57
using
Engine<Tracer>::signal
;
58
using
Engine<Tracer>::solutions
;
59
using
Engine<Tracer>::terminate
;
60
using
Engine<Tracer>::workers
;
61
using
Engine<Tracer>::C_WAIT
;
62
using
Engine<Tracer>::C_RESET
;
63
using
Engine<Tracer>::C_TERMINATE
;
64
using
Engine<Tracer>::C_WORK
;
66
class
Worker
:
public
Engine
<Tracer>
::Worker
{
67
public
:
68
using
Engine<Tracer>::Worker::_engine
;
69
using
Engine<Tracer>::Worker::m
;
70
using
Engine<Tracer>::Worker::path
;
71
using
Engine<Tracer>::Worker::cur
;
72
using
Engine<Tracer>::Worker::d
;
73
using
Engine<Tracer>::Worker::idle
;
74
using
Engine<Tracer>::Worker::node
;
75
using
Engine<Tracer>::Worker::fail
;
76
using
Engine<Tracer>::Worker::start
;
77
using
Engine<Tracer>::Worker::tracer
;
78
using
Engine<Tracer>::Worker::stop
;
80
Worker
(
Space
* s,
DFS
& e);
82
DFS
&
engine
(
void
)
const
;
84
virtual
void
run
(
void
);
86
void
find
(
void
);
88
void
reset
(
Space
* s,
unsigned
int
ngdl);
89
};
91
Worker
**
_worker
;
92
public
:
94
Worker
*
worker
(
unsigned
int
i
)
const
;
95
97
98
void
solution
(
Space
* s);
101
103
104
DFS
(
Space
* s,
const
Options
& o);
107
virtual
Statistics
statistics
(
void
)
const
;
109
virtual
void
reset
(
Space
* s);
111
virtual
NoGoods
&
nogoods
(
void
);
113
virtual
~DFS
(
void
);
115
};
116
117
}}}
118
119
#include <
gecode/search/par/dfs.hpp
>
120
121
#endif
122
123
// STATISTICS: search-par
Gecode::Search::Par::DFS::Worker::run
virtual void run(void)
Start execution of worker.
Definition:
dfs.hpp:162
Gecode::Search::Options
Search engine options
Definition:
search.hh:746
Gecode::Search::Par::DFS::Worker::find
void find(void)
Try to find some work.
Definition:
dfs.hpp:122
Gecode::Search::Par::DFS::worker
Worker * worker(unsigned int i) const
Provide access to worker i.
Definition:
dfs.hpp:46
Gecode::Search::Par::DFS
Parallel depth-first search engine
Definition:
dfs.hh:43
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Search::Par::DFS::reset
virtual void reset(Space *s)
Reset engine to restart at space s.
Definition:
dfs.hpp:308
Gecode
Gecode toplevel namespace
engine.hh
Gecode::NoGoods
No-goods recorded from restarts.
Definition:
core.hpp:1588
Gecode::Search::Worker::Worker
Worker(void)
Initialize.
Definition:
worker.hh:70
Gecode::Search::Par::Engine
Parallel depth-first search engine
Definition:
engine.hh:46
Gecode::Search::Par::DFS::solution
void solution(Space *s)
Report solution s.
Definition:
dfs.hpp:106
Gecode::Search::Par::DFS::~DFS
virtual ~DFS(void)
Destructor.
Definition:
dfs.hpp:359
Gecode::Search::Par::DFS::DFS
DFS(Space *s, const Options &o)
Initialize for space s with options o.
Definition:
dfs.hpp:60
Gecode::Search::Par::DFS::_worker
Worker ** _worker
Array of worker references.
Definition:
dfs.hh:91
Gecode::Search::Par::DFS::statistics
virtual Statistics statistics(void) const
Return statistics.
Definition:
dfs.hpp:149
Gecode::Search::Par::DFS::Worker::engine
DFS & engine(void) const
Provide access to engine.
Definition:
dfs.hpp:41
Gecode::Search::Par::DFS::Worker
Parallel depth-first search worker
Definition:
dfs.hh:66
Gecode::Search::Par::DFS::nogoods
virtual NoGoods & nogoods(void)
Return no-goods.
Definition:
dfs.hpp:336
Gecode::Search::Statistics::reset
void reset(void)
Reset.
Definition:
statistics.hpp:39
Test::Int::Basic::i
Gecode::IntArgs i({1, 2, 3, 4})
dfs.hpp
Gecode::Search::Statistics
Search engine statistics
Definition:
search.hh:147