Move intrinEventInd()s from MarionetteComponent=>Director
This commit is contained in:
@@ -14,6 +14,9 @@ add_library(smocore STATIC
|
||||
# Body
|
||||
body/body.cpp
|
||||
|
||||
# Director
|
||||
director/director.cpp
|
||||
|
||||
# Marionette
|
||||
marionette/main.cpp
|
||||
marionette/salmanoff.cpp
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <iostream>
|
||||
#include <director/director.h>
|
||||
#include <goal.h>
|
||||
|
||||
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
|
||||
@@ -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.
|
||||
|
||||
@@ -24,10 +24,6 @@ public:
|
||||
void initializeReq(Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
||||
void finalizeReq(Callback<mrnttLifetimeMgmtOpCbFn> callback);
|
||||
|
||||
void intrinEventInd(void);
|
||||
void negtrinEventInd(void);
|
||||
void postrinEventInd(void);
|
||||
|
||||
private:
|
||||
class MrnttLifetimeMgmtOp;
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,5 @@
|
||||
namespace smo {
|
||||
namespace mrntt {
|
||||
|
||||
void MarionetteComponent::negtrinEventInd(void)
|
||||
{
|
||||
std::cout << __func__ << ": Handling negtrin event." << std::endl;
|
||||
}
|
||||
|
||||
} // namespace mrntt
|
||||
} // namespace smo
|
||||
|
||||
Reference in New Issue
Block a user