LessThan
Inputs: i1
Outputs: o1
Emits only the messages received with a value less than the provided number (value) otherwise it emits an empty message {}.
The LessThan
operator does not hold a message buffer on i1
, so it emits a the message through o1
right after it receives a message on i1
but only if the received message value is less than the provided number (value) otherwise it emits an empty message {}.
Parameters
id: The id of the operator
value: The reference value
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, LessThan } from "@rtbot-dev/rtbot";
const id = "id";
const value = 2;
const program = new Program();
program.addOperator(new LessThan(id, value));
import rtbot as rb
id = "id";
value = 2;
program = rb.Program()
program.addOperator(rb.LessThan(id, value))
#include "rtbot/LessThan.h"
auto id = "id";
auto value = 2;
auto op = LessThan<std::uint64_t, double>(id, value)
# minimal RtBot program
operators:
- type: LessThan
id: "id"
value: 2
{
"operators": [
{ "type": "LessThan", "id": "id", "value": 2 }
]
}