Class MatrixNetworkLoader<T>
java.lang.Object
repast.simphony.context.space.graph.MatrixNetworkLoader<T>
- All Implemented Interfaces:
NetworkGenerator
- Direct Known Subclasses:
DLNetworkLoader
,ExcelNetworkLoader
Network generator that loads a network from a file.
This will create the correct number of nodes, add
those to a context and then create the correct topology.
- Author:
- Nick Collier
-
Constructor Summary
ConstructorDescriptionMatrixNetworkLoader
(Context context, InputStream stream, Class agentClass, int matrixIndex) MatrixNetworkLoader
(Context context, InputStream stream, NodeCreator<T> nodeCreator, int matrixIndex) -
Method Summary
Modifier and TypeMethodDescriptioncreateNetwork
(Network network) Creates edges using the nodes in the specified network.protected abstract NetworkMatrixReader
getMatrixReader
(InputStream stream)
-
Constructor Details
-
MatrixNetworkLoader
-
MatrixNetworkLoader
public MatrixNetworkLoader(Context context, InputStream stream, NodeCreator<T> nodeCreator, int matrixIndex)
-
-
Method Details
-
getMatrixReader
- Throws:
IOException
-
createNetwork
Creates edges using the nodes in the specified network. The semantics of edge creation is determined by implementing classes.- Specified by:
createNetwork
in interfaceNetworkGenerator<T>
- Parameters:
network
- a network containing nodes- Returns:
- the generated network
-