From 56367402d76998e8ba70eb0c0cfae5a2435c52d4 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Sun, 5 Oct 2025 22:39:26 -0400 Subject: [PATCH] Move intrinEventInd()s from MarionetteComponent=>Director --- smocore/CMakeLists.txt | 3 ++ smocore/director/director.cpp | 40 +++++++++++++++++++++++++ smocore/include/director/director.h | 4 +++ smocore/include/marionette/marionette.h | 4 --- smocore/marionette/lifetime.cpp | 4 +++ smocore/marionette/negtrinEvent.cpp | 5 ---- 6 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 smocore/director/director.cpp diff --git a/smocore/CMakeLists.txt b/smocore/CMakeLists.txt index 62a4144..6da8833 100644 --- a/smocore/CMakeLists.txt +++ b/smocore/CMakeLists.txt @@ -14,6 +14,9 @@ add_library(smocore STATIC # Body body/body.cpp + # Director + director/director.cpp + # Marionette marionette/main.cpp marionette/salmanoff.cpp diff --git a/smocore/director/director.cpp b/smocore/director/director.cpp new file mode 100644 index 0000000..d95a3db --- /dev/null +++ b/smocore/director/director.cpp @@ -0,0 +1,40 @@ +#include +#include +#include + +namespace smo { +namespace director { + +void Director::negtrinEventInd(void) +{ + /** EXPLANATION: + * The essence of a negtrin event, to Director is that it generates a new Goal + * object and enqueues it onto the Director's negtrins queue. It's this auto-goal + * generation that gives negtrins their intrinsic undesirability. + * + * We don't sample the negtrin, evaluate it and then conclude that it's + * undesirable. We don't even produce a negative value judgment. We skip + * right past both the evaluation and the value judgment production and + * just generate the goal immediately. + * + * I'm unsure whether this is correct: it may well be that we ought to + * simply produce a negative value judgment and then let the Director + * create a goal to alleviate the negtrin. + * + * At any rate, for now, this is our implementation. + */ + std::cout << __func__ << ": Handling negtrin event." << std::endl; +} + +void Director::intrinEventInd(void) +{ + std::cout << __func__ << ": Handling intrin event." << std::endl; +} + +void Director::postrinEventInd(void) +{ + std::cout << __func__ << ": Handling postrin event." << std::endl; +} + +} // namespace director +} // namespace smo diff --git a/smocore/include/director/director.h b/smocore/include/director/director.h index 6652c4e..d5a79a3 100644 --- a/smocore/include/director/director.h +++ b/smocore/include/director/director.h @@ -23,6 +23,10 @@ public: ~Director() = default; + void negtrinEventInd(void); + void intrinEventInd(void); + void postrinEventInd(void); + /** EXPLANATION: * We allow SMO to prioritize negtrins over injected goals, so that it can * prioritize pain mitigation. We may decide to change this in the future. diff --git a/smocore/include/marionette/marionette.h b/smocore/include/marionette/marionette.h index 2468d09..79a55a5 100644 --- a/smocore/include/marionette/marionette.h +++ b/smocore/include/marionette/marionette.h @@ -24,10 +24,6 @@ public: void initializeReq(Callback callback); void finalizeReq(Callback callback); - void intrinEventInd(void); - void negtrinEventInd(void); - void postrinEventInd(void); - private: class MrnttLifetimeMgmtOp; }; diff --git a/smocore/marionette/lifetime.cpp b/smocore/marionette/lifetime.cpp index e45be15..87b4460 100644 --- a/smocore/marionette/lifetime.cpp +++ b/smocore/marionette/lifetime.cpp @@ -58,6 +58,10 @@ public: } device::DeviceManager::getInstance().initializeDeviceReattacher(); + + // Call negtrinEventInd on the Director in the final callback + smo::mind::globalMind->director.negtrinEventInd(); + context->callOriginalCb(success); } diff --git a/smocore/marionette/negtrinEvent.cpp b/smocore/marionette/negtrinEvent.cpp index 1c0b441..eba0a6b 100644 --- a/smocore/marionette/negtrinEvent.cpp +++ b/smocore/marionette/negtrinEvent.cpp @@ -7,10 +7,5 @@ namespace smo { namespace mrntt { -void MarionetteComponent::negtrinEventInd(void) -{ - std::cout << __func__ << ": Handling negtrin event." << std::endl; -} - } // namespace mrntt } // namespace smo