[gecode-users] Extending Actor for actions

Christian Schulte cschulte at kth.se
Wed Aug 6 18:36:22 CEST 2008


Hi David,

Just to make sure that I understand you correctly: you want to have a
datastructure in a space that is automatically cloned whenever Space::clone
is executed. The catch is that the datastructure can contain stuff (such as
variables) that also must be cloned. Is that brief description accurate or
oversimplified (or completely off)?

If accurate one idea is to just create a subclass of space. This subclass
implements a copy constructor called during cloning that will then do two
things:
 - call the copy constructor for cloning of space
 - and after that, copy your own datastructure

A guideline for you to do datastructures that can be cloned, check ViewArray
or VarArray in gecode/kernel/array.icc. You would implement an update
function that does the cloning. This update function then you would call in
the above copy constructor for cloning.

Then, for whatever you do, you do not inherit from Space but from this
subclass. That will work automatically.

Hope that makes some sense...

All the best
Christian

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of David Rijsman
Sent: Wednesday, August 06, 2008 2:35 PM
To: users at gecode.org
Subject: [gecode-users] Extending Actor for actions

I am working on a search framework using Gecode and have a question
concerning the following.

My search generates a node containing actions to be executed where an action
can be an arbitrary operation including generating a disjunction or
conjunction of (sub-)actions. The execution of an action consisting out of a
disjunction of actions will generate new nodes. Each node (approximately,
skipping some optimization) will contain a copy of the Space instance and
should contain a copy of the (stack of) actions to be executed. An action
can have attributes such as variables and for this reason the clone of the
action(stack)s should be included in the clone of the Space instance to make
use of the forwarding of the pointers of the variable implementations.

My question is if it is possible to introduce new classes which will be
cloned (like the Branching extensions) when the Space::clone is invoked
without having to change anything in the Space. I think extending the Actor
class might do it but I thought I ask instead of trying to reverse engineer.

hope this makes some sense,



David J Rijsman
Software Architect
Quintiq

T +31 (0)73 691 07 39
F +31 (0)73 691 07 54
M +31 (0)62 127 68 29
E david.rijsman at quintiq.nl
I www.quintiq.com



This message contains information that may be privileged or confidential and
is the property of Quintiq. It is only intended for the person to whom it is
addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute or use this message or
any part thereof. If you have received this message in error, please notify
the sender immediately and delete all copies of this message. Please note
that e-mails are susceptible to change, therefore they are not binding.

_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list