Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
nogoods.hh
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, 2013
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_NOGOODS_HH__
35#define __GECODE_SEARCH_NOGOODS_HH__
36
37#include <gecode/search.hh>
38
39namespace Gecode { namespace Search {
40
43 public:
45 NoNGL(void);
47 NoNGL(Space& home);
49 NoNGL(Space& home, NoNGL& ngl);
51 virtual void subscribe(Space& home, Propagator& p);
53 virtual void reschedule(Space& home, Propagator& p);
55 virtual void cancel(Space& home, Propagator& p);
57 virtual NGL::Status status(const Space& home) const;
59 virtual ExecStatus prune(Space& home);
61 virtual NGL* copy(Space& home);
62 };
63
66 protected:
70 unsigned int n;
72 NoGoodsProp(Space& home, NGL* root);
74 NoGoodsProp(Space& home, NoGoodsProp& p);
75 public:
77 virtual Actor* copy(Space& home);
79 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
81 virtual void reschedule(Space& home);
83 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
85 template<class Path>
86 static ExecStatus post(Space& home, const Path& p);
88 virtual size_t dispose(Space& home);
89 };
90
91}}
92
94
95#endif
96
97// STATISTICS: search-other
No-good literal recorded during search.
Definition core.hpp:1342
NGL(void)
Constructor for creation.
Definition core.hpp:3819
Status
The status of a no-good literal.
Definition core.hpp:1348
Propagation cost.
Definition core.hpp:486
Base-class for propagators.
Definition core.hpp:1066
friend class Space
Definition core.hpp:1068
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
static ExecStatus post(Space &home, const Path &p)
Post propagator for path p.
Definition nogoods.hpp:90
unsigned int n
Number of no-good literals with subscriptions.
Definition nogoods.hh:70
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition nogoods.cpp:196
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nogoods.cpp:100
virtual Actor * copy(Space &home)
Perform copying during cloning.
Definition nogoods.cpp:77
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Const function (defined as low unary)
Definition nogoods.cpp:82
NoGoodsProp(Space &home, NGL *root)
Constructor for creation.
Definition nogoods.hpp:50
virtual void reschedule(Space &home)
Schedule function.
Definition nogoods.cpp:87
NGL * root
Root of no-good literal tree.
Definition nogoods.hh:68
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition nogoods.cpp:61
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition nogoods.cpp:66
virtual NGL * copy(Space &home)
Create copy.
Definition nogoods.cpp:71
virtual void cancel(Space &home, Propagator &p)
Cancel propagator p from all views of the no-good literal.
Definition nogoods.cpp:53
virtual void reschedule(Space &home, Propagator &p)
Schedule propagator p for all views of the no-good literal.
Definition nogoods.cpp:57
virtual void subscribe(Space &home, Propagator &p)
Subscribe propagator p to all views of the no-good literal.
Definition nogoods.cpp:49
NoNGL(void)
Constructor for creation.
Definition nogoods.hpp:37
Computation spaces.
Definition core.hpp:1744
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Search engines
Gecode toplevel namespace
ExecStatus
Definition core.hpp:472
#define GECODE_SEARCH_EXPORT
Definition search.hh:67
#define GECODE_VTABLE_EXPORT
Definition support.hh:72