de.cesr.more.rs.building
Class MGeoRsBaselineRadiusNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType> & MoreEdge<AgentType>>
java.lang.Object
de.cesr.more.building.network.MNetworkService<AgentType,EdgeType>
de.cesr.more.rs.building.MRsNetworkService<AgentType,EdgeType>
de.cesr.more.rs.building.MGeoRsNetworkService<AgentType,EdgeType>
de.cesr.more.rs.building.MGeoRsBaselineRadiusNetworkService<AgentType,EdgeType>
- Type Parameters:
AgentT
- The type of nodesEdgeType
- 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:
- For every agent in the context
- Fetch all agents within a given radius (
SEARCH_RADIUS
) around the focal agent (do not consider area
boundaries).
- 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.
- 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.
- 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 PmParameterDefinition
s:
[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
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()
|
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
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
-
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()