Refactor body-related classes and add new interoceptor functionality
This commit is contained in:
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/core/include",
|
||||
"/usr/include",
|
||||
"/usr/local/include"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/g++",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"cstdint": "cpp"
|
||||
}
|
||||
}
|
||||
+41
-3
@@ -99,7 +99,8 @@ CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_harikoff_OBJECTS = harikoff-main.$(OBJEXT)
|
||||
am_harikoff_OBJECTS = harikoff-main.$(OBJEXT) \
|
||||
harikoff-painfulQuale.$(OBJEXT) harikoff-mind.$(OBJEXT)
|
||||
harikoff_OBJECTS = $(am_harikoff_OBJECTS)
|
||||
harikoff_LDADD = $(LDADD)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
@@ -117,7 +118,9 @@ am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/harikoff-main.Po
|
||||
am__depfiles_remade = ./$(DEPDIR)/harikoff-main.Po \
|
||||
./$(DEPDIR)/harikoff-mind.Po \
|
||||
./$(DEPDIR)/harikoff-painfulQuale.Po
|
||||
am__mv = mv -f
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
@@ -241,6 +244,7 @@ localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
num_sensors = @num_sensors@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
@@ -255,7 +259,7 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
harikoff_SOURCES = main.cpp
|
||||
harikoff_SOURCES = main.cpp painfulQuale.cpp mind.cpp
|
||||
harikoff_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/core/include
|
||||
all: all-am
|
||||
|
||||
@@ -344,6 +348,8 @@ distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/harikoff-main.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/harikoff-mind.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/harikoff-painfulQuale.Po@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@@ -379,6 +385,34 @@ harikoff-main.obj: main.cpp
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o harikoff-main.obj `if test -f 'main.cpp'; then $(CYGPATH_W) 'main.cpp'; else $(CYGPATH_W) '$(srcdir)/main.cpp'; fi`
|
||||
|
||||
harikoff-painfulQuale.o: painfulQuale.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT harikoff-painfulQuale.o -MD -MP -MF $(DEPDIR)/harikoff-painfulQuale.Tpo -c -o harikoff-painfulQuale.o `test -f 'painfulQuale.cpp' || echo '$(srcdir)/'`painfulQuale.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/harikoff-painfulQuale.Tpo $(DEPDIR)/harikoff-painfulQuale.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='painfulQuale.cpp' object='harikoff-painfulQuale.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o harikoff-painfulQuale.o `test -f 'painfulQuale.cpp' || echo '$(srcdir)/'`painfulQuale.cpp
|
||||
|
||||
harikoff-painfulQuale.obj: painfulQuale.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT harikoff-painfulQuale.obj -MD -MP -MF $(DEPDIR)/harikoff-painfulQuale.Tpo -c -o harikoff-painfulQuale.obj `if test -f 'painfulQuale.cpp'; then $(CYGPATH_W) 'painfulQuale.cpp'; else $(CYGPATH_W) '$(srcdir)/painfulQuale.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/harikoff-painfulQuale.Tpo $(DEPDIR)/harikoff-painfulQuale.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='painfulQuale.cpp' object='harikoff-painfulQuale.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o harikoff-painfulQuale.obj `if test -f 'painfulQuale.cpp'; then $(CYGPATH_W) 'painfulQuale.cpp'; else $(CYGPATH_W) '$(srcdir)/painfulQuale.cpp'; fi`
|
||||
|
||||
harikoff-mind.o: mind.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT harikoff-mind.o -MD -MP -MF $(DEPDIR)/harikoff-mind.Tpo -c -o harikoff-mind.o `test -f 'mind.cpp' || echo '$(srcdir)/'`mind.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/harikoff-mind.Tpo $(DEPDIR)/harikoff-mind.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mind.cpp' object='harikoff-mind.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o harikoff-mind.o `test -f 'mind.cpp' || echo '$(srcdir)/'`mind.cpp
|
||||
|
||||
harikoff-mind.obj: mind.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT harikoff-mind.obj -MD -MP -MF $(DEPDIR)/harikoff-mind.Tpo -c -o harikoff-mind.obj `if test -f 'mind.cpp'; then $(CYGPATH_W) 'mind.cpp'; else $(CYGPATH_W) '$(srcdir)/mind.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/harikoff-mind.Tpo $(DEPDIR)/harikoff-mind.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mind.cpp' object='harikoff-mind.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(harikoff_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o harikoff-mind.obj `if test -f 'mind.cpp'; then $(CYGPATH_W) 'mind.cpp'; else $(CYGPATH_W) '$(srcdir)/mind.cpp'; fi`
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
@@ -506,6 +540,8 @@ clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/harikoff-main.Po
|
||||
-rm -f ./$(DEPDIR)/harikoff-mind.Po
|
||||
-rm -f ./$(DEPDIR)/harikoff-painfulQuale.Po
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
@@ -552,6 +588,8 @@ installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f ./$(DEPDIR)/harikoff-main.Po
|
||||
-rm -f ./$(DEPDIR)/harikoff-mind.Po
|
||||
-rm -f ./$(DEPDIR)/harikoff-painfulQuale.Po
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
|
||||
@@ -9,16 +9,17 @@ class AttentionGrabber
|
||||
{
|
||||
public:
|
||||
AttentionGrabber(AttentionTrigger cause, Chronomenon chron)
|
||||
: isNull(false)
|
||||
{}
|
||||
: isNull(false)
|
||||
{
|
||||
}
|
||||
|
||||
void setNull(void) { isNull = true; }
|
||||
int operator!(void) { return isNull; }
|
||||
|
||||
public:
|
||||
AttentionTrigger cause;
|
||||
Chronomenon chron;
|
||||
bool isNull;
|
||||
AttentionTrigger cause;
|
||||
Chronomenon chron;
|
||||
bool isNull;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef _BODY_MAP_H
|
||||
#define _BODY_MAP_H
|
||||
|
||||
#include <set>
|
||||
#include <cstdint>
|
||||
|
||||
#include <body/limb.h>
|
||||
|
||||
class BodyMap {
|
||||
public:
|
||||
BodyMap() = default;
|
||||
~BodyMap() = default;
|
||||
|
||||
std::set<uint32_t, BodyLimb> limbs;
|
||||
};
|
||||
|
||||
#endif // _BODY_MAP_H
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef BODY_MESSAGE_H
|
||||
#define BODY_MESSAGE_H
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
#include <body/limb.h>
|
||||
#include <body/bodyPart.h>
|
||||
|
||||
class BodyMessage
|
||||
{
|
||||
public:
|
||||
BodyMessage() = default;
|
||||
~BodyMessage() = default;
|
||||
};
|
||||
|
||||
class BodySpotImpactEntry
|
||||
{
|
||||
public:
|
||||
enum class ReportType
|
||||
{
|
||||
PRESSURE,
|
||||
PAIN,
|
||||
PLEASURE,
|
||||
HEAT,
|
||||
COLD
|
||||
};
|
||||
|
||||
BodySpotImpactEntry(uint32_t _spot, ReportType _type, uint32_t _value)
|
||||
: spot(_spot), type(_type), value(_value)
|
||||
{}
|
||||
~BodySpotImpactEntry() = default;
|
||||
|
||||
public:
|
||||
uint32_t spot;
|
||||
ReportType type;
|
||||
uint32_t value;
|
||||
};
|
||||
|
||||
class BodySpotImpactInd
|
||||
: public BodyMessage
|
||||
{
|
||||
public:
|
||||
BodySpotImpactInd(BodyPart &_part) : part(_part) {}
|
||||
~BodySpotImpactInd() = default;
|
||||
|
||||
public:
|
||||
BodyPart ∂
|
||||
std::vector<BodySpotImpactEntry> entries;
|
||||
};
|
||||
|
||||
class BodyPartMsg
|
||||
: public BodyMessage
|
||||
{
|
||||
public:
|
||||
BodyPartMsg(const BodyPart& _part)
|
||||
:part(_part)
|
||||
{}
|
||||
|
||||
public:
|
||||
const BodyPart& part;
|
||||
};
|
||||
|
||||
#endif // BODY_MESSAGE_H
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef BODYPART_H
|
||||
#define BODYPART_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
#include <sensors/interoceptor.h>
|
||||
|
||||
class BodySpot
|
||||
{
|
||||
public:
|
||||
BodySpot(uint32_t _id, std::string _description)
|
||||
: id(_id), description(_description)
|
||||
{}
|
||||
|
||||
~BodySpot() = default;
|
||||
|
||||
public:
|
||||
uint32_t id;
|
||||
std::string description;
|
||||
std::set<uint32_t, Interoceptor> interoceptors;
|
||||
};
|
||||
|
||||
class BodyPart
|
||||
{
|
||||
public:
|
||||
BodyPart(uint32_t _partId, std::string _partName,
|
||||
std::string _partDesc, std::string _partLoc)
|
||||
: id(_partId), name(_partName),
|
||||
description(_partDesc), location(_partLoc)
|
||||
{}
|
||||
|
||||
~BodyPart() = default;
|
||||
|
||||
public:
|
||||
const uint32_t id;
|
||||
std::string name, description, location;
|
||||
std::set<uint32_t, BodySpot> spots;
|
||||
};
|
||||
|
||||
#endif // BODYPART_H
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef BODY_LIMB_H
|
||||
#define BODY_LIMB_H
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <cstdint>
|
||||
|
||||
#include <body/bodyPart.h>
|
||||
|
||||
class BodyLimb
|
||||
{
|
||||
public:
|
||||
BodyLimb(uint32_t _id) : id(_id) {}
|
||||
BodyLimb(uint32_t _id,
|
||||
const std::string& _name, const std::string& _desc,
|
||||
const std::string& _loc)
|
||||
: id(_id), name(_name), description(_desc), location(_loc)
|
||||
{}
|
||||
|
||||
~BodyLimb() = default;
|
||||
|
||||
public:
|
||||
uint32_t id;
|
||||
std::string name, description, location;
|
||||
std::set<uint32_t, BodyPart> parts;
|
||||
};
|
||||
|
||||
#endif // BODY_LIMB_H
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef _BODY_LOCUS_H
|
||||
#define _BODY_LOCUS_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class BodyCoords
|
||||
{
|
||||
uint32_t segment;
|
||||
uint32_t coord;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
#ifndef _INTEROCEPTOR_H
|
||||
#define _INTEROCEPTOR_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class Interoceptor {
|
||||
public:
|
||||
Interoceptor(uint32_t _id, uint32_t _value = 0)
|
||||
: id(_id), value(_value)
|
||||
{}
|
||||
~Interoceptor() = default;
|
||||
|
||||
public:
|
||||
uint32_t id, value;
|
||||
};
|
||||
|
||||
class NeutralInteroceptor
|
||||
: public Interoceptor {
|
||||
public:
|
||||
NeutralInteroceptor(uint32_t _id, uint32_t _value = 0)
|
||||
: Interoceptor(_id, _value)
|
||||
{}
|
||||
};
|
||||
|
||||
class IntrinInteroceptor
|
||||
: public Interoceptor {
|
||||
public:
|
||||
static constexpr uint32_t DEFAULT_INDICATION_THRESHOLD = 1;
|
||||
static constexpr uint32_t DEFAULT_ALERT_THRESHOLD = 5;
|
||||
static constexpr uint32_t DEFAULT_OVERLOAD_THRESHOLD = 9;
|
||||
|
||||
IntrinInteroceptor(
|
||||
uint32_t _id,
|
||||
uint32_t _value = 0,
|
||||
uint32_t _indicationThreshold = DEFAULT_INDICATION_THRESHOLD,
|
||||
uint32_t _alertThreshold = DEFAULT_ALERT_THRESHOLD,
|
||||
uint32_t _overloadThreshold = DEFAULT_OVERLOAD_THRESHOLD)
|
||||
: Interoceptor(_id, _value),
|
||||
indicationThreshold(_indicationThreshold),
|
||||
alertThreshold(_alertThreshold),
|
||||
overloadThreshold(_overloadThreshold)
|
||||
{}
|
||||
|
||||
~IntrinInteroceptor() = default;
|
||||
|
||||
public:
|
||||
uint32_t indicationThreshold;
|
||||
uint32_t alertThreshold;
|
||||
uint32_t overloadThreshold;
|
||||
};
|
||||
|
||||
/**
|
||||
* Pain and pleasure interoceptors are specialized intrinsic interoceptors that, unlike
|
||||
* neutral interoceptors, have activation thresholds for different response levels
|
||||
* (indication, alert, and overload). These thresholds allow them to trigger graduated
|
||||
* responses based on stimulus intensity.
|
||||
*
|
||||
* While neutral interoceptors simply record a binary state or basic value, pain and
|
||||
* pleasure interoceptors can model complex sensory responses with multiple activation
|
||||
* levels, similar to biological pain/pleasure responses. Each threshold represents a
|
||||
* different level of urgency or intensity in the sensory input.
|
||||
*
|
||||
* @see IntrinInteroceptor for the threshold values and implementation details
|
||||
*****************************************************************************************/
|
||||
|
||||
class PainInteroceptor
|
||||
: public IntrinInteroceptor {
|
||||
public:
|
||||
PainInteroceptor(
|
||||
uint32_t _id,
|
||||
uint32_t _value = 0,
|
||||
uint32_t _indicationThreshold = DEFAULT_INDICATION_THRESHOLD,
|
||||
uint32_t _alertThreshold = DEFAULT_ALERT_THRESHOLD,
|
||||
uint32_t _overloadThreshold = DEFAULT_OVERLOAD_THRESHOLD)
|
||||
: IntrinInteroceptor(_id, _value, _indicationThreshold, _alertThreshold, _overloadThreshold)
|
||||
{}
|
||||
};
|
||||
|
||||
class PleasureInteroceptor
|
||||
: public IntrinInteroceptor {
|
||||
public:
|
||||
PleasureInteroceptor(
|
||||
uint32_t _id,
|
||||
uint32_t _value = 0,
|
||||
uint32_t _indicationThreshold = DEFAULT_INDICATION_THRESHOLD,
|
||||
uint32_t _alertThreshold = DEFAULT_ALERT_THRESHOLD,
|
||||
uint32_t _overloadThreshold = DEFAULT_OVERLOAD_THRESHOLD)
|
||||
: IntrinInteroceptor(_id, _value, _indicationThreshold, _alertThreshold, _overloadThreshold)
|
||||
{}
|
||||
};
|
||||
|
||||
#endif // _INTEROCEPTOR_H
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef STUPEFIER_H
|
||||
#define STUPEFIER_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class Stupefier {
|
||||
public:
|
||||
Stupefier();
|
||||
~Stupefier();
|
||||
|
||||
void up(uint32_t);
|
||||
void down(uint32_t);
|
||||
|
||||
public:
|
||||
uint32_t focus;
|
||||
};
|
||||
|
||||
class SoftStupefier : public Stupefier {
|
||||
public:
|
||||
SoftStupefier();
|
||||
~SoftStupefier();
|
||||
};
|
||||
|
||||
class HardStupefier : public Stupefier {
|
||||
public:
|
||||
HardStupefier();
|
||||
~HardStupefier();
|
||||
};
|
||||
|
||||
#endif // STUPEFIER_H
|
||||
Reference in New Issue
Block a user