de.cesr.more.rs.building
Class MMilieuPartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>

java.lang.Object
  extended by de.cesr.more.rs.building.MDefaultPartnerFinder<AgentType,EdgeType>
      extended by de.cesr.more.rs.building.MMilieuPartnerFinder<AgentType,EdgeType>
All Implemented Interfaces:
MorePartnerFinder<AgentType,EdgeType>

public class MMilieuPartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>
extends MDefaultPartnerFinder<AgentType,EdgeType>

MORe

Date:
02.04.2012

Field Summary
 
Fields inherited from class de.cesr.more.rs.building.MDefaultPartnerFinder
rand
 
Constructor Summary
MMilieuPartnerFinder(MMilieuNetworkParameterMap networkParams)
           
 
Method Summary
 boolean checkPartner(Graph<AgentType,EdgeType> network, MMilieuNetworkParameterMap paraMap, AgentType ego, AgentType potPartner, int desiredMilieu)
          Returns false if source is already a successor of target.
 boolean checkPartnerMilieu(MMilieuNetworkParameterMap paraMap, AgentType ego, AgentType potPartner, int desiredMilieu)
          Potential partner's milieu is checked based on probabilities in paraMap.
 AgentType findPartner(Collection<AgentType> agents, Graph<AgentType,EdgeType> graph, AgentType focal, boolean incoming)
          Selects a partner for the given focal agent from the given list of potential partners.
 AgentType findPartner(Graph<AgentType,EdgeType> graph, AgentType focal, boolean incoming)
          Finds a partner for the given focal agent in the given graph.
protected  AgentType findPartnerLargeAgentList(Collection<AgentType> agents, Graph<AgentType,EdgeType> graph, AgentType focal, boolean incoming, int desiredMilieu)
           
protected  AgentType findPartnerSmallAgentList(Collection<AgentType> agents, Graph<AgentType,EdgeType> graph, AgentType focal, boolean incoming, int desiredMilieu)
           
protected  int getProbabilisticMilieu(MMilieuNetworkParameterMap networkParams, AgentType focus)
           
 
Methods inherited from class de.cesr.more.rs.building.MDefaultPartnerFinder
findPartner, getRandomDist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMilieuPartnerFinder

public MMilieuPartnerFinder(MMilieuNetworkParameterMap networkParams)
Method Detail

findPartner

public AgentType findPartner(Graph<AgentType,EdgeType> graph,
                             AgentType focal,
                             boolean incoming)
Description copied from interface: MorePartnerFinder
Finds a partner for the given focal agent in the given graph.

Specified by:
findPartner in interface MorePartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>
Overrides:
findPartner in class MDefaultPartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>
incoming - true if a predecessor is requested, false for successor
Returns:
See Also:
MorePartnerFinder.findPartner(edu.uci.ics.jung.graph.Graph, java.lang.Object, boolean)

findPartner

public AgentType findPartner(Collection<AgentType> agents,
                             Graph<AgentType,EdgeType> graph,
                             AgentType focal,
                             boolean incoming)
Description copied from interface: MorePartnerFinder
Selects a partner for the given focal agent from the given list of potential partners. Checks whether the focal agent is already linked to the potential partner.

Specified by:
findPartner in interface MorePartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>
Overrides:
findPartner in class MDefaultPartnerFinder<AgentType extends MoreMilieuAgent,EdgeType extends MoreEdge<? super AgentType>>
Returns:
See Also:
MDefaultPartnerFinder.findPartner(java.util.Collection, edu.uci.ics.jung.graph.Graph, java.lang.Object, boolean)

findPartnerLargeAgentList

protected AgentType findPartnerLargeAgentList(Collection<AgentType> agents,
                                              Graph<AgentType,EdgeType> graph,
                                              AgentType focal,
                                              boolean incoming,
                                              int desiredMilieu)
Parameters:
agents -
graph -
focal -
incoming -
desiredMilieu -
Returns:

findPartnerSmallAgentList

protected AgentType findPartnerSmallAgentList(Collection<AgentType> agents,
                                              Graph<AgentType,EdgeType> graph,
                                              AgentType focal,
                                              boolean incoming,
                                              int desiredMilieu)
Parameters:
agents -
graph -
focal -
incoming -
desiredMilieu -
Returns:

getProbabilisticMilieu

protected int getProbabilisticMilieu(MMilieuNetworkParameterMap networkParams,
                                     AgentType focus)

checkPartner

public boolean checkPartner(Graph<AgentType,EdgeType> network,
                            MMilieuNetworkParameterMap paraMap,
                            AgentType ego,
                            AgentType potPartner,
                            int desiredMilieu)
Returns false if source is already a successor of target. Otherwise, the milieu is checked based on paraMap.

Parameters:
network -
paraMap -
ego -
potPartner -
desiredMilieu - desired milieu - 0 to select milieu probabilistically
Returns:
true if the check was positive

checkPartnerMilieu

public boolean checkPartnerMilieu(MMilieuNetworkParameterMap paraMap,
                                  AgentType ego,
                                  AgentType potPartner,
                                  int desiredMilieu)
Potential partner's milieu is checked based on probabilities in paraMap. Does not check if the potential partner is already connected to ego!

Parameters:
paraMap -
ego -
potPartner -
desiredMilieu - desired milieu - 0 to select milieu probabilistically
Returns: