chore: move magic numbers to env and cleanup
This commit is contained in:
@@ -18,6 +18,7 @@ from control_backend.agents.bdi.agentspeak_ast import (
|
||||
StatementType,
|
||||
TriggerType,
|
||||
)
|
||||
from control_backend.core.config import settings
|
||||
from control_backend.schemas.program import (
|
||||
BaseGoal,
|
||||
BasicNorm,
|
||||
@@ -524,6 +525,7 @@ class AgentSpeakGenerator:
|
||||
:return: The corresponding AgentSpeak statement.
|
||||
"""
|
||||
match step:
|
||||
# Note that SpeechAction gets included in the ACHIEVE_GOAL, since it's a goal internally
|
||||
case Goal() | SpeechAction() | LLMAction() as a:
|
||||
return AstStatement(StatementType.ACHIEVE_GOAL, self._astify(a))
|
||||
case GestureAction() as a:
|
||||
@@ -560,7 +562,12 @@ class AgentSpeakGenerator:
|
||||
subgoals.append(step)
|
||||
|
||||
# Arbitrary wait for UI to display nicely
|
||||
body.append(AstStatement(StatementType.DO_ACTION, AstLiteral("wait", [AstNumber(2000)])))
|
||||
body.append(
|
||||
AstStatement(
|
||||
StatementType.DO_ACTION,
|
||||
AstLiteral("wait", [AstNumber(settings.behaviour_settings.trigger_time_to_wait)]),
|
||||
)
|
||||
)
|
||||
|
||||
body.append(
|
||||
AstStatement(
|
||||
|
||||
@@ -75,7 +75,7 @@ class BDIProgramManager(BaseAgent):
|
||||
|
||||
asl_str = asg.generate(program)
|
||||
|
||||
file_name = "src/control_backend/agents/bdi/agentspeak.asl"
|
||||
file_name = settings.behaviour_settings.agentspeak_file
|
||||
|
||||
with open(file_name, "w") as f:
|
||||
f.write(asl_str)
|
||||
|
||||
Reference in New Issue
Block a user