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 theDefaultNetworkFactory
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 Summary
Fields Modifier and Type Field Description static String
DIRECTED_KEY
static String
EDGES_KEY
-
Fields inherited from class repast.simphony.freezedry.freezedryers.proj.ProjectionDryer
CONTEXT_LISTENING_KEY, NAME_KEY, PROJ_LISTENING_KEY
-
-
Constructor Summary
Constructors Constructor Description NetworkProjectionDryer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)).protected Object[]
getEdgeProps(RepastEdge edge)
boolean
handles(Class<?> type)
Returns true when the type could be casted toNetwork
.Network<?>
instantiate(Context<?> context, Map<String,Object> properties)
This instantiates the network using theDefaultNetworkFactory
, based on the network's name, and directedness (determined from the properties).protected void
loadEdges(Object[] edges, Network proj)
protected void
loadProperties(Context<?> context, Network<?> proj, Map<String,Object> properties)
Loads in the network's edges.-
Methods inherited from class repast.simphony.freezedry.freezedryers.proj.ProjectionDryer
addProjectionDryer, buildAndAddProjection, getDryer, getProperties
-
-
-
-
Field Detail
-
DIRECTED_KEY
public static final String DIRECTED_KEY
- See Also:
- Constant Field Values
-
EDGES_KEY
public static final String EDGES_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 classProjectionDryer<Network<?>>
- Parameters:
context
- the context the network is a member ofnet
- the network itselfmap
- 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 theDefaultNetworkFactory
, based on the network's name, and directedness (determined from the properties).- Specified by:
instantiate
in classProjectionDryer<Network<?>>
- Parameters:
context
- the context the network is a part ofproperties
- 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 classProjectionDryer<Network<?>>
- Parameters:
context
- ignoredproj
- the network edges will be loaded intoproperties
- the properties for the network
-
handles
public boolean handles(Class<?> type)
Returns true when the type could be casted toNetwork
.- Specified by:
handles
in classProjectionDryer<Network<?>>
- Parameters:
type
- the type of the projection- Returns:
- if the implementation handles the given type
- See Also:
Class.isAssignableFrom(java.lang.Class)
-
-