-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
As mentioned here, the VariableKiosk handles its own updates for external states. To make the architecture cleaner and more flexible (especially for ML), we want to move this responsibility to the Engine. This turns the Kiosk into a simple data container and lets the Engine orchestrate the data flow.
Proposed Change
Modify the Engine to accept an update_external_states function. This function will be called during initialization and at every simulation step.
class Engine:
def __init__(self, update_external_states, ...):
self.kiosk = VariableKiosk()
self.update_external_states = update_external_states
# Initial state update
if self.update_external_states:
self.update_external_states(self.start_date, self.kiosk)
def _run(self):
self.day, delt = self.timer()
# Update states at each timestep
if self.update_external_states:
self.update_external_states(self.day, self.kiosk)
# Continue with simulation...This will require the following modifications:
- Add
update_external_statesargument toEngine. - Implement the update calls in
__init__and_run. - Remove update logic from
VariableKiosk.__call__.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog