Class DefaultNetworkFactory

java.lang.Object
repast.simphony.context.space.graph.DefaultNetworkFactory
All Implemented Interfaces:
NetworkFactory

public class DefaultNetworkFactory extends Object implements NetworkFactory
Factory for creating networks.
Version:
$Revision$ $Date$
Author:
Nick Collier
  • Constructor Details

    • DefaultNetworkFactory

      protected DefaultNetworkFactory()
  • Method Details

    • createNetwork

      public <T> Network<T> createNetwork(String netName, Context<T> context, 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 with Context.getProjection(networkName). If a network with the specified name has already been created, that already created network will be returned.
      Specified by:
      createNetwork in interface NetworkFactory
      Parameters:
      netName - the name of the network
      context - the context of which the network will be a projection
      isDirected - 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 with Context.getProjection(networkName). If a network with the specified name has already been created, that already created network will be returned.
      Specified by:
      createNetwork in interface NetworkFactory
      Parameters:
      netName - the name of the network
      context - the context of which the network will be a projection
      isDirected - whether or not the network should be directed
      generator - 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 with Context.getProjection(networkName). If a network with the specified name has already been created, that already created network will be returned.
      Specified by:
      createNetwork in interface NetworkFactory
      Parameters:
      netName - the name of the network
      context - the context of which the network will be a projection
      isDirected - whether or not the network should be directed
      generator - used to create the initial network topology. Note that there must be enough objects in the context to create the topology
      edgeCreator - 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 with Context.getProjection(networkName). If a network with the specified name has already been created, that already created network will be returned.
      Specified by:
      createNetwork in interface NetworkFactory
      Parameters:
      netName - the name of the network
      context - the context of which the network will be a projection
      isDirected - whether or not the network should be directed
      edgeCreator - the class used to create edges for this network
      Returns:
      the created network.