Network Recorder

 Network Recorder

The network recorder component is used to record the simulated network as an adjacency matrix in one of three formats to a specified file. The actual network matrix is written out in the specified format, although relevant non-matrix information is recorded as well: a file header containing the constant parameters for the model and a timestamp; and a block header that contains header information relevant to the network data recorded beneath it. The block header will contain the value of any dynamic model parameters at the time a network was recorded and the current tick count.

The actual format of the file is thus:

file header

block_header_1
network data in the specified format

block_header_2
network data in the specified format

...

Note that you MUST schedule some actions in order for the Network Recorder to work. See the Schedule property below for details.

Appropriate Parent Component

Network Model. Network Recorder may be added only to a Network Model.

Properties

Properties are the items that appear in the property pane when you click on a component in the project tree. For more information on properties, see here.

Name     Description
File Name The name of the file to record the network to. The name itself must be in the format expected by your operating system.
Format The format of the recorded data. This can be one of three types.
  1. DL. UCINet dl format.

  2. Excel. UCINet excel spreadsheet format.

  3. ASCII. Records the matrix and the matrix labels in comma delimited plain text suitable for import in to Excel or UCINet.
Matrix Type The matrix type refers to a range of edge strengths recorded as values in the matrix cells, and can be one of three types.

  1. Binary. The edge strengths of the recorded network is 1 or 0 (presence or absence).

  2. Small. Strengths from -128 to 128.

  3. Large. Everything else.
You should always choose the smallest possible type.
Name The name of the recorder component. This name is used internally by Repast Py and should not contain any spaces. There is no real reason to change the default value. This name becomes a field in the model component.
Schedule See the schedule help and tutorial 3 for more information on the schedule property. The schedule property defines the execution schedule of any actions defined in your network recorder

Although there are no user-definable actions associated with the Network Recorder component, Repast Py implicitly defines two actions that you MUST schedule in order for recording to work. These two actions are:

  1. record. This records the current structure of the network at the time this action is executed.

  2. write. This writes whatever has been recorded by calls to the record action up until this point.

A typical execution scheme for the Network Recorder might have the record action schedule to execute at some small interval such as 5, executing last, and write executing at some larger interval such as 10 or 20, and also executing last. Its important to also schedule write and record to execute AT END in order to capture any new data created between the recording intervals.

Note that you can edit the relative order of your action executions in the master schedule property of your model component. By Doing so you can ensure that record and write are executed when you want them to relative to the rest of your simulation.