[gecode-users] CCP ask for Gecode
Mauricio Toro
mauriciotorob at gmail.com
Tue Apr 22 11:19:44 CEST 2008
Hello all,
The ask propagator worked fine in Gecode.
I tried it with an example to find concurrently
if there is path in directed graph.
Running around 30000 "ask"s in a 10000 arcs
graph it took around 0,112 seconds.
To manage the AskBody I defined a class
"AskBody" with a virtual Execute method,
that way different bodies can be defined
for the ask propagator inhereting from that class.
I don't know how to define the "spec" method.
Additionally, I had problems with the "reflection post" method
since the AskBody is not a Gecode type.
What do you think about this definition?
Does it seam reasonable?
class AskBody
{
protected:
Space * home;
public:
AskBody(Space * homie) {home = homie;}
virtual void Execute() { };
};
class Ask : public UnaryPropagator<BoolView,PC_GEN_ASSIGNED> {
protected:
using UnaryPropagator<BoolView,PC_GEN_ASSIGNED>::x0;
AskBody * askbody;
/// Constructor for cloning \a p
Ask(Space* home, bool share, Ask& p);
/// Constructor for posting
Ask(Space* home, BoolView x, AskBody * askbody);
public:
/// Copy propagator during cloning
virtual Actor* copy(Space* home, bool share);
/// Perform propagation
virtual ExecStatus propagate(Space* home, ModEventDelta med);
/// Specification for this propagator
//virtual Reflection::ActorSpec spec(const Space* home,
// Reflection::VarMap& m) const;
/// Post propagator according to specification
// static void post(Space* home, Reflection::VarMap& vars,
// const Reflection::ActorSpec& spec);
/// Mangled propagator name
static Support::Symbol ati(void);
/// Post ask propagator
/// \textbf{blocking\_IF} $<boolean\_var>\ x$ \textbf{then}
$<ask\_body>\ askbody$ \textbf{else} $<skip>$
static ExecStatus post(Space* home, BoolView x, AskBody * askbody);
};
Thanks for all,
--
Mauricio Toro Bermudez
Estudiante de Ingeniería de Sistemas
Pontificia Universidad Javeriana, Colombia
Stagiare à l'Ircam
1, place Igor-Stravinsky 75004 Paris,
France de 2008 à 2009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080422/3d5ee3ff/attachment.htm>
More information about the gecode-users
mailing list