Scale
Inputs: i1
Outputs: o1
Scales the message value using the provided number (value) as coefficient regardless the time field of the message.
The Scale
operator does not hold a message buffer on i1
, so it emits a modified version of the message through o1
right after it receives a message on i1
.
Parameters
id: The id of the operator
value: The factor to use to scale the messages.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Scale } from "@rtbot-dev/rtbot";
const id = "id";
const value = 2.71;
const program = new Program();
program.addOperator(new Scale(id, value));
import rtbot as rb
id = "id";
value = 2.71;
program = rb.Program()
program.addOperator(rb.Scale(id, value))
#include "rtbot/Scale.h"
auto id = "id";
auto value = 2.71;
auto op = Scale<std::uint64_t, double>(id, value)
# minimal RtBot program
operators:
- type: Scale
id: "id"
value: 2.71
{
"operators": [
{ "type": "Scale", "id": "id", "value": 2.71 }
]
}