de.cesr.more.rs.building
Class MGeoRsBaselineRadiusNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType> & MoreEdge<AgentType>>

java.lang.Object
  extended by de.cesr.more.building.network.MNetworkService<AgentType,EdgeType>
      extended by de.cesr.more.rs.building.MRsNetworkService<AgentType,EdgeType>
          extended by de.cesr.more.rs.building.MGeoRsNetworkService<AgentType,EdgeType>
              extended by de.cesr.more.rs.building.MGeoRsBaselineRadiusNetworkService<AgentType,EdgeType>
Type Parameters:
AgentT - The type of nodes
EdgeType - The type of edges
All Implemented Interfaces:
MoreNetworkBuilder<AgentType,EdgeType>, MoreNetworkService<AgentType,EdgeType>, MoreGeoNetworkBuilder<AgentType,EdgeType>, MoreGeoNetworkService<AgentType,EdgeType>, MoreNetworkEdgeModifier<AgentType,EdgeType>, MoreNetworkModifier<AgentType,EdgeType>, MoreGeoRsNetworkBuilder<AgentType,EdgeType>, MoreGeoRsNetworkService<AgentType,EdgeType>, MoreRsNetworkBuilder<AgentType,EdgeType>, MoreRsNetworkService<AgentType,EdgeType>
Direct Known Subclasses:
MGeoRsBaselineNumberNetworkService, MGeoRsBaselineRingNetworkService, MGeoRsHomophilyDistanceNetworkService, MGeoRsIdealNetworkService, MGroupBaselineRadiusNetworkService

public class MGeoRsBaselineRadiusNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType> & MoreEdge<AgentType>>
extends MGeoRsNetworkService<AgentType,EdgeType>

This network builder considers baseline homophily [1]. Agents are linked as follows:

  1. For every agent in the context
    1. Fetch all agents within a given radius (SEARCH_RADIUS) around the focal agent (do not consider area boundaries).
    2. For every potential partner that is not yet connected check according to milieu specific probability if it should be connected with focal agent. The approach to check the agents that are in the surroundings as they come considers the local milieu distribution and reflects baseline homophily. Applying milieu specific tie probabilities reflects inbreeding homophily.
    3. If the number of required neighbours (K) is not satisfied but all fetched agents are checked, request more agents from geography within an extended radius ( SEARCH_RADIUS = SEARCH_RADIUS + X_SEARCH_RADIUS) until maximum radius (MAX_SEARCH_RADIUS) is reached.
  2. Global Linking: For each locally created link establish a global link with probability p_rewire to a randomly chosen agent from the whole region that passes the milieu check (applying milieu tie probabilities ( p_links for every partnerMilieu). Determining the milieu during global linking drives the milieu distributions of partners towards inbreeeding homophily.
Uses MGeographyWrapper.getSurroundingAgents(Object, double, Class) to fetch agents (all agents within the given radius of the given class).

Internal: The BaselineDhhRadiusNetworkBuilder is based on DHH_ColCalc_Computer_Lifestyle.

Property Value
#Vertices N (via collection of agents)
#Edges: N*(N-1)


Considered PmParameterDefinitions:

[1] McPherson, M.; Smith-Lovin, L. & Cook, J. Birds of a feather: Homophily in social networks Annual Review of Sociology, Annual Reviews, 2001, 27, 415-444

Date:
22.07.2010

Field Summary
protected  List<AgentType> agentList
           
static int CHECKED_NEIGHBOURS_CAPACITY_FACTOR
          The multiplicative of the first retrieved neighbours' list's size that is used to initialise the checked neighbours array list.
protected  String name
           
protected  MMilieuNetworkParameterMap paraMap
           
protected  MMilieuPartnerFinder<AgentType,EdgeType> partnerFinder
           
protected  cern.jet.random.Uniform rand
           
 
Fields inherited from class de.cesr.more.rs.building.MGeoRsNetworkService
geoFactory, geography, geoRequestClass, pm
 
Fields inherited from class de.cesr.more.rs.building.MRsNetworkService
context
 
Fields inherited from class de.cesr.more.building.network.MNetworkService
edgeFac, edgeModifier
 
Constructor Summary
MGeoRsBaselineRadiusNetworkService(repast.simphony.space.gis.Geography<Object> geography, MoreEdgeFactory<AgentType,EdgeType> edgeFac, String name)
          - builder constructor - edge modifier - builder set - parma
MGeoRsBaselineRadiusNetworkService(MoreEdgeFactory<AgentType,EdgeType> edgeFac)
           
MGeoRsBaselineRadiusNetworkService(MoreEdgeFactory<AgentType,EdgeType> edgeFac, String name)
           
 
Method Summary
 boolean addAndLinkNode(MoreNetwork<AgentType,EdgeType> network, AgentType node)
          Removes an agent from the given network and deletes all its links.
 MoreRsNetwork<AgentType,EdgeType> buildNetwork(Collection<AgentType> agents)
          NOTE: Agents is not used since the collection of agents is taken from context!
protected  void checkParameter()
           
protected  int connectAgent(MMilieuNetworkParameterMap paraMap, MoreNetwork<AgentType,EdgeType> network, int numNotConnectedPartners, MGeographyWrapper<Object> geoWrapper, AgentType hh)
           
protected  void createRadiusNetwork(Collection<AgentType> agents, MMilieuNetworkParameterMap paraMap, MoreRsNetwork<AgentType,EdgeType> network)
           
 List<AgentType> getAgentList()
           
protected  AgentType getRandomFromContext(repast.simphony.context.Context<AgentType> context, Class<? extends AgentType> clazz)
           
protected  Class<? extends AgentType> getRequestClass(AgentType hh)
           
protected  AgentType globalLinking(MMilieuNetworkParameterMap networkParams, MoreNetwork<AgentType,EdgeType> network, AgentType focus, Class<? extends AgentType> requestClass)
           
 String toString()
           
 
Methods inherited from class de.cesr.more.rs.building.MGeoRsNetworkService
getGeoRequestClass, logEdges, setContext, setGeography, setGeoRequestClass, shuffleCollection
 
Methods inherited from class de.cesr.more.building.network.MNetworkService
addAgents, checkAgentCollection, createEdge, getEdgeFactory, getEdgeModifier, logEdges, removeEdge, removeNode, setEdgeModifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.cesr.more.manipulate.network.MoreNetworkModifier
removeNode, setEdgeModifier
 
Methods inherited from interface de.cesr.more.manipulate.edge.MoreNetworkEdgeModifier
createEdge, getEdgeFactory, removeEdge
 

Field Detail

CHECKED_NEIGHBOURS_CAPACITY_FACTOR

public static final int CHECKED_NEIGHBOURS_CAPACITY_FACTOR
The multiplicative of the first retrieved neighbours' list's size that is used to initialise the checked neighbours array list.

See Also:
Constant Field Values

rand

protected cern.jet.random.Uniform rand

name

protected String name

paraMap

protected MMilieuNetworkParameterMap paraMap

partnerFinder

protected MMilieuPartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType> & MoreEdge<AgentType>> partnerFinder

agentList

protected List<AgentType extends MoreMilieuAgent> agentList
Constructor Detail

MGeoRsBaselineRadiusNetworkService

public MGeoRsBaselineRadiusNetworkService(MoreEdgeFactory<AgentType,EdgeType> edgeFac)

MGeoRsBaselineRadiusNetworkService

public MGeoRsBaselineRadiusNetworkService(MoreEdgeFactory<AgentType,EdgeType> edgeFac,
                                          String name)

MGeoRsBaselineRadiusNetworkService

public MGeoRsBaselineRadiusNetworkService(repast.simphony.space.gis.Geography<Object> geography,
                                          MoreEdgeFactory<AgentType,EdgeType> edgeFac,
                                          String name)
- builder constructor - edge modifier - builder set - parma

Parameters:
areasGeography -
Method Detail

buildNetwork

public MoreRsNetwork<AgentType,EdgeType> buildNetwork(Collection<AgentType> agents)
NOTE: Agents is not used since the collection of agents is taken from context! Make sure that the order of agents in agents is defined and consistent for equal random seeds! For each agent: For each potential neighbour in surroundings:

Returns:
network
See Also:
MoreNetworkBuilder.buildNetwork(java.util.Collection)

checkParameter

protected void checkParameter()

createRadiusNetwork

protected void createRadiusNetwork(Collection<AgentType> agents,
                                   MMilieuNetworkParameterMap paraMap,
                                   MoreRsNetwork<AgentType,EdgeType> network)
Parameters:
agents -
numNotConnectedPartners -
paraMap -
network -

connectAgent

protected int connectAgent(MMilieuNetworkParameterMap paraMap,
                           MoreNetwork<AgentType,EdgeType> network,
                           int numNotConnectedPartners,
                           MGeographyWrapper<Object> geoWrapper,
                           AgentType hh)
Parameters:
paraMap -
network -
numNotConnectedPartners -
geoWrapper -
hh -
Returns:
the number of _not_ connected partners

getRequestClass

protected Class<? extends AgentType> getRequestClass(AgentType hh)
Parameters:
hh -
requestClass -
Returns:

globalLinking

protected AgentType globalLinking(MMilieuNetworkParameterMap networkParams,
                                  MoreNetwork<AgentType,EdgeType> network,
                                  AgentType focus,
                                  Class<? extends AgentType> requestClass)
Parameters:
networkParams -
network -
focus -
requestClass -
oldInfluencer -

getRandomFromContext

protected AgentType getRandomFromContext(repast.simphony.context.Context<AgentType> context,
                                         Class<? extends AgentType> clazz)
Parameters:
context -
Returns:

addAndLinkNode

public boolean addAndLinkNode(MoreNetwork<AgentType,EdgeType> network,
                              AgentType node)
Description copied from interface: MoreNetworkModifier
Removes an agent from the given network and deletes all its links. Basically, this method reverses all the action that #addAgent(Object, MoreRsNetwork) performed.

Parameters:
network - the network to remove the given agent from
Returns:
true if the agent could be completely removed

getAgentList

public List<AgentType> getAgentList()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()