StandardDeviation
Inputs: i1
Outputs: o1
Computes the standard deviation (ED) within the time window specified by the provided integer (n).
The StandardDeviation
operator holds a message buffer on i1
with a size defined by the length of the provided integer (n). Once the message buffer on i1
gets filled it calculates the ED and emits a message through o1
right after the message buffer on i1
gets filled. The value field of the emitted message is the calculated ED and the time field is the time of the newest message on the buffer.
Parameters
id: The id of the operator
n: The number of grid steps to use to compute the standard deviation.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, StandardDeviation } from "@rtbot-dev/rtbot";
const id = "id";
const n = 20;
const program = new Program();
program.addOperator(new StandardDeviation(id, n));
import rtbot as rb
id = "id";
n = 20;
program = rb.Program()
program.addOperator(rb.StandardDeviation(id, n))
#include "rtbot/StandardDeviation.h"
auto id = "id";
auto n = 20;
auto op = StandardDeviation<std::uint64_t, double>(id, n)
# minimal RtBot program
operators:
- type: StandardDeviation
id: "id"
n: 20
{
"operators": [
{ "type": "StandardDeviation", "id": "id", "n": 20 }
]
}