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.

Example XML definitions

  <module
    class = "OutputFile"
    name = "OUT"
    filename = "data.txt"
  >
    <column name = "X" />  
    <column name = "Y" />  
  </module>

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.

  T/1  X/1       Y/2
  0     2.0000   12.0000     5.0102
  1    31.0000    5.4000    10.4321
   :
   :

As default there are four decimals in each column. This can be changed with the decimals attribute:

  <module
    class = "OutputFile"
    name = "OUT"
    filename = "data.txt"
    decimals = "0"
  >
    <column name = "X" />  
    <column name = "Y" decimals = "2" />  
  </module>

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:

  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

NameDescriptionTypeDefault
classThe class name for the module; must be "OutputFile".string
nameThe name of this instance of the module.string
filenameFile to write the data to. The name may intclude a %d to automatcially enumerate sequences of files.stringoutput.txt
decimalsNumber of decimals for all columnsint4
timestampInclude time stamp column (T) in fileboolyes
directoryCreate a new directory for the files each time Ikaros is started using this directory name with a number is added.string
columnDefinition of a column in the output file; name attribute sets the name of the column; decimals sets the number decimals of this columnelement

Module Connections

Inputs

NameDescription
NEWFILEIf 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.
WRITEIf 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

blog comments powered by Disqus