FrostMachine
Reactor
The FrostMachine
reactor is a composite component that combines the functionalities of FrostDataModel
and FrostReactor
. It is designed to serve as a base for creating "machine" actors in the Frost ecosystem—components that represent the physical or logical parts of a cyber-physical system, complete with their own state (data model) and communication capabilities.
Core Functionalities
- Inheritance: It inherits from both
FrostDataModel
andFrostReactor
, giving it the combined capabilities of both. This means it can manage a data model, connect to theFrostBus
, and handle messages according to the Frost protocol. - Update Step: It introduces an
update_step
parameter, which can be used to define a time step for periodic updates within the machine. This is useful for simulations or for components that need to perform actions at regular intervals.
What You Can Do with a FrostMachine
A FrostMachine
is the primary building block for creating digital twins or simulated components in the Frost ecosystem. By extending this reactor, you can:
-
Model System Components: Represent any physical or logical part of your system, such as a machine, sensor, or software service. The component's state is defined in its data model, including parameters, sensor readings, and operational status.
-
Implement Dynamic Behavior: Use timers and reactions to simulate the component's behavior over time. This allows you to model time-based processes, state transitions, and the core logic of the component's operation.
-
Expose behavior: Expose methods through the data model that other components can invoke. By implementing these methods as callbacks, you create a clear and well-defined interface for your machine, enabling other parts of the system to interact with it.
-
Orchestrate Complex Interactions: A
FrostMachine
can act as a client to other components. It can send messages to read or write variables in other data models or invoke their methods, allowing for complex, system-level workflows and interactions. -
React to External Events: Handle incoming messages to react to commands or data from other parts of the system. This allows a
FrostMachine
to be controlled or influenced by external actors or other machines, making it a dynamic participant in the overall system.