Counter

Module used to calculate statistics from signals in a simulation. It counts how many times its input is above a threshold. It also outputs the percent of the ticks the input has been above the threshold. In "component" mode, each input component is counted individually. In "any" mode, any component above the threshold is counted. In "component" mode, the outputs have the same size as the input, while in "any" mode, the output has size 1. The counter can be set up to periodically reset the counter and/or print the count. It is also possible to specify how often the counter checks its input. NOTE: Only "any" mode has been implemented.

Example XML definition

Example

  <module
      class = "Counter"
      name = "Counter"
  />

Parameters

NameDescriptionTypeDefault
classThe class name for the module; must be "Counter".string
nameThe name of this instance of the module.string
modechoices:
component
any
component
thresholdThe thresholdfloat0.5
reset_intervalHow often to reset the counterint1000000
print_intervalHow often to print the counterint1000
count_intervalHow often to update the counterint1

Module Connections

Inputs

NameDescription
INPUTThe input

Outputs

NameDescription
COUNTThe count
PERCENTThe counter divided with the number of ticks

Bugs

Only runs in "any" mode at the moment.

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

Counter.h
Counter.cc
Counter.ikc

blog comments powered by Disqus