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
seq
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
* 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_SEQ_RBS_HH__
35
#define __GECODE_SEARCH_SEQ_RBS_HH__
36
37
#include <
gecode/search.hh
>
38
39
namespace
Gecode
{
namespace
Search {
namespace
Seq {
40
41
class
RBS;
42
44
class
GECODE_SEARCH_EXPORT
RestartStop
:
public
Stop
{
45
template
<
class
,
template
<
class
>
class
>
friend
class ::Gecode::RBS;
46
friend
class ::Gecode::Search::Seq::RBS;
47
private
:
49
unsigned
long
int
l
;
51
Stop
* m_stop;
53
bool
e_stopped;
55
Statistics
m_stat;
56
public
:
58
RestartStop
(
Stop
* s);
60
virtual
bool
stop
(
const
Statistics
& s,
const
Options
& o);
62
void
limit(
const
Statistics
& s,
unsigned
long
int
l
);
64
void
update
(
const
Search::Statistics
& s);
66
bool
enginestopped(
void
)
const
;
68
Statistics
metastatistics(
void
)
const
;
69
};
70
72
class
GECODE_SEARCH_EXPORT
RBS
:
public
Engine
{
73
protected
:
75
Engine
*
e
;
77
Space
*
master
;
79
Space
*
last
;
81
Cutoff
*
co
;
83
RestartStop
*
stop
;
85
unsigned
long
int
sslr
;
87
bool
shared_info
;
89
bool
complete
;
91
bool
restart
;
93
bool
best
;
94
public
:
96
RBS
(
Space
* s,
RestartStop
* stop0,
Engine
* e0,
97
const
Search::Statistics
& stat,
const
Options
& o,
bool
best);
99
virtual
Space
* next(
void
);
101
virtual
Statistics
statistics(
void
)
const
;
103
virtual
bool
stopped(
void
)
const
;
105
virtual
void
constrain(
const
Space
&
b
);
107
virtual
~
RBS
(
void
);
108
};
109
110
}}}
111
112
#include <
gecode/search/seq/rbs.hpp
>
113
114
#endif
115
116
// STATISTICS: search-seq
b
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Gecode::Search::Seq::RBS::complete
bool complete
Whether search for the next solution will be complete.
Definition:
rbs.hh:89
GECODE_SEARCH_EXPORT
#define GECODE_SEARCH_EXPORT
Definition:
search.hh:67
Gecode::Search::Seq::RestartStop
Stop-object for restart engine
Definition:
rbs.hh:44
Gecode::Search::Seq::RBS::co
Cutoff * co
The cutoff object.
Definition:
rbs.hh:81
Gecode::Search::Options
Search engine options
Definition:
search.hh:746
Gecode::Search::Stop
Base-class for Stop-object.
Definition:
search.hh:799
search.hh
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Search::Seq::RBS::sslr
unsigned long int sslr
How many solutions since the last restart.
Definition:
rbs.hh:85
Gecode
Gecode toplevel namespace
Gecode::Int::Count::update
void update(IntSet &y, Space &home, IntSet &py)
Definition:
rel.hpp:103
Gecode::Search::Seq::RBS::restart
bool restart
Whether a restart must be performed when next is called.
Definition:
rbs.hh:91
Gecode::Driver::stop
void stop(Support::Timer &timer, std::ostream &os)
Get time since start of timer and print user friendly time information.
Definition:
script.cpp:42
Gecode::Search::Seq::RBS::shared_info
bool shared_info
Whether the slave can share info (AFC) with the master.
Definition:
rbs.hh:87
Gecode::Search::Engine
Search engine implementation interface
Definition:
search.hh:899
Gecode::Search::Seq::RBS::last
Space * last
The last solution space (possibly NULL)
Definition:
rbs.hh:79
Gecode::Search::Seq::RBS
Engine for restart-based search.
Definition:
rbs.hh:72
Gecode::Search::Cutoff
Base class for cutoff generators for restart-based meta engine.
Definition:
search.hh:472
l
NNF * l
Left subtree.
Definition:
bool-expr.cpp:240
Gecode::Search::Seq::RBS::stop
RestartStop * stop
The stop control object.
Definition:
rbs.hh:83
Gecode::Search::Seq::RBS::master
Space * master
The master space to restart from.
Definition:
rbs.hh:77
Gecode::Search::Seq::RBS::best
bool best
Whether the engine performs best solution search.
Definition:
rbs.hh:93
rbs.hpp
Gecode::Search::Seq::RBS::e
Engine * e
The actual engine.
Definition:
rbs.hh:75
Gecode::Search::Statistics
Search engine statistics
Definition:
search.hh:147