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

public class MRsCompleteNetworkBuilder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
extends MNetworkService<AgentType,EdgeType>
implements MoreRsNetworkBuilder<AgentType,EdgeType>

MORe

Date:
14.05.2012

Field Summary
protected  repast.simphony.context.Context<AgentType> context
          The context the network belongs to.
 
Fields inherited from class de.cesr.more.building.network.MNetworkService
edgeFac, edgeModifier
 
Constructor Summary
MRsCompleteNetworkBuilder(MoreEdgeFactory<AgentType,EdgeType> eFac)
          Uses "Network" as name.
MRsCompleteNetworkBuilder(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 (root) context the network shall span
 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
 

Field Detail

context

protected repast.simphony.context.Context<AgentType extends MoreMilieuAgent> context
The context the network belongs to.

Constructor Detail

MRsCompleteNetworkBuilder

public MRsCompleteNetworkBuilder(MoreEdgeFactory<AgentType,EdgeType> eFac)
Uses "Network" as name.

Parameters:
eFac -

MRsCompleteNetworkBuilder

public MRsCompleteNetworkBuilder(MoreEdgeFactory<AgentType,EdgeType> eFac,
                                 String name)
Parameters:
eFac -
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.

Specified by:
buildNetwork in interface MoreNetworkBuilder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
Specified by:
buildNetwork in interface MoreRsNetworkBuilder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
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.

Specified by:
addAndLinkNode in interface MoreNetworkModifier<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
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)
Set the (root) context the network shall span

Specified by:
setContext in interface MoreRsNetworkBuilder<AgentType extends MoreMilieuAgent,EdgeType extends MRepastEdge<AgentType>>
Parameters:
context -

toString

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