Generated on Thu Jul 25 2019 00:00:00 for Gecode by doxygen 1.8.15
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  * Last modified:
10  * $Date: 2017-03-08 11:58:56 +0100 (Wed, 08 Mar 2017) $ by $Author: schulte $
11  * $Revision: 15562 $
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 namespace Gecode {
39 
42  : s(SEL_NONE) {}
43 
46  : VarBranch<FloatVar>(t), s(s0) {}
47 
50  : VarBranch<FloatVar>(r), s(SEL_RND) {}
51 
54  : VarBranch<FloatVar>(d,t), s(s0) {}
55 
58  : VarBranch<FloatVar>(a,t), s(s0) {}
59 
62  : VarBranch<FloatVar>(a,t), s(s0) {}
63 
66  : VarBranch<FloatVar>(c,t), s(s0) {}
67 
70  : VarBranch<FloatVar>(mf,t), s(s0) {}
71 
73  FloatVarBranch::select(void) const {
74  return s;
75  }
76 
77  forceinline void
79  switch (select()) {
80  case SEL_AFC_MIN: case SEL_AFC_MAX:
82  if (!_afc)
83  _afc = FloatAFC(home,x,decay());
84  break;
85  case SEL_ACTION_MIN: case SEL_ACTION_MAX:
87  if (!_act)
88  _act = FloatAction(home,x,decay());
89  break;
90  case SEL_CHB_MIN: case SEL_CHB_MAX:
92  if (!_chb)
93  _chb = FloatCHB(home,x);
94  break;
95  default: ;
96  }
97  }
98 
99 
100  inline FloatVarBranch
103  }
104 
105  inline FloatVarBranch
108  }
109 
110  inline FloatVarBranch
113  }
114 
115  inline FloatVarBranch
117  return FloatVarBranch(r);
118  }
119 
120  inline FloatVarBranch
123  }
124 
125  inline FloatVarBranch
128  }
129 
130  inline FloatVarBranch
133  }
134 
135  inline FloatVarBranch
138  }
139 
140  inline FloatVarBranch
143  }
144 
145  inline FloatVarBranch
148  }
149 
150  inline FloatVarBranch
153  }
154 
155  inline FloatVarBranch
158  }
159 
160  inline FloatVarBranch
163  }
164 
165  inline FloatVarBranch
168  }
169 
170  inline FloatVarBranch
173  }
174 
175  inline FloatVarBranch
178  }
179 
180  inline FloatVarBranch
183  }
184 
185  inline FloatVarBranch
188  }
189 
190  inline FloatVarBranch
193  }
194 
195  inline FloatVarBranch
198  }
199 
200  inline FloatVarBranch
203  }
204 
205  inline FloatVarBranch
208  }
209 
210  inline FloatVarBranch
213  }
214 
215  inline FloatVarBranch
218  }
219 
220  inline FloatVarBranch
223  }
224 
225  inline FloatVarBranch
228  }
229 
230  inline FloatVarBranch
233  }
234 
235  inline FloatVarBranch
238  }
239 
240  inline FloatVarBranch
243  }
244 
245  inline FloatVarBranch
248  }
249 
250  inline FloatVarBranch
253  }
254 
255  inline FloatVarBranch
258  }
259 
260  inline FloatVarBranch
263  }
264 
265  inline FloatVarBranch
268  }
269 
270  inline FloatVarBranch
273  }
274 
275  inline FloatVarBranch
278  }
279 
280  inline FloatVarBranch
283  }
284 
285  inline FloatVarBranch
288  }
289 
290 }
291 
292 // STATISTICS: float-branch
With smallest degree divided by domain size.
Definition: float.hh:1627
FloatVarBranch FLOAT_VAR_CHB_SIZE_MIN(BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:271
NodeType t
Type of node.
Definition: bool-expr.cpp:234
With smallest domain size.
Definition: float.hh:1625
FloatVarBranch(void)
Initialize with strategy SEL_NONE.
Definition: var.hpp:41
CHB _chb
CHB information.
Definition: branch-var.hpp:75
With largest domain size.
Definition: float.hh:1626
With largest CHB Q-score divided by domain size.
Definition: float.hh:1634
With smallest accumulated failure count divided by domain size.
Definition: float.hh:1629
FloatVarBranch FLOAT_VAR_CHB_SIZE_MAX(BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:281
Recording actions for float variables.
Definition: float.hh:1492
FloatVarBranch FLOAT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:126
Passing float variables.
Definition: float.hh:981
FloatVarBranch FLOAT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smalllest accumulated failure count divided by domain size with decay factor d.
Definition: var.hpp:231
AFC _afc
AFC information.
Definition: branch-var.hpp:71
void expand(Home home, const FloatVarArgs &x)
Expand AFC, action, and CHB.
Definition: var.hpp:78
With largest accumulated failure count.
Definition: float.hh:1616
Which variable to select for branching.
Definition: float.hh:1605
Select select(void) const
Return selection strategy.
Definition: var.hpp:73
Select
Which variable selection.
Definition: float.hh:1608
Action _act
Action information.
Definition: branch-var.hpp:73
With highest CHB Q-score.
Definition: float.hh:1620
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:251
FloatVarBranch FLOAT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:101
FloatVarBranch FLOAT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:121
FloatVarBranch FLOAT_VAR_MERIT_MIN(FloatBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:106
With smallest action divided by domain size.
Definition: float.hh:1631
Gecode::IntSet d(v, 7)
With lowest CHB Q-score.
Definition: float.hh:1619
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
FloatVarBranch FLOAT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:216
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:221
double decay(void) const
Return decay factor.
Definition: branch-var.hpp:184
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: branch-var.hpp:52
FloatVarBranch FLOAT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:131
With largest accumulated failure count divided by domain size.
Definition: float.hh:1630
FloatVarBranch FLOAT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:116
With smallest CHB Q-score divided by domain size.
Definition: float.hh:1633
Recording CHB for float variables.
Definition: float.hh:1544
FloatVarBranch FLOAT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:211
FloatVarBranch FLOAT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:196
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:784
Variable branching information.
Definition: branch-var.hpp:59
With smallest accumulated failure count.
Definition: float.hh:1615
Select s
Which variable to select.
Definition: float.hh:1638
FloatVarBranch FLOAT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:141
#define forceinline
Definition: config.hpp:173
With largest degree divided by domain size.
Definition: float.hh:1628
FloatVarBranch FLOAT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:151
FloatVarBranch FLOAT_VAR_CHB_MIN(BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:171
Post propagator for SetVar x
Definition: set.hh:784
Float variables.
Definition: float.hh:874
FloatVarBranch FLOAT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:191
With largest action divided by domain size.
Definition: float.hh:1632
Gecode toplevel namespace
FloatVarBranch FLOAT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:261
Random number generator.
Definition: rnd.hpp:46
FloatVarBranch FLOAT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d.
Definition: var.hpp:241
FloatVarBranch FLOAT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:206
Home class for posting propagators
Definition: core.hpp:922
FloatVarBranch FLOAT_VAR_MERIT_MAX(FloatBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:111
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
FloatVarBranch FLOAT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:161
FloatVarBranch FLOAT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:201
FloatVarBranch FLOAT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:226
std::function< double(const Space &home, FloatVar x, int i)> FloatBranchMerit
Branch merit function type for float variables.
Definition: float.hh:1401
Recording AFC information for float variables.
Definition: float.hh:1455
FloatVarBranch FLOAT_VAR_CHB_MAX(BranchTbl tbl)
Select variable with highest CHB Q-score.
Definition: var.hpp:181