Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
var.hpp
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
34namespace Gecode {
35
39
43
47
51
55
59
63
67
70 return s;
71 }
72
73 forceinline void
75 switch (select()) {
76 case SEL_AFC_MIN: case SEL_AFC_MAX:
78 if (!_afc)
79 _afc = FloatAFC(home,x,decay());
80 break;
83 if (!_act)
84 _act = FloatAction(home,x,decay());
85 break;
86 case SEL_CHB_MIN: case SEL_CHB_MAX:
88 if (!_chb)
89 _chb = FloatCHB(home,x);
90 break;
91 default: ;
92 }
93 }
94
95
96 inline FloatVarBranch
99 }
100
101 inline FloatVarBranch
105
106 inline FloatVarBranch
110
111 inline FloatVarBranch
113 return FloatVarBranch(r);
114 }
115
116 inline FloatVarBranch
120
121 inline FloatVarBranch
125
126 inline FloatVarBranch
130
131 inline FloatVarBranch
135
136 inline FloatVarBranch
140
141 inline FloatVarBranch
145
146 inline FloatVarBranch
150
151 inline FloatVarBranch
155
156 inline FloatVarBranch
160
161 inline FloatVarBranch
165
166 inline FloatVarBranch
170
171 inline FloatVarBranch
175
176 inline FloatVarBranch
180
181 inline FloatVarBranch
185
186 inline FloatVarBranch
190
191 inline FloatVarBranch
195
196 inline FloatVarBranch
200
201 inline FloatVarBranch
205
206 inline FloatVarBranch
210
211 inline FloatVarBranch
215
216 inline FloatVarBranch
220
221 inline FloatVarBranch
225
226 inline FloatVarBranch
230
231 inline FloatVarBranch
235
236 inline FloatVarBranch
240
241 inline FloatVarBranch
245
246 inline FloatVarBranch
250
251 inline FloatVarBranch
255
256 inline FloatVarBranch
260
261 inline FloatVarBranch
265
266 inline FloatVarBranch
270
271 inline FloatVarBranch
275
276 inline FloatVarBranch
280
281 inline FloatVarBranch
285
286}
287
288// STATISTICS: float-branch
Recording AFC information for float variables.
Definition float.hh:1515
Recording actions for float variables.
Definition float.hh:1561
Recording CHB for float variables.
Definition float.hh:1613
Passing float variables.
Definition float.hh:982
Which variable to select for branching.
Definition float.hh:1674
Select select(void) const
Return selection strategy.
Definition var.hpp:69
FloatVarBranch(void)
Initialize with strategy SEL_NONE.
Definition var.hpp:37
void expand(Home home, const FloatVarArgs &x)
Expand AFC, action, and CHB.
Definition var.hpp:74
Select
Which variable selection.
Definition float.hh:1677
@ SEL_ACTION_SIZE_MIN
With smallest action divided by domain size.
Definition float.hh:1700
@ SEL_ACTION_SIZE_MAX
With largest action divided by domain size.
Definition float.hh:1701
@ SEL_MIN_MIN
With smallest min.
Definition float.hh:1690
@ SEL_AFC_SIZE_MIN
With smallest accumulated failure count divided by domain size.
Definition float.hh:1698
@ SEL_MAX_MAX
With largest max.
Definition float.hh:1693
@ SEL_AFC_SIZE_MAX
With largest accumulated failure count divided by domain size.
Definition float.hh:1699
@ SEL_CHB_MAX
With highest CHB Q-score.
Definition float.hh:1689
@ SEL_DEGREE_SIZE_MIN
With smallest degree divided by domain size.
Definition float.hh:1696
@ SEL_MIN_MAX
With largest min.
Definition float.hh:1691
@ SEL_CHB_SIZE_MIN
With smallest CHB Q-score divided by domain size.
Definition float.hh:1702
@ SEL_NONE
First unassigned.
Definition float.hh:1678
@ SEL_MERIT_MIN
With least merit.
Definition float.hh:1680
@ SEL_ACTION_MAX
With highest action.
Definition float.hh:1687
@ SEL_CHB_MIN
With lowest CHB Q-score.
Definition float.hh:1688
@ SEL_DEGREE_MAX
With largest degree.
Definition float.hh:1683
@ SEL_DEGREE_SIZE_MAX
With largest degree divided by domain size.
Definition float.hh:1697
@ SEL_DEGREE_MIN
With smallest degree.
Definition float.hh:1682
@ SEL_MERIT_MAX
With highest merit.
Definition float.hh:1681
@ SEL_MAX_MIN
With smallest max.
Definition float.hh:1692
@ SEL_CHB_SIZE_MAX
With largest CHB Q-score divided by domain size.
Definition float.hh:1703
@ SEL_RND
Random (uniform, for tie breaking)
Definition float.hh:1679
@ SEL_AFC_MAX
With largest accumulated failure count.
Definition float.hh:1685
@ SEL_SIZE_MAX
With largest domain size.
Definition float.hh:1695
@ SEL_AFC_MIN
With smallest accumulated failure count.
Definition float.hh:1684
@ SEL_ACTION_MIN
With lowest action.
Definition float.hh:1686
@ SEL_SIZE_MIN
With smallest domain size.
Definition float.hh:1694
Select s
Which variable to select.
Definition float.hh:1707
Float variables.
Definition float.hh:870
Home class for posting propagators
Definition core.hpp:856
Random number generator.
Definition rnd.hpp:42
double decay(void) const
Definition var.hpp:180
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition var.hpp:48
std::function< double(const Space &home, FloatVar x, int i)> FloatBranchMerit
Branch merit function type for float variables.
Definition float.hh:1461
Gecode toplevel namespace
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree divided by domain size.
Definition var.hpp:222
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree divided by domain size.
Definition var.hpp:217
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition var.hpp:112
FloatVarBranch FLOAT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest accumulated failure count with decay factor d.
Definition var.hpp:127
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:773
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest domain size.
Definition var.hpp:212
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl=nullptr)
Select variable with largest max.
Definition var.hpp:202
FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smalllest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:227
FloatVarBranch FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr)
Select variable with largest CHB Q-score divided by domain size.
Definition var.hpp:277
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl=nullptr)
Select variable with lowest CHB Q-score.
Definition var.hpp:167
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest CHB Q-score divided by domain size.
Definition var.hpp:267
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with highest action with decay factor d.
Definition var.hpp:157
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl=nullptr)
Select variable with highest CHB Q-score.
Definition var.hpp:177
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl=nullptr)
Select variable with smallest min.
Definition var.hpp:187
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl=nullptr)
Select variable with smallest max.
Definition var.hpp:197
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with lowest action with decay factor d.
Definition var.hpp:147
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:97
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl=nullptr)
Select variable with largest degree.
Definition var.hpp:122
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest action divided by domain size with decay factor d.
Definition var.hpp:257
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl=nullptr)
Select variable with largest min.
Definition var.hpp:192
FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition var.hpp:237
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with least merit according to branch merit function bm.
Definition var.hpp:102
Post propagator for SetVar x
Definition set.hh:773
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest degree.
Definition var.hpp:117
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl=nullptr)
Select variable with smallest domain size.
Definition var.hpp:207
FloatVarBranch FLOAT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr)
Select variable with largest accumulated failure count with decay factor d.
Definition var.hpp:137
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr)
Select variable with smallest action divided by domain size with decay factor d.
Definition var.hpp:247
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl=nullptr)
Select variable with highest merit according to branch merit function bm.
Definition var.hpp:107
#define forceinline
Definition config.hpp:194