CumulativeSum
Inputs: i1
Outputs: o1
Emits the cumulative sum of the messages values that have passed through it.
The CumulativeSum
operator does not hold a message buffer on i1
, so it emits a message containing the the cumulative sum of the messages values it has received on i1
through o1
right after it received a message on i1
.
Parameters
id: The id of the operator
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, CumulativeSum } from "@rtbot-dev/rtbot";
const id = "id";
const program = new Program();
program.addOperator(new CumulativeSum(id));
import rtbot as rb
id = "id";
program = rb.Program()
program.addOperator(rb.CumulativeSum(id))
#include "rtbot/CumulativeSum.h"
auto id = "id";
auto op = CumulativeSum<std::uint64_t, double>(id)
# minimal RtBot program
operators:
- type: CumulativeSum
id: "id"
{
"operators": [
{ "type": "CumulativeSum", "id": "id" }
]
}