Class ExcelNetworkLoader
java.lang.Object
repast.simphony.context.space.graph.MatrixNetworkLoader
repast.simphony.context.space.graph.ExcelNetworkLoader
- All Implemented Interfaces:
NetworkGenerator
Loads a Network from an excel file.
?The matrix is assumed to be square.
Each worksheet is treated as a matrix, and any worksheets
that do not contain matrices will cause an error. The worksheet name
is treated as the matrix label unless the name begins with Sheet
(Excel's generic worksheet name). The format for excel files is that
imported and exported by UCINet. The first cell is empty, and the
node labels begin on this first row in the second column. The column
node labels begin in first column on the second row. The actual data
begins in cell 2,2. For example,
| first_label | second_label | ...
-------------+-------------+--------------+----
first_label | 0 | 1 | ...
-------------+-------------+--------------+----
second_label | 1 | 0 | ...
-------------+-------------+--------------+----
... | ... | ... | ...
If the matrix has no node labels, RePast will expect the first row and
column to be blank and as before, for the data to begin in cell 2,2.- Author:
- Nick Collier
-
Constructor Summary
ConstructorDescriptionExcelNetworkLoader
(Context context, InputStream stream, Class agentClass, int matrixIndex) ExcelNetworkLoader
(Context context, InputStream stream, NodeCreator nodeCreator, int matrixIndex) -
Method Summary
Modifier and TypeMethodDescriptionprotected NetworkMatrixReader
getMatrixReader
(InputStream stream) Methods inherited from class repast.simphony.context.space.graph.MatrixNetworkLoader
createNetwork
-
Constructor Details
-
ExcelNetworkLoader
-
ExcelNetworkLoader
public ExcelNetworkLoader(Context context, InputStream stream, NodeCreator nodeCreator, int matrixIndex)
-
-
Method Details
-
getMatrixReader
- Specified by:
getMatrixReader
in classMatrixNetworkLoader
- Throws:
IOException
-