main page
modules
namespaces
classes
files
Gecode home
Generated on Wed Jan 1 2020 10:37:59 for Gecode by
doxygen
1.8.16
gecode
float
branch
view-sel.cpp
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, 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
#include <
gecode/float/branch.hh
>
35
36
namespace
Gecode
{
namespace
Float {
namespace
Branch {
37
38
ViewSel<FloatView>*
39
viewsel
(
Space
& home,
const
FloatVarBranch
& fvb) {
40
switch
(fvb.
select
()) {
41
case
FloatVarBranch::SEL_NONE
:
42
return
new
(home)
ViewSelNone<FloatView>
(home,fvb);
43
case
FloatVarBranch::SEL_RND
:
44
return
new
(home)
ViewSelRnd<FloatView>
(home,fvb);
45
default
:
break
;
46
}
47
if
(fvb.
tbl
() != NULL) {
48
switch
(fvb.
select
()) {
49
case
FloatVarBranch::SEL_MERIT_MIN
:
50
return
new
(home)
ViewSelMinTbl
<
MeritFunction<FloatView>
>(home,fvb);
51
case
FloatVarBranch::SEL_MERIT_MAX
:
52
return
new
(home)
ViewSelMaxTbl
<
MeritFunction<FloatView>
>(home,fvb);
53
case
FloatVarBranch::SEL_MIN_MIN
:
54
return
new
(home)
ViewSelMinTbl<MeritMin>
(home,fvb);
55
case
FloatVarBranch::SEL_MIN_MAX
:
56
return
new
(home)
ViewSelMaxTbl<MeritMin>
(home,fvb);
57
case
FloatVarBranch::SEL_MAX_MIN
:
58
return
new
(home)
ViewSelMinTbl<MeritMax>
(home,fvb);
59
case
FloatVarBranch::SEL_MAX_MAX
:
60
return
new
(home)
ViewSelMaxTbl<MeritMax>
(home,fvb);
61
case
FloatVarBranch::SEL_SIZE_MIN
:
62
return
new
(home)
ViewSelMinTbl<MeritSize>
(home,fvb);
63
case
FloatVarBranch::SEL_SIZE_MAX
:
64
return
new
(home)
ViewSelMaxTbl<MeritSize>
(home,fvb);
65
case
FloatVarBranch::SEL_DEGREE_MIN
:
66
return
new
(home)
ViewSelMinTbl
<
MeritDegree<FloatView>
>(home,fvb);
67
case
FloatVarBranch::SEL_DEGREE_MAX
:
68
return
new
(home)
ViewSelMaxTbl
<
MeritDegree<FloatView>
>(home,fvb);
69
case
FloatVarBranch::SEL_AFC_MIN
:
70
return
new
(home)
ViewSelMinTbl
<
MeritAFC<FloatView>
>(home,fvb);
71
case
FloatVarBranch::SEL_AFC_MAX
:
72
return
new
(home)
ViewSelMaxTbl
<
MeritAFC<FloatView>
>(home,fvb);
73
case
FloatVarBranch::SEL_ACTION_MIN
:
74
return
new
(home)
ViewSelMinTbl
<
MeritAction<FloatView>
>(home,fvb);
75
case
FloatVarBranch::SEL_ACTION_MAX
:
76
return
new
(home)
ViewSelMaxTbl
<
MeritAction<FloatView>
>(home,fvb);
77
case
FloatVarBranch::SEL_CHB_MIN
:
78
return
new
(home)
ViewSelMinTbl
<
MeritCHB<FloatView>
>(home,fvb);
79
case
FloatVarBranch::SEL_CHB_MAX
:
80
return
new
(home)
ViewSelMaxTbl
<
MeritCHB<FloatView>
>(home,fvb);
81
case
FloatVarBranch::SEL_DEGREE_SIZE_MIN
:
82
return
new
(home)
ViewSelMinTbl<MeritDegreeSize>
(home,fvb);
83
case
FloatVarBranch::SEL_DEGREE_SIZE_MAX
:
84
return
new
(home)
ViewSelMaxTbl<MeritDegreeSize>
(home,fvb);
85
case
FloatVarBranch::SEL_AFC_SIZE_MIN
:
86
return
new
(home)
ViewSelMinTbl<MeritAFCSize>
(home,fvb);
87
case
FloatVarBranch::SEL_AFC_SIZE_MAX
:
88
return
new
(home)
ViewSelMaxTbl<MeritAFCSize>
(home,fvb);
89
case
FloatVarBranch::SEL_ACTION_SIZE_MIN
:
90
return
new
(home)
ViewSelMinTbl<MeritActionSize>
(home,fvb);
91
case
FloatVarBranch::SEL_ACTION_SIZE_MAX
:
92
return
new
(home)
ViewSelMaxTbl<MeritActionSize>
(home,fvb);
93
case
FloatVarBranch::SEL_CHB_SIZE_MIN
:
94
return
new
(home)
ViewSelMinTbl<MeritCHBSize>
(home,fvb);
95
case
FloatVarBranch::SEL_CHB_SIZE_MAX
:
96
return
new
(home)
ViewSelMaxTbl<MeritCHBSize>
(home,fvb);
97
default
:
98
throw
UnknownBranching
(
"Float::branch"
);
99
}
100
}
else
{
101
switch
(fvb.
select
()) {
102
case
FloatVarBranch::SEL_MERIT_MIN
:
103
return
new
(home)
ViewSelMin
<
MeritFunction<FloatView>
>(home,fvb);
104
case
FloatVarBranch::SEL_MERIT_MAX
:
105
return
new
(home)
ViewSelMax
<
MeritFunction<FloatView>
>(home,fvb);
106
case
FloatVarBranch::SEL_MIN_MIN
:
107
return
new
(home)
ViewSelMin<MeritMin>
(home,fvb);
108
case
FloatVarBranch::SEL_MIN_MAX
:
109
return
new
(home)
ViewSelMax<MeritMin>
(home,fvb);
110
case
FloatVarBranch::SEL_MAX_MIN
:
111
return
new
(home)
ViewSelMin<MeritMax>
(home,fvb);
112
case
FloatVarBranch::SEL_MAX_MAX
:
113
return
new
(home)
ViewSelMax<MeritMax>
(home,fvb);
114
case
FloatVarBranch::SEL_SIZE_MIN
:
115
return
new
(home)
ViewSelMin<MeritSize>
(home,fvb);
116
case
FloatVarBranch::SEL_SIZE_MAX
:
117
return
new
(home)
ViewSelMax<MeritSize>
(home,fvb);
118
case
FloatVarBranch::SEL_DEGREE_MIN
:
119
return
new
(home)
ViewSelMin
<
MeritDegree<FloatView>
>(home,fvb);
120
case
FloatVarBranch::SEL_DEGREE_MAX
:
121
return
new
(home)
ViewSelMax
<
MeritDegree<FloatView>
>(home,fvb);
122
case
FloatVarBranch::SEL_AFC_MIN
:
123
return
new
(home)
ViewSelMin
<
MeritAFC<FloatView>
>(home,fvb);
124
case
FloatVarBranch::SEL_AFC_MAX
:
125
return
new
(home)
ViewSelMax
<
MeritAFC<FloatView>
>(home,fvb);
126
case
FloatVarBranch::SEL_ACTION_MIN
:
127
return
new
(home)
ViewSelMin
<
MeritAction<FloatView>
>(home,fvb);
128
case
FloatVarBranch::SEL_ACTION_MAX
:
129
return
new
(home)
ViewSelMax
<
MeritAction<FloatView>
>(home,fvb);
130
case
FloatVarBranch::SEL_CHB_MIN
:
131
return
new
(home)
ViewSelMin
<
MeritCHB<FloatView>
>(home,fvb);
132
case
FloatVarBranch::SEL_CHB_MAX
:
133
return
new
(home)
ViewSelMax
<
MeritCHB<FloatView>
>(home,fvb);
134
case
FloatVarBranch::SEL_DEGREE_SIZE_MIN
:
135
return
new
(home)
ViewSelMin<MeritDegreeSize>
(home,fvb);
136
case
FloatVarBranch::SEL_DEGREE_SIZE_MAX
:
137
return
new
(home)
ViewSelMax<MeritDegreeSize>
(home,fvb);
138
case
FloatVarBranch::SEL_AFC_SIZE_MIN
:
139
return
new
(home)
ViewSelMin<MeritAFCSize>
(home,fvb);
140
case
FloatVarBranch::SEL_AFC_SIZE_MAX
:
141
return
new
(home)
ViewSelMax<MeritAFCSize>
(home,fvb);
142
case
FloatVarBranch::SEL_ACTION_SIZE_MIN
:
143
return
new
(home)
ViewSelMin<MeritActionSize>
(home,fvb);
144
case
FloatVarBranch::SEL_ACTION_SIZE_MAX
:
145
return
new
(home)
ViewSelMax<MeritActionSize>
(home,fvb);
146
case
FloatVarBranch::SEL_CHB_SIZE_MIN
:
147
return
new
(home)
ViewSelMin<MeritCHBSize>
(home,fvb);
148
case
FloatVarBranch::SEL_CHB_SIZE_MAX
:
149
return
new
(home)
ViewSelMax<MeritCHBSize>
(home,fvb);
150
default
:
151
throw
UnknownBranching
(
"Float::branch"
);
152
}
153
}
154
GECODE_NEVER
;
155
return
NULL;
156
}
157
158
}}}
159
160
161
// STATISTICS: float-branch
162
Gecode::FloatVarBranch::SEL_ACTION_SIZE_MIN
With smallest action divided by domain size.
Definition:
float.hh:1694
Gecode::ViewSelMinTbl
Select view with least merit taking tie-break limit into account.
Definition:
view-sel.hpp:315
Gecode::ViewSelRnd
Select a view randomly.
Definition:
view-sel.hpp:149
Gecode::ViewSelNone
Select the first unassigned view.
Definition:
view-sel.hpp:109
Gecode::FloatVarBranch::SEL_DEGREE_MAX
With largest degree.
Definition:
float.hh:1677
Gecode::FloatVarBranch::SEL_AFC_MAX
With largest accumulated failure count.
Definition:
float.hh:1679
Gecode::MeritDegree
Merit class for degree.
Definition:
merit.hpp:93
Gecode::FloatVarBranch::SEL_ACTION_MIN
With lowest action.
Definition:
float.hh:1680
Gecode::MeritFunction
Merit class for user-defined merit function.
Definition:
merit.hpp:68
Gecode::FloatVarBranch::SEL_NONE
First unassigned.
Definition:
float.hh:1672
Gecode::FloatVarBranch
Which variable to select for branching.
Definition:
float.hh:1668
Gecode::FloatVarBranch::SEL_CHB_MIN
With lowest CHB Q-score.
Definition:
float.hh:1682
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::FloatVarBranch::SEL_DEGREE_MIN
With smallest degree.
Definition:
float.hh:1676
Gecode::Float::UnknownBranching
Exception: Unknown value or variable selection passed as argument
Definition:
exception.hpp:109
Gecode
Gecode toplevel namespace
Gecode::FloatVarBranch::SEL_SIZE_MIN
With smallest domain size.
Definition:
float.hh:1688
Gecode::FloatVarBranch::SEL_SIZE_MAX
With largest domain size.
Definition:
float.hh:1689
Gecode::MeritAFC
Merit class for AFC.
Definition:
merit.hpp:108
Gecode::FloatVarBranch::SEL_CHB_MAX
With highest CHB Q-score.
Definition:
float.hh:1683
Gecode::FloatVarBranch::SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
Definition:
float.hh:1697
Gecode::ViewSelMax
Select view with largest merit.
Definition:
view-sel.hpp:335
Gecode::FloatVarBranch::select
Select select(void) const
Return selection strategy.
Definition:
var.hpp:69
Gecode::FloatVarBranch::SEL_CHB_SIZE_MIN
With smallest CHB Q-score divided by domain size.
Definition:
float.hh:1696
Gecode::VarBranch::tbl
BranchTbl tbl(void) const
Return tie-break limit function.
Definition:
var.hpp:168
Gecode::FloatVarBranch::SEL_MERIT_MIN
With least merit.
Definition:
float.hh:1674
Gecode::FloatVarBranch::SEL_MIN_MIN
With smallest min.
Definition:
float.hh:1684
GECODE_NEVER
#define GECODE_NEVER
Assert that this command is never executed.
Definition:
macros.hpp:56
Gecode::FloatVarBranch::SEL_DEGREE_SIZE_MAX
With largest degree divided by domain size.
Definition:
float.hh:1691
branch.hh
Gecode::FloatVarBranch::SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
Definition:
float.hh:1693
Gecode::Float::Branch::viewsel
ViewSel< FloatView > * viewsel(Space &home, const FloatVarBranch &fvb)
Return view selectors for float views.
Definition:
view-sel.cpp:39
Gecode::FloatVarBranch::SEL_MAX_MAX
With largest max.
Definition:
float.hh:1687
Gecode::FloatVarBranch::SEL_DEGREE_SIZE_MIN
With smallest degree divided by domain size.
Definition:
float.hh:1690
Gecode::ViewSelMaxTbl
Select view with largest merit taking tie-break limit into account.
Definition:
view-sel.hpp:355
Gecode::FloatVarBranch::SEL_AFC_MIN
With smallest accumulated failure count.
Definition:
float.hh:1678
Gecode::FloatVarBranch::SEL_MIN_MAX
With largest min.
Definition:
float.hh:1685
Gecode::FloatVarBranch::SEL_MERIT_MAX
With highest merit.
Definition:
float.hh:1675
Gecode::ViewSelMin
Select view with least merit.
Definition:
view-sel.hpp:295
Gecode::MeritCHB
Merit class for CHB.
Definition:
merit.hpp:153
Gecode::FloatVarBranch::SEL_RND
Random (uniform, for tie breaking)
Definition:
float.hh:1673
Gecode::MeritAction
Merit class for action.
Definition:
merit.hpp:130
Gecode::FloatVarBranch::SEL_MAX_MIN
With smallest max.
Definition:
float.hh:1686
Gecode::FloatVarBranch::SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
Definition:
float.hh:1695
Gecode::FloatVarBranch::SEL_ACTION_MAX
With highest action.
Definition:
float.hh:1681
Gecode::FloatVarBranch::SEL_AFC_SIZE_MIN
With smallest accumulated failure count divided by domain size.
Definition:
float.hh:1692