de.cesr.more.rs.building
Class MRsErdosRenyiRandomNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<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.MRsErdosRenyiRandomNetworkService<AgentType,EdgeType>
All Implemented Interfaces:
MoreNetworkBuilder<AgentType,EdgeType>, MoreNetworkService<AgentType,EdgeType>, MoreNetworkEdgeModifier<AgentType,EdgeType>, MoreNetworkModifier<AgentType,EdgeType>, MoreRsNetworkBuilder<AgentType,EdgeType>, MoreRsNetworkService<AgentType,EdgeType>

public class MRsErdosRenyiRandomNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
extends MRsNetworkService<AgentType,EdgeType>

MORe

Date:
13.06.2012

Field Summary
protected  String name
           
 
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
MRsErdosRenyiRandomNetworkService(MoreEdgeFactory<AgentType,EdgeType> eFac, 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)
          Links the given collection of agents and thus generates the network.
 void setContext(repast.simphony.context.Context<AgentType> context)
          Set the context the resulting network is embedded within.
 String toString()
           
 
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

name

protected String name
Constructor Detail

MRsErdosRenyiRandomNetworkService

public MRsErdosRenyiRandomNetworkService(MoreEdgeFactory<AgentType,EdgeType> eFac,
                                         String name)
Method Detail

buildNetwork

public MoreRsNetwork<AgentType,EdgeType> buildNetwork(Collection<AgentType> agents)
Description copied from interface: MoreNetworkBuilder
Links the given collection of agents and thus generates the network.

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

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
See Also:
MoreNetworkModifier.addAndLinkNode(de.cesr.more.basic.network.MoreNetwork, java.lang.Object)

setContext

public void setContext(repast.simphony.context.Context<AgentType> context)
Description copied from interface: MoreRsNetworkBuilder
Set the context the resulting network is embedded within.

Specified by:
setContext in interface MoreRsNetworkBuilder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
Overrides:
setContext in class MRsNetworkService<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
See Also:
MoreRsNetworkBuilder.setContext(repast.simphony.context.Context)

toString

public String toString()
Overrides:
toString in class Object