Class DefaultNetworkFactory
java.lang.Object
repast.simphony.context.space.graph.DefaultNetworkFactory
- All Implemented Interfaces:
NetworkFactory
Factory for creating networks.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Network<T>
createNetwork
(String netName, Context<T> context, boolean isDirected) Creates a Network that will contain the specified class of objects.<T> Network<T>
createNetwork
(String netName, Context<T> context, boolean isDirected, NetworkGenerator<T> generator, EdgeCreator<? extends RepastEdge<T>, T> edgeCreator) Creates a Network that will contain the specified class of objects.<T> Network<T>
createNetwork
(String netName, Context<T> context, boolean isDirected, EdgeCreator<? extends RepastEdge<T>, T> edgeCreator) Creates a Network that will contain the specified class of objects.<T> Network<T>
createNetwork
(String netName, Context<T> context, NetworkGenerator<T> generator, boolean isDirected) Creates a Network that will contain the specified class of objects.
-
Constructor Details
-
DefaultNetworkFactory
protected DefaultNetworkFactory()
-
-
Method Details
-
createNetwork
Creates a Network that will contain the specified class of objects. Any objects in the context will be added as nodes in the returned Network, but any edges created are local to the network itself. The network is added to the specified Context as a projection and can be retrieved from the Context withContext.getProjection(networkName)
. If a network with the specified name has already been created, that already created network will be returned.- Specified by:
createNetwork
in interfaceNetworkFactory
- Parameters:
netName
- the name of the networkcontext
- the context of which the network will be a projectionisDirected
- whether or not the network should be directed- Returns:
- the created network.
-
createNetwork
public <T> Network<T> createNetwork(String netName, Context<T> context, NetworkGenerator<T> generator, boolean isDirected) Creates a Network that will contain the specified class of objects. Any objects in the context will be added as nodes in the returned Network, but any edges created are local to the network itself. The network is added to the specified Context as a projection and can be retrieved from the Context withContext.getProjection(networkName)
. If a network with the specified name has already been created, that already created network will be returned.- Specified by:
createNetwork
in interfaceNetworkFactory
- Parameters:
netName
- the name of the networkcontext
- the context of which the network will be a projectionisDirected
- whether or not the network should be directedgenerator
- a generator used to create the initial network topology. Note that there must be enough objects in the context to create the topology- Returns:
- the created network.
-
createNetwork
public <T> Network<T> createNetwork(String netName, Context<T> context, boolean isDirected, NetworkGenerator<T> generator, EdgeCreator<? extends RepastEdge<T>, T> edgeCreator) Creates a Network that will contain the specified class of objects. Any objects in the context will be added as nodes in the returned Network, but any edges created are local to the network itself. The network is added to the specified Context as a projection and can be retrieved from the Context withContext.getProjection(networkName)
. If a network with the specified name has already been created, that already created network will be returned.- Specified by:
createNetwork
in interfaceNetworkFactory
- Parameters:
netName
- the name of the networkcontext
- the context of which the network will be a projectionisDirected
- whether or not the network should be directedgenerator
- used to create the initial network topology. Note that there must be enough objects in the context to create the topologyedgeCreator
- the class used to create edges for this network- Returns:
- the created network.
-
createNetwork
public <T> Network<T> createNetwork(String netName, Context<T> context, boolean isDirected, EdgeCreator<? extends RepastEdge<T>, T> edgeCreator) Creates a Network that will contain the specified class of objects. Any objects in the context will be added as nodes in the returned Network, but any edges created are local to the network itself. The network is added to the specified Context as a projection and can be retrieved from the Context withContext.getProjection(networkName)
. If a network with the specified name has already been created, that already created network will be returned.- Specified by:
createNetwork
in interfaceNetworkFactory
- Parameters:
netName
- the name of the networkcontext
- the context of which the network will be a projectionisDirected
- whether or not the network should be directededgeCreator
- the class used to create edges for this network- Returns:
- the created network.
-