uaa.feral.context
Class SocialNetworkBuilder

java.lang.Object
  extended by uaa.feral.context.SocialNetworkBuilder

public class SocialNetworkBuilder
extends java.lang.Object

Class for creating social networks in simulations with existing data.

Author:

Constructor Summary
SocialNetworkBuilder(repast.simphony.space.graph.Network population, repast.simphony.context.Context context)
          Default constructor
 
Method Summary
 void createLink(Person p1, Person p2, double weightF)
          Method to create the social links in the network
 void createNetwork(java.util.Map<Person,java.util.Map<java.lang.String,java.lang.String>> tempData)
          Method that creates the social network
 java.util.List<Person> parseSocialNetworkData(java.util.List<java.util.Map> data, Community community)
          Method to parse the initial social network input
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocialNetworkBuilder

public SocialNetworkBuilder(repast.simphony.space.graph.Network population,
                            repast.simphony.context.Context context)
Default constructor

Parameters:
population - the social network
context - the simulation context to add the population
Method Detail

parseSocialNetworkData

public java.util.List<Person> parseSocialNetworkData(java.util.List<java.util.Map> data,
                                                     Community community)
Method to parse the initial social network input

Parameters:
data - list of data points
community - the community associated with individuals
Returns:
a list of person agents

createNetwork

public void createNetwork(java.util.Map<Person,java.util.Map<java.lang.String,java.lang.String>> tempData)
Method that creates the social network

Parameters:
tempData - a map with people and their network data

createLink

public void createLink(Person p1,
                       Person p2,
                       double weightF)
Method to create the social links in the network

Parameters:
p1 - person 1 (the source)
p2 - person 2 (the target)
weightF - the weight of the edge