Re: Specific Cloning Question




Thomas Weidenfeller wrote:
Alex wrote:
I realise it is hard to help without seeing the code

It is actually a waste of our time.

but I am looking
for general advice on whether cloning is a sensible way to achieve what
I want.

No, it is not.

How do I know? I don't, I am just guessing, because you haven't shown us
how you do things, haven't given us important information like the size
of the tree or the complexity of the operations you intend to do on the
clone and you eventually want to undo.

The reason why I still say it is not a sensible way is because you have
not devised (or not told us) a sensible way of what should happen if you
are satisfied with the changes to the clone and you decide to keep the
cloned tree. Then you might have to "magically" change references to the
old tree all over your program. Might, because we don't know your
program. That's manageable with another level of indirection, but
without you mentioning it, and without seeing your code I simply state
cloning is not a good idea in this case.


If so...how do you go about it? If you think you can help I am
happy to send you my code but it seems silly to post it all here as
it's quite big.

If you can't be bothered to invest some time to cut down your code to
some useful demo of the problem, and if you can't be bothered to even
copy the exception error messages verbatim, why should we invest our
time to second-guess? Is your time more valuable than ours?

/Thomas


--
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq

Clearly I don't think my time is more valuable and you are perfectly
welcome to not spent time replying. My point was simply that if someone
has the time to help me then I would be able to provide more in depth
detail. It seems rather unhelpful and rude to respond in this way.

In answer to some of your questions:
1) Size: The number of leaves in the tree may vary between small (i.e
3/4 to possibly quite large 20+)
2) Operations: The sort of operations is not clear cut yet. Probably
there will be subtree prune and regraft type operations and simple
changing of the lengths of branches within the tree
3) If I am satisfied with the new tree can I not simple set the old
tree equal to the new tree?

The reason I have not managed to cut down the program is that I am not
sure how to do that without losing the complexity that is causing the
problem. I have made smaller versions of things and tried cloning
things that contain lists of references but I don't seem to get the
problems in these oversimplified examples.

Anyway, if your time is too valuable there is no pressure on you or
anyone else to help or to even read this. However, I fail to see that
there is much harm in asking, just in case someone out there knows how
to help and has some time to do it.

Thanks,

Alex

.



Relevant Pages

  • Re: What about cloning cattle and the FDA not informing us...
    ... Then stay very far away from any tree fruit, nuts, vine fruits, garlic, ... "cloning" that has been practiced for centuries. ... the term "clone" that is in many nursery and garden catalogs. ... Why can't I get a packet of seeds for it? ...
    (misc.health.alternative)
  • Re: Specific Cloning Question
    ... tried cloning the tree by cloning all the nodes in it. ... problem here is that when I try to clone Node A it has a reference to ... Alternatively, you could wrap all your nodes in an actual Tree object, ... public MyNode subtreeCopy{ ...
    (comp.lang.java.help)
  • Re: Specific Cloning Question
    ... tried cloning the tree by cloning all the nodes in it. ... problem here is that when I try to clone Node A it has a reference to ... it has a reference to Node A as its child it goes back to trying to ... Alternatively, you could wrap all your nodes in an actual Tree object, ...
    (comp.lang.java.help)
  • Re: Specific Cloning Question
    ... I don't, I am just guessing, because you haven't shown us how you do things, haven't given us important information like the size of the tree or the complexity of the operations you intend to do on the clone and you eventually want to undo. ... Then you might have to "magically" change references to the old tree all over your program. ... That's manageable with another level of indirection, but without you mentioning it, and without seeing your code I simply state cloning is not a good idea in this case. ... If you can't be bothered to invest some time to cut down your code to some useful demo of the problem, and if you can't be bothered to even copy the exception error messages verbatim, why should we invest our time to second-guess? ...
    (comp.lang.java.help)
  • Re: Guess What? Many Of You Wasted Money on Your 1080p TV (But There...
    ... In any event,due to TREE cover (I do not own the trees on my neighbor's ... want to invest in a $3000 portable amateur radio tower that is capable ... channels I can receive on my 4DTV receiver on my big C/Ku-Band 3 meter ...
    (alt.tv.tech.hdtv)