From 4f4af19b1fb1765bd2bbfeb84447cbabb1a97c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Gonz=C3=A1lez=20Santamarta?= Date: Mon, 4 Nov 2024 17:38:17 +0100 Subject: [PATCH] setting validated to false when changing start state --- yasmin/src/yasmin/state_machine.cpp | 6 ++++-- yasmin/yasmin/state_machine.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/yasmin/src/yasmin/state_machine.cpp b/yasmin/src/yasmin/state_machine.cpp index 262db59..4b2678d 100644 --- a/yasmin/src/yasmin/state_machine.cpp +++ b/yasmin/src/yasmin/state_machine.cpp @@ -107,6 +107,9 @@ void StateMachine::set_start_state(std::string state_name) { YASMIN_LOG_DEBUG("Setting start state to '%s'", state_name.c_str()); this->start_state = state_name; + + // Mark state machine as no validated + this->validated.store(false); } std::string StateMachine::get_start_state() { return this->start_state; } @@ -354,8 +357,7 @@ std::string StateMachine::execute() { std::shared_ptr blackboard = std::make_shared(); - std::string outcome = this->operator()(blackboard); - return outcome; + return this->operator()(blackboard); } std::string StateMachine::operator()() { diff --git a/yasmin/yasmin/state_machine.py b/yasmin/yasmin/state_machine.py index a8a61e6..d89d4bf 100644 --- a/yasmin/yasmin/state_machine.py +++ b/yasmin/yasmin/state_machine.py @@ -147,6 +147,9 @@ def set_start_state(self, state_name: str) -> None: self._start_state: str = state_name + ## Mark state machine as no validated + self._validated = False + def get_start_state(self) -> str: """ Retrieves the name of the current starting state.