main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
gecode
search
meta
rbs.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Guido Tack <tack@gecode.org>
5
*
6
* Copyright:
7
* Guido Tack, 2012
8
*
9
* Last modified:
10
* $Date: 2016-04-19 17:19:45 +0200 (Tue, 19 Apr 2016) $ by $Author: schulte $
11
* $Revision: 14967 $
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_META_RBS_HH__
39
#define __GECODE_SEARCH_META_RBS_HH__
40
41
#include <
gecode/search.hh
>
42
43
namespace
Gecode
{
namespace
Search {
namespace
Meta {
44
45
class
RBS;
46
48
class
GECODE_SEARCH_EXPORT
RestartStop
:
public
Stop
{
49
template
<
class
,
template
<
class
>
class
>
friend
class ::Gecode::RBS;
50
friend
class ::Gecode::Search::Meta::RBS;
51
private
:
53
unsigned
long
int
l
;
55
Stop
* m_stop;
57
bool
e_stopped;
59
Statistics
m_stat;
60
public
:
62
RestartStop
(
Stop
* s);
64
virtual
bool
stop
(
const
Statistics
& s,
const
Options
& o);
66
void
limit(
const
Statistics
& s,
unsigned
long
int
l
);
68
void
update(
const
Search::Statistics
& s);
70
bool
enginestopped(
void
)
const
;
72
Statistics
metastatistics(
void
)
const
;
73
};
74
76
class
GECODE_SEARCH_EXPORT
RBS
:
public
Engine
{
77
protected
:
79
Engine
*
e
;
81
Space
*
master
;
83
Space
*
last
;
85
Cutoff
*
co
;
87
RestartStop
*
stop
;
89
unsigned
long
int
sslr
;
91
bool
shared_data
;
93
bool
shared_info
;
95
bool
complete
;
97
bool
restart
;
99
bool
best
;
100
public
:
102
RBS
(
Space
* s,
RestartStop
* stop0,
Engine
* e0,
103
const
Search::Statistics
& stat,
const
Options
& o,
bool
best);
105
virtual
Space
* next(
void
);
107
virtual
Statistics
statistics(
void
)
const
;
109
virtual
bool
stopped(
void
)
const
;
111
virtual
void
constrain(
const
Space
&
b
);
113
virtual
~
RBS
(
void
);
114
};
115
116
}}}
117
118
#include <
gecode/search/meta/rbs.hpp
>
119
120
#endif
121
122
// STATISTICS: search-meta
Gecode::Search::Meta::RBS::stop
RestartStop * stop
The stop control object.
Definition:
rbs.hh:87
Gecode::Search::Meta::RBS::e
Engine * e
The actual engine.
Definition:
rbs.hh:79
GECODE_SEARCH_EXPORT
#define GECODE_SEARCH_EXPORT
Definition:
search.hh:63
Gecode::Search::Options
Search engine options
Definition:
search.hh:446
Gecode::Search::Stop
Base-class for Stop-object.
Definition:
search.hh:501
Gecode::Search::Meta::RBS::shared_data
bool shared_data
Whether the slave can share data with the master.
Definition:
rbs.hh:91
search.hh
Gecode::Search::Meta::RBS
Engine for restart-based search.
Definition:
rbs.hh:76
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
Gecode::Search::Meta::RBS::shared_info
bool shared_info
Whether the slave can share info (AFC) with the master.
Definition:
rbs.hh:93
Gecode::Search::Meta::stop
Stop * stop(Stop *stop)
Create stop object.
Definition:
rbs.cpp:43
Gecode::Search::Meta::RBS::last
Space * last
The last solution space (possibly NULL)
Definition:
rbs.hh:83
Gecode
Gecode toplevel namespace
Gecode::Search::Meta::RBS::best
bool best
Whether the engine performs best solution search.
Definition:
rbs.hh:99
b
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Gecode::Search::Meta::RestartStop
Stop-object for restart engine
Definition:
rbs.hh:48
Gecode::Search::Engine
Search engine implementation interface
Definition:
search.hh:601
Gecode::Search::Meta::RBS::co
Cutoff * co
The cutoff object.
Definition:
rbs.hh:85
Gecode::Search::Cutoff
Base class for cutoff generators for restart-based meta engine.
Definition:
search.hh:172
l
NNF * l
Left subtree.
Definition:
bool-expr.cpp:244
rbs.hpp
Gecode::Search::Meta::RBS::complete
bool complete
Whether search for the next solution will be complete.
Definition:
rbs.hh:95
Gecode::Search::Meta::RBS::sslr
unsigned long int sslr
How many solutions since the last restart.
Definition:
rbs.hh:89
Gecode::Search::Meta::RBS::restart
bool restart
Whether a restart must be performed when next is called.
Definition:
rbs.hh:97
Gecode::Search::Meta::RBS::master
Space * master
The master space to restart from.
Definition:
rbs.hh:81
Gecode::Search::Statistics
Search engine statistics
Definition:
search.hh:140