nogoods.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2013
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_SEARCH_NOGOODS_HH__
#define __GECODE_SEARCH_NOGOODS_HH__
#include <gecode/search.hh>
namespace Gecode { namespace Search {
class GECODE_VTABLE_EXPORT NoNGL : public NGL {
public:
NoNGL(void);
NoNGL(Space& home);
NoNGL(Space& home, NoNGL& ngl);
virtual void subscribe(Space& home, Propagator& p);
virtual void reschedule(Space& home, Propagator& p);
virtual void cancel(Space& home, Propagator& p);
virtual NGL::Status status(const Space& home) const;
virtual ExecStatus prune(Space& home);
virtual NGL* copy(Space& home);
};
class GECODE_SEARCH_EXPORT NoGoodsProp : public Propagator {
protected:
NGL* root;
unsigned int n;
NoGoodsProp(Space& home, NGL* root);
NoGoodsProp(Space& home, NoGoodsProp& p);
public:
virtual Actor* copy(Space& home);
virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
virtual void reschedule(Space& home);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
template<class Path>
static ExecStatus post(Space& home, const Path& p);
virtual size_t dispose(Space& home);
};
}}
#include <gecode/search/nogoods.hpp>
#endif
// STATISTICS: search-other
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::NGL
No-good literal recorded during search.
Definition core.hpp:1340
Gecode::NGL::NGL
NGL(void)
Constructor for creation.
Definition core.hpp:3812
Gecode::NGL::Status
Status
The status of a no-good literal.
Definition core.hpp:1346
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::Propagator
Base-class for propagators.
Definition core.hpp:1064
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::med
ModEventDelta med
A set of modification events (used during propagation).
Definition core.hpp:1075
Gecode::Propagator::Propagator
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3498
Gecode::Search::NoGoodsProp::post
static ExecStatus post(Space &home, const Path &p)
Post propagator for path p.
Definition nogoods.hpp:90
Gecode::Search::NoGoodsProp::n
unsigned int n
Number of no-good literals with subscriptions.
Definition nogoods.hh:70
Gecode::Search::NoGoodsProp::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition nogoods.cpp:196
Gecode::Search::NoGoodsProp::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition nogoods.cpp:100
Gecode::Search::NoGoodsProp::copy
virtual Actor * copy(Space &home)
Perform copying during cloning.
Definition nogoods.cpp:77
Gecode::Search::NoGoodsProp::cost
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Const function (defined as low unary).
Definition nogoods.cpp:82
Gecode::Search::NoGoodsProp::NoGoodsProp
NoGoodsProp(Space &home, NGL *root)
Constructor for creation.
Definition nogoods.hpp:50
Gecode::Search::NoGoodsProp::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition nogoods.cpp:87
Gecode::Search::NoGoodsProp::root
NGL * root
Root of no-good literal tree.
Definition nogoods.hh:68
Gecode::Search::NoNGL::status
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition nogoods.cpp:61
Gecode::Search::NoNGL::prune
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition nogoods.cpp:66
Gecode::Search::NoNGL::copy
virtual NGL * copy(Space &home)
Create copy.
Definition nogoods.cpp:71
Gecode::Search::NoNGL::cancel
virtual void cancel(Space &home, Propagator &p)
Cancel propagator p from all views of the no-good literal.
Definition nogoods.cpp:53
Gecode::Search::NoNGL::reschedule
virtual void reschedule(Space &home, Propagator &p)
Schedule propagator p for all views of the no-good literal.
Definition nogoods.cpp:57
Gecode::Search::NoNGL::subscribe
virtual void subscribe(Space &home, Propagator &p)
Subscribe propagator p to all views of the no-good literal.
Definition nogoods.cpp:49
Gecode::Search::NoNGL::NoNGL
NoNGL(void)
Constructor for creation.
Definition nogoods.hpp:37
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Search
Search engines
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
nogoods.hpp
search.hh
GECODE_SEARCH_EXPORT
#define GECODE_SEARCH_EXPORT
Definition search.hh:67
GECODE_VTABLE_EXPORT
#define GECODE_VTABLE_EXPORT
Definition support.hh:72