|
From: Nick C. <sr...@ea...> - 2001-08-31 17:44:04
|
I think Mike's suggestion here is a good one. But a question, under what conditions will there be duplicate ties. Is it something we can protect against when ties are created, a switch to all multiplex networks, or an exception is thrown? nick Skye Bender-deMoll wrote: > Nick, Tom, > > So I'm doing some network stuff where I want to make changes to the > network (removing duplicate ties as preperation for stats methods) > without makeing changes to the actual node "Agents" of the model. > Unfortunatly, methods like ArrayList.clone() only return shallow copies, > so any changes to the copied nodes will change the origial nodes. Now > in my case, I can probably come up with a workaround: > > 1) modify the stat function to check the condition (very awkward, but > probably the least expensive) > 2) since I am only interested in edges (and not the rest of nodes > properties), I can make a method which constructs a new network, > identical to the old one, but constructed from default nodes and edges, > and perform operations on it. > > However, there may be other cases in which people want to do things to > agents, without changeing the "real" agents. I was thinking that we > should add copy methods to the existing node structures, and add > getCopy() to the Node interface, but this would break all existing > nodes, and still not insure that all relevent variables would be > copied. Tom suggested creating a "copyable" interface and having the > abstract classes implement it... > > Nick, do you know of any other way of getting deep copies of objects? > (clone() is protected) This would still be a problem for networks, as a > deep copy of a node would necessarily have to return the whole network, > as each edge contains nodes, which contain edges.... > > Something to think about anyway! > > (in the meantime, I just won't let people work with multiplex networks!) > -skye > > _______________________________________________ > Repast-developer mailing list > Rep...@li... > http://lists.sourceforge.net/lists/listinfo/repast-developer > > -- Nick Collier Social Science Research Computing University of Chicago http://repast.sourceforge.net |