MASON-INTEREST-L Archives

July 2012

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 17 Jul 2012 19:12:54 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (48 lines)
Joey is correct.  The issue is that the adjacency matrix does not make new edges -- the edges it's constructed of are the same edges that are owned by (in your case) softRestartSocialNetwork.  You're trying to also use them in consumerSocialNetwork, which is a no-no.  And Joey is right that you can just use the copy-constructor.

Sean

On Jul 17, 2012, at 3:06 PM, Joey Harrison wrote:

> Hey Russell,
> 
> I just took a look at the MASON code and I think I know what's happening. First, note the following from Edge.java:
> 
>     // to prevent edges from breaking fields by being stored in two different fields.
>     // if null, then no owner -- the Edge is free to be added to a field.
>     Network owner;
> 
> Then, in Network.addEdge(final Edge edge):
> 
>         if (edge.owner!=null)
>             throw new RuntimeException("Attempted to add an Edge already added elsewhere");
> 
> When you created the network the first time, each of your edge's had their owner variable set. You can't really reuse edges like that, but I think you can use the copy constructor like so:
> 
> consumerSocialNetwork.addEdge(new Edge(e[i][j]));
> 
> Good luck,
> Joey
> 
> On Tue, Jul 17, 2012 at 3:02 PM, Joey Harrison <[log in to unmask]> wrote:
> Hey Russell,
> 
> I just took a look at the MASON code and I think I know what's happening. First, note the following from Edge.java:
> 
>     // to prevent edges from breaking fields by being stored in two different fields.
>     // if null, then no owner -- the Edge is free to be added to a field.
>     Network owner;
> 
> Then, in Network.addEdge(final Edge edge):
> 
>         if (edge.owner!=null)
>             throw new RuntimeException("Attempted to add an Edge already added elsewhere");
> 
> When you created the network the first time, each of your edge's had their owner variable set. You can't really reuse edges like that, but I think you can use the copy constructor like so:
> 
> consumerSocialNetwork.addEdge(new Edge(e[i][j]));
> 
> Good luck,
> Joey
> 

ATOM RSS1 RSS2