MASON-INTEREST-L Archives

September 2013

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:
Beth Kar <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Thu, 26 Sep 2013 05:54:59 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
Hello!
I am a newbie to mason (and java) and I am trying to dynamically create an
undirected network. I want to add an edge between two nodes using the
following code:

mynetwork.addEdge(AgentA, AgentB, null).

How can I check with an if-then statement before hand if that edge exists
before adding it?

p.s. If ( edge between AgentA and AgentB doesn't exist) {
mynetwork.addEdge(AgentA, AgentB, null)}

How do I represent the phrase 'edge between AgentA and AgentB doesn't exist'
in java?

Thank you in advance for your help!
Beth.

ATOM RSS1 RSS2