de.cesr.more.rs.building
Class MRsLattice2DNetworkBuilder<AgentType,EdgeType extends MRepastEdge<AgentType>>

java.lang.Object
  extended by de.cesr.more.building.network.MLattice2DNetworkBuilder<AgentType,EdgeType>
      extended by de.cesr.more.rs.building.MRsLattice2DNetworkBuilder<AgentType,EdgeType>
All Implemented Interfaces:
MoreNetworkBuilder<AgentType,EdgeType>, MoreRsNetworkBuilder<AgentType,EdgeType>
Direct Known Subclasses:
MGeoRsLattice2DNetworkBuilder

public class MRsLattice2DNetworkBuilder<AgentType,EdgeType extends MRepastEdge<AgentType>>
extends MLattice2DNetworkBuilder<AgentType,EdgeType>
implements MoreRsNetworkBuilder<AgentType,EdgeType>

MORe

Date:
14.05.2012

Field Summary
protected  repast.simphony.context.Context<AgentType> context
           
 
Fields inherited from class de.cesr.more.building.network.MLattice2DNetworkBuilder
edgeModifier, latticeGenerator, name
 
Constructor Summary
MRsLattice2DNetworkBuilder()
           
MRsLattice2DNetworkBuilder(MoreEdgeFactory<AgentType,EdgeType> eFac, String name)
           
 
Method Summary
 MoreRsNetwork<AgentType,EdgeType> buildNetwork(Collection<AgentType> agents)
          The order of elements in agents influences the lattice's characteristic.
 void setContext(repast.simphony.context.Context<AgentType> context)
          Set the context the resulting network is embedded within.
 
Methods inherited from class de.cesr.more.building.network.MLattice2DNetworkBuilder
checkAgentCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected repast.simphony.context.Context<AgentType> context
Constructor Detail

MRsLattice2DNetworkBuilder

public MRsLattice2DNetworkBuilder()

MRsLattice2DNetworkBuilder

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

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,EdgeType extends MRepastEdge<AgentType>>
See Also:
MoreRsNetworkBuilder.setContext(repast.simphony.context.Context)

buildNetwork

public MoreRsNetwork<AgentType,EdgeType> buildNetwork(Collection<AgentType> agents)
The order of elements in agents influences the lattice's characteristic. So, make sure to shuffle the collection unless you require a special grid! Furthermore in this regard, make sure the network underlying graph is an ordered one (however, one that does not use HashMaps to store vertices), like UndirectedOrderedSparseMultigraph (RS's UndirectedJungNetworks and DirectedJungNetwork use such ordered graphs)!

Specified by:
buildNetwork in interface MoreNetworkBuilder<AgentType,EdgeType extends MRepastEdge<AgentType>>
Specified by:
buildNetwork in interface MoreRsNetworkBuilder<AgentType,EdgeType extends MRepastEdge<AgentType>>
Overrides:
buildNetwork in class MLattice2DNetworkBuilder<AgentType,EdgeType extends MRepastEdge<AgentType>>
Returns:
network
See Also:
MoreRsNetworkBuilder.buildNetwork(java.util.Collection)