OutputFile
Module used for writing numerical data to a text file. The data is represented in the
file as a number of columns given names in a header. The first column is called "T"
and contains the time (in ticks) when the row was written. All other columns in the
output file are defined in the XML file.
The following example shows how the header describes the number of'
columns in each output column and its name. The file could have been
produced by the above module definition if the input vector to "X" had one
value and the input to "Y" had two values.
As default there are four decimals in each column. This can be changed with the decimals attribute:
Here, the attribute decimals in the module tag sets the default decimals to none for all columns. This is changed locally for column Y where 2 decimals are used. The example above will now become:
Example XML definitions
<module
class = "OutputFile"
name = "OUT"
filename = "data.txt"
>
<column name = "X" />
<column name = "Y" />
</module>
T/1 X/1 Y/2
0 2.0000 12.0000 5.0102
1 31.0000 5.4000 10.4321
:
:
<module
class = "OutputFile"
name = "OUT"
filename = "data.txt"
decimals = "0"
>
<column name = "X" />
<column name = "Y" decimals = "2" />
</module>
T/1 X/1 Y/2
0 2 12.00 5.01
1 31 5.40 10.43
:
:
Example XML definition
Example
<module class = "OutputFile" name = "OutputFile" filename = "data.txt" />
Parameters
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "OutputFile". | string | |
name | The name of this instance of the module. | string | |
filename | File to write the data to. The name may intclude a %d to automatcially enumerate sequences of files. | string | output.txt |
decimals | Number of decimals for all columns | int | 4 |
timestamp | Include time stamp column (T) in file | bool | yes |
directory | Create a new directory for the files each time Ikaros is started using this directory name with a number is added. | string | |
column | Definition of a column in the output file; name attribute sets the name of the column; decimals sets the number decimals of this column | element |
Module Connections
Inputs
Name | Description |
---|---|
NEWFILE | If connected, a 1 on the input will close the current file, increase the file number (if %d is in the name) and open a new file. |
WRITE | If connected, data will only be written to the file when this input is 1 |
* | The module can have any number of inputs; each will generate a column in the output |
Author
Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science
Files
OutputFile.h
OutputFile.cc
OutputFile.ikc