Class NetworkProjectionDryer

java.lang.Object
repast.simphony.freezedry.freezedryers.proj.ProjectionDryer<Network<?>>
repast.simphony.freezedry.freezedryers.proj.NetworkProjectionDryer

public class NetworkProjectionDryer extends ProjectionDryer<Network<?>>
A class that handles Networks. This uses the DefaultNetworkFactory to create directed or undirected networks (based on the network's type). This stores the directedness of the network and its edges (including the edge weights).
Author:
Jerry Vos
  • Field Details

  • Constructor Details

    • NetworkProjectionDryer

      public NetworkProjectionDryer()
  • Method Details

    • addProperties

      protected void addProperties(Context<?> context, Network<?> net, Map<String,Object> map)
      Stores the network's directedness and edges (each edges as a tuple of (source, target, weight)).
      Specified by:
      addProperties in class ProjectionDryer<Network<?>>
      Parameters:
      context - the context the network is a member of
      net - the network itself
      map - the destination for the properties
    • getEdgeProps

      protected Object[] getEdgeProps(RepastEdge edge)
    • instantiate

      public Network<?> instantiate(Context<?> context, Map<String,Object> properties)
      This instantiates the network using the DefaultNetworkFactory, based on the network's name, and directedness (determined from the properties).
      Specified by:
      instantiate in class ProjectionDryer<Network<?>>
      Parameters:
      context - the context the network is a part of
      properties - the properties of the network
      Returns:
      a created projection
    • loadProperties

      protected void loadProperties(Context<?> context, Network<?> proj, Map<String,Object> properties)
      Loads in the network's edges.
      Overrides:
      loadProperties in class ProjectionDryer<Network<?>>
      Parameters:
      context - ignored
      proj - the network edges will be loaded into
      properties - the properties for the network
    • loadEdges

      protected void loadEdges(Object[] edges, Network proj)
    • handles

      public boolean handles(Class<?> type)
      Returns true when the type could be casted to Network.
      Specified by:
      handles in class ProjectionDryer<Network<?>>
      Parameters:
      type - the type of the projection
      Returns:
      if the implementation handles the given type
      See Also: