Class MatrixNetworkLoader<T>
- java.lang.Object
-
- repast.simphony.context.space.graph.MatrixNetworkLoader<T>
-
- All Implemented Interfaces:
NetworkGenerator
- Direct Known Subclasses:
DLNetworkLoader
,ExcelNetworkLoader
public abstract class MatrixNetworkLoader<T> extends Object implements NetworkGenerator
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
Constructors Constructor Description MatrixNetworkLoader(Context context, InputStream stream, Class agentClass, int matrixIndex)
MatrixNetworkLoader(Context context, InputStream stream, NodeCreator<T> nodeCreator, int matrixIndex)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Network
createNetwork(Network network)
Creates edges using the nodes in the specified network.protected abstract NetworkMatrixReader
getMatrixReader(InputStream stream)
-
-
-
Constructor Detail
-
MatrixNetworkLoader
public MatrixNetworkLoader(Context context, InputStream stream, Class agentClass, int matrixIndex)
-
MatrixNetworkLoader
public MatrixNetworkLoader(Context context, InputStream stream, NodeCreator<T> nodeCreator, int matrixIndex)
-
-
Method Detail
-
getMatrixReader
protected abstract NetworkMatrixReader getMatrixReader(InputStream stream) throws IOException
- Throws:
IOException
-
createNetwork
public Network createNetwork(Network network)
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
-
-