Generated on for Gecode by doxygen 1.17.0
cabs.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Mikael Zayenz Lagerkvist <lagerkvist@gecode.dev>
5 *
6 * Copyright:
7 * Mikael Zayenz Lagerkvist, 2026
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.dev
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
35#ifndef GECODE_SEARCH_SEQ_CABS_HH
36#define GECODE_SEARCH_SEQ_CABS_HH
37
38#include <gecode/search.hh>
41
42#ifdef GECODE_HAS_EXPERIMENTAL
43namespace Gecode { namespace Search { namespace Seq {
44
46 class CABS : public Worker {
47 private:
49 Options opt;
51 HeuristicGuidance guidance;
53 Priority priority;
55 std::unique_ptr<Space> root;
57 Entries layer;
59 Beam candidates;
61 unsigned long long int order;
63 ChoiceExpansion expansion;
65 SpaceStatus status;
67 unsigned long int depth;
69 unsigned long long int revision;
71 bool counted;
73 Incumbent best;
75 bool _limited;
77 bool admit(std::unique_ptr<Space> s, unsigned long int d);
79 Space* publish(std::unique_ptr<Space> s);
81 bool advance(void);
83 void initialize(Space* s, bool clone);
84 public:
86 CABS(Space* s, const Options& o);
88 Space* next(void);
90 Statistics statistics(void) const;
92 bool limited(void) const;
94 void constrain(const Space& b);
96 void reset(Space* s);
98 NoGoods& nogoods(void);
99 };
100
101}}}
102
103#endif
104
105#endif
106
107// STATISTICS: search-seq
No-goods recorded from restarts.
Definition core.hpp:1606
Candidates for the next layer of CABS.
Definition heuristic.hh:172
Stack of entries owning their spaces.
Definition heuristic.hh:115
Guidance for heuristic search engines (experimental).
Definition search.hh:1259
Best solution found so far.
Definition heuristic.hh:87
Search engine options
Definition search.hh:848
Order of open nodes: whether a is preferred to b.
Definition heuristic.hh:70
void constrain(const Space &b)
Constrain future solutions to be better than b.
Definition cabs.cpp:318
Space * next(void)
Return next better solution (nullptr if none or stopped).
Definition cabs.cpp:244
Statistics statistics(void) const
Return statistics.
Definition cabs.cpp:308
bool limited(void) const
Whether search stopped at the width or frontier limit.
Definition cabs.cpp:313
NoGoods & nogoods(void)
Return no-goods (none).
Definition cabs.cpp:343
CABS(Space *s, const Options &o)
Initialize for space s with options o.
Definition cabs.cpp:159
Node whose alternatives are expanded one at a time.
Statistics(void)
Initialize.
Worker(void)
Initialize.
Definition worker.hh:72
Computation spaces.
Definition core.hpp:1787
SpaceStatus
Space status
Definition core.hpp:1726
Search engines
Gecode toplevel namespace