The Big One #43
@@ -72,14 +72,8 @@ class UserInterruptAgent(BaseAgent):
|
|||||||
event_context,
|
event_context,
|
||||||
)
|
)
|
||||||
|
|
||||||
elif event_type == "next_phase":
|
elif event_type in ["next_phase", "reset_phase", "reset_experiment"]:
|
||||||
_ = 1
|
await self._send_experiment_control_to_bdi_core(event_type)
|
||||||
|
|
||||||
elif event_type == "reset_phase":
|
|
||||||
_ = 1
|
|
||||||
|
|
||||||
elif event_type == " reset_experiment":
|
|
||||||
_ = 1
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
@@ -89,12 +83,33 @@ class UserInterruptAgent(BaseAgent):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def _send_experiment_control_to_bdi_core(self, type):
|
async def _send_experiment_control_to_bdi_core(self, type):
|
||||||
|
"""
|
||||||
|
method to send experiment control buttons to bdi core.
|
||||||
|
|
||||||
|
:param type: the type of control button we should send to the bdi core.
|
||||||
|
"""
|
||||||
|
# Switch which thread we should send to bdi core
|
||||||
|
thread = ""
|
||||||
|
match type:
|
||||||
|
case "next_phase":
|
||||||
|
thread = "force_next_phase"
|
||||||
|
case "reset_phase":
|
||||||
|
thread = "reset_current_phase"
|
||||||
|
case "reset_experiment":
|
||||||
|
thread = "reset_experiment"
|
||||||
|
case _:
|
||||||
|
self.logger.warning(
|
||||||
|
"Received unknown experiment control type '%s' to send to BDI Core.",
|
||||||
|
type,
|
||||||
|
)
|
||||||
|
|
||||||
out_msg = InternalMessage(
|
out_msg = InternalMessage(
|
||||||
to=settings.agent_settings.bdi_core_name,
|
to=settings.agent_settings.bdi_core_name,
|
||||||
sender=self.name,
|
sender=self.name,
|
||||||
thread=type,
|
thread=thread,
|
||||||
body="",
|
body="",
|
||||||
)
|
)
|
||||||
|
self.logger.debug("Sending experiment control '%s' to BDI Core.", thread)
|
||||||
await self.send(out_msg)
|
await self.send(out_msg)
|
||||||
|
|
||||||
async def _send_to_speech_agent(self, text_to_say: str):
|
async def _send_to_speech_agent(self, text_to_say: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user