Output#
By default, trajectories.csv will be created in the output directory, with the realization index appended to each observable name in the file. If you prefer, you have the option of creating JSON or MATLAB files that contain the output of a simulation.
Parameter |
Data type |
Default |
Description |
---|---|---|---|
channeltitles |
bool |
false |
Specifies whether or not to populate the ChannelTitles array in JSON output files. If set to true, the entries of the ChannelTitles pair with the channel data in the ChannelData array. Each entry in ChannelTitles consists of an observable name followed by the realization number in curly braces, for example |
compress |
bool |
false |
Specifies whether or not CSV and JSON output files should be compressed using gzip or MATLAB .MAT files with internal compression. This can be useful for large data files. |
newmatformat |
bool |
false |
Specifies whether to use the original MATLAB schema or the new MATLAB schema. The original schema included four elements in the .MAT file:
The new schema has the same version and sampletimes elements, but combines the observables and data elements into observable1 through observableN (each entry is a matrix with rows equal to the umber of realizations and columns equal to the number of samples). |
prefix |
string |
trajectories |
Specifies the main name of the output files to be written, minus the file extension. |
writecsv |
bool |
true |
Specifies whether or not to write realization data in CSV format. |
writejson |
bool |
false |
Specifies whether or not to write realization data in JSON format. See any example of this type of output format Example. |
writematfile |
bool |
false |
Specifies whether or not to write realization data in MATLAB .mat format. |
writerealizationindex |
bool |
true |
Specifies whether or not to add a suffix with the realization index to each observable name in a CSV file. |
Example#
The example configuration file below shows one way you can configure CMS to create JSON output files.
{
"runs": 1,
"duration": 365,
"samples": 100,
"solver": "SSA",
"output": {
"prefix": "test_trajectories",
"writecsv": false,
"writejson": true,
"compress": false,
"channeltitles": true,
"writematfile": false,
"newmatformat": false
}
}
The test_trajectories.json file below shows the type of output you can expect from the example configuration file above.
{
"FrameworkVersion": "1.0.176.23",
"BuildDescription": "clorton (CMS/Main/framework)",
"Runs": 1,
"Samples": 100,
"ObservableNames": [
"susceptible",
"exposed",
"infectious",
"recovered"
],
"ChannelTitles": [
"susceptible{0}",
"exposed{0}",
"infectious{0}",
"recovered{0}"
],
"SampleTimes": [
0.0,
1.010101,
2.020202,
"etc.",
98.9899,
100.0
],
"ChannelData": [
[
990.0,
979.0,
974.0,
973.0,
"etc.",
281.0,
286.0
],
[
0.0,
11.0,
15.0,
14.0,
"etc.",
5.0,
3.0
],
[
10.0,
9.0,
8.0,
6.0,
"etc.",
6.0,
7.0
],
[
0.0,
1.0,
3.0,
7.0,
"etc.",
708.0,
704.0
]
],
"ObservablesCount": 4
}