Context¶
- class Context(node_id: int, node_config: dict[str, bool | float | int | str], state: RecordSet, run_config: dict[str, bool | float | int | str])[source]¶
Bases:
object
Context of your run.
- 参数:
node_id (int) -- The ID that identifies the node.
node_config (UserConfig) -- A config (key/value mapping) unique to the node and independent of the run_config. This config persists across all runs this node participates in.
state (RecordSet) -- Holds records added by the entity in a given run and that will stay local. This means that the data it holds will never leave the system it's running from. This can be used as an intermediate storage or scratchpad when executing mods. It can also be used as a memory to access at different points during the lifecycle of this entity (e.g. across multiple rounds)
run_config (UserConfig) -- A config (key/value mapping) held by the entity in a given run and that will stay local. It can be used at any point during the lifecycle of this entity (e.g. across multiple rounds)
Methods
Attributes
node_id
node_config
state
run_config