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
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "Counter". | string | |
name | The name of this instance of the module. | string | |
mode | choices: component any | component | |
threshold | The threshold | float | 0.5 |
reset_interval | How often to reset the counter | int | 1000000 |
print_interval | How often to print the counter | int | 1000 |
count_interval | How often to update the counter | int | 1 |
Module Connections
Inputs
Name | Description |
---|---|
INPUT | The input |
Outputs
Name | Description |
---|---|
COUNT | The count |
PERCENT | The 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