de.cesr.more.rs.building
Class MDefaultPartnerFinder<AgentType,EdgeType>

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

public class MDefaultPartnerFinder<AgentType,EdgeType>
extends Object
implements MorePartnerFinder<AgentType,EdgeType>

MORe

Date:
02.04.2012

Field Summary
protected  cern.jet.random.Uniform rand
           
 
Constructor Summary
MDefaultPartnerFinder()
           
 
Method Summary
 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)
          Finds a partner for the given focal agent in the given graph.
 AgentType findPartner(Graph<AgentType,EdgeType> graph, AgentType focal, boolean incoming)
          Finds a partner for the given focal agent in the given graph.
protected  cern.jet.random.Uniform getRandomDist()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rand

protected cern.jet.random.Uniform rand
Constructor Detail

MDefaultPartnerFinder

public MDefaultPartnerFinder()
Method Detail

findPartner

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

Specified by:
findPartner in interface MorePartnerFinder<AgentType,EdgeType>
Returns:
See Also:
MorePartnerFinder.findPartner(edu.uci.ics.jung.graph.Graph, java.lang.Object)

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,EdgeType>
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,EdgeType>
Returns:
See Also:
MorePartnerFinder.findPartner(java.util.Collection, edu.uci.ics.jung.graph.Graph, java.lang.Object, boolean)

getRandomDist

protected cern.jet.random.Uniform getRandomDist()