stopbrancher.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Guido Tack, 2006
*
* 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.
*
*/
#include <gecode/kernel.hh>
#include <gecode/gist.hh>
namespace Gecode { namespace Gist {
class GECODE_GIST_EXPORT StopChoice : public Choice {
public:
StopChoice(const Brancher& b);
virtual void archive(Archive& e) const;
};
class StopBrancher : public Brancher {
protected:
bool done;
StopBrancher(Home home);
StopBrancher(Space& home, StopBrancher& b);
public:
virtual bool status(const Space&) const;
virtual Choice* choice(Space&);
virtual Choice* choice(const Space& home, Archive&);
virtual ExecStatus commit(Space&, const Choice&, unsigned int);
virtual void print(const Space& home, const Gecode::Choice& c,
unsigned int,
std::ostream& o) const;
virtual Actor* copy(Space& home);
static void post(Home home);
virtual size_t dispose(Space&);
};
}}
// STATISTICS: gist-any
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::Archive
Archive representation
Definition archive.hpp:42
Gecode::Brancher
Base-class for branchers.
Definition core.hpp:1442
Gecode::Brancher::Space
friend class Space
Definition core.hpp:1444
Gecode::Brancher::Brancher
Brancher(Home home)
Constructor for creation.
Definition core.hpp:3605
Gecode::Brancher::Choice
friend class Choice
Definition core.hpp:1445
Gecode::Choice
Choice for performing commit
Definition core.hpp:1412
Gecode::Choice::Choice
Choice(const Brancher &b, const unsigned int a)
Initialize for particular brancher b and alternatives a.
Definition core.hpp:3766
Gecode::Gist::StopBrancher::copy
virtual Actor * copy(Space &home)
Copy brancher.
Definition stopbrancher.cpp:74
Gecode::Gist::StopBrancher::dispose
virtual size_t dispose(Space &)
Delete brancher and return its size.
Definition stopbrancher.cpp:82
Gecode::Gist::StopBrancher::print
virtual void print(const Space &home, const Gecode::Choice &c, unsigned int, std::ostream &o) const
Print explanation.
Definition stopbrancher.cpp:69
Gecode::Gist::StopBrancher::done
bool done
Flag whether brancher has been executed.
Definition stopbrancher.hh:52
Gecode::Gist::StopBrancher::choice
virtual Choice * choice(Space &)
Return choice.
Definition stopbrancher.cpp:55
Gecode::Gist::StopBrancher::post
static void post(Home home)
Post brancher.
Definition stopbrancher.cpp:78
Gecode::Gist::StopBrancher::StopBrancher
StopBrancher(Home home)
Construct brancher.
Definition stopbrancher.cpp:44
Gecode::Gist::StopBrancher::status
virtual bool status(const Space &) const
Check status of brancher, return true if alternatives left.
Definition stopbrancher.cpp:50
Gecode::Gist::StopBrancher::commit
virtual ExecStatus commit(Space &, const Choice &, unsigned int)
Perform commit for choice _c and alternative a.
Definition stopbrancher.cpp:63
Gecode::Gist::StopChoice::StopChoice
StopChoice(const Brancher &b)
Initialize choice for brancher b.
Definition stopbrancher.cpp:38
Gecode::Gist::StopChoice::archive
virtual void archive(Archive &e) const
Archive into e.
Definition stopbrancher.cpp:40
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
gist.hh
GECODE_GIST_EXPORT
#define GECODE_GIST_EXPORT
Definition gist.hh:65
kernel.hh
Gecode::Gist
The Gecode Interactive Search Tool.
Gecode
Gecode toplevel namespace
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472