precede.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christopher Mears <Chris.Mears@monash.edu>
*
* Contributing authors:
* Christian Schulte <schulte@gecode.org>
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Christopher Mears, 2011
* Christian Schulte, 2011
* Guido Tack, 2011
*
* 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_SET_PRECEDE_HH__
#define __GECODE_SET_PRECEDE_HH__
#include <gecode/set.hh>
namespace Gecode { namespace Set { namespace Precede {
template<class View>
class Single : public NaryPropagator<View,PC_SET_NONE> {
protected:
using NaryPropagator<View,PC_SET_NONE>::x;
class Index : public Advisor {
public:
int i;
Index(Space& home, Propagator& p, Council<Index>& c, int i);
Index(Space& home, Index& a);
};
Council<Index> c;
int s, t;
int alpha, beta, gamma;
ExecStatus updateAlpha(Space& home);
ExecStatus updateBeta(Space& home);
Single(Home home, ViewArray<View>& x, int s, int t, int beta, int gamma);
Single(Space& home, Single<View>& p);
public:
virtual Propagator* copy(Space& home);
virtual PropCost cost(const Space&, const ModEventDelta&) const;
virtual void reschedule(Space& home);
virtual size_t dispose(Space& home);
virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
static ExecStatus post(Home home, ViewArray<View>& x, int s, int t);
};
}}}
#include <gecode/set/precede/single.hpp>
#endif
// STATISTICS: set-prop
Gecode::ActorLink::Space
friend class Space
Definition core.hpp:595
Gecode::ActorLink::Propagator
friend class Propagator
Definition core.hpp:591
Gecode::Advisor::Advisor
Advisor(Space &home, Propagator &p, Council< A > &c)
Constructor for creation.
Definition core.hpp:3831
Gecode::Advisor::Council
friend class Council
Definition core.hpp:1294
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::NaryPropagator< View, PC_SET_NONE >::x
ViewArray< View > x
Definition pattern.hpp:145
Gecode::NaryPropagator< View, PC_SET_NONE >::NaryPropagator
NaryPropagator(Space &home, NaryPropagator &p)
Gecode::PropCost
Propagation cost.
Definition core.hpp:486
Gecode::Propagator::Space
friend class Space
Definition core.hpp:1066
Gecode::Propagator::Advisor
friend class Advisor
Definition core.hpp:1068
Gecode::Propagator::Council
friend class Council
Definition core.hpp:1069
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::Set::Precede::Single::Index::Index
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
Definition single.hpp:44
Gecode::Set::Precede::Single::Index::i
int i
The position of the view in the view array.
Definition precede.hh:70
Gecode::Set::Precede::Single::alpha
int alpha
Pointers updated during propagation.
Definition precede.hh:81
Gecode::Set::Precede::Single::propagate
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition single.hpp:222
Gecode::Set::Precede::Single::dispose
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Definition single.hpp:174
Gecode::Set::Precede::Single::copy
virtual Propagator * copy(Space &home)
Copy propagator during cloning.
Definition single.hpp:150
Gecode::Set::Precede::Single::gamma
int gamma
Definition precede.hh:81
Gecode::Set::Precede::Single::updateBeta
ExecStatus updateBeta(Space &home)
Update the beta pointer.
Definition single.hpp:73
Gecode::Set::Precede::Single::advise
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition single.hpp:197
Gecode::Set::Precede::Single::t
int t
Definition precede.hh:79
Gecode::Set::Precede::Single::post
static ExecStatus post(Home home, ViewArray< View > &x, int s, int t)
Post propagator that s precedes t in x.
Definition single.hpp:100
Gecode::Set::Precede::Single::c
Council< Index > c
The advisor council.
Definition precede.hh:77
Gecode::Set::Precede::Single::s
int s
The value s must precede t.
Definition precede.hh:79
Gecode::Set::Precede::Single::cost
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.
Definition single.hpp:185
Gecode::Set::Precede::Single::Single
Single(Home home, ViewArray< View > &x, int s, int t, int beta, int gamma)
Constructor for posting.
Definition single.hpp:88
Gecode::Set::Precede::Single::Single
Single(Space &home, Single< View > &p)
Constructor for cloning p.
Gecode::Set::Precede::Single::reschedule
virtual void reschedule(Space &home)
Schedule function.
Definition single.hpp:191
Gecode::Set::Precede::Single::updateAlpha
ExecStatus updateAlpha(Space &home)
Update the alpha pointer.
Definition single.hpp:56
Gecode::Set::Precede::Single::beta
int beta
Definition precede.hh:81
Gecode::View
Gecode::ViewArray
View arrays.
Definition array.hpp:253
set.hh
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode::Int::Precede
Value precedence propagators.
Gecode::Set
Finite integer sets.
Definition var-imp.hpp:137
Gecode::Set::PC_SET_NONE
const Gecode::PropCond PC_SET_NONE
Propagation condition to be ignored (convenience).
Definition var-type.hpp:199
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
single.hpp