More wireframing

This commit is contained in:
2024-09-08 01:04:41 +10:00
parent 0ccb7e5542
commit e0b84fad0c
17 changed files with 242 additions and 18 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
bin_PROGRAMS = harikoff
harikoff_SOURCES = main.cpp
harikoff_SOURCES = main.cpp painfulQuale.cpp mind.cpp
harikoff_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/core/include
+15
View File
@@ -0,0 +1,15 @@
#ifndef _ASSOCIATION_H
#define _ASSOCIATION_H
#include <chronomenon.h>
#include <existent.h>
class Association
{
public:
Association(Quale quale, Chronomenon chron);
Association(Quale quale, Existent ex);
Association(Quale quale, Existent ex);
};
#endif
+24
View File
@@ -0,0 +1,24 @@
#ifndef _ATTENTION_GRABBER_H
#define _ATTENTION_GRABBER_H
#include <cstdbool>
#include <attentionTrigger.h>
#include <chronomenon.h>
class AttentionGrabber
{
public:
AttentionGrabber(AttentionTrigger cause, Chronomenon chron)
: isNull(false)
{}
void setNull(void) { isNull = true; }
int operator!(void) { return isNull; }
public:
AttentionTrigger cause;
Chronomenon chron;
bool isNull;
};
#endif
+7
View File
@@ -0,0 +1,7 @@
#ifndef _ATTENTION_TRIGGER_H
#define _ATTENTION_TRIGGER_H
class AttentionTrigger
{};
#endif
+30
View File
@@ -0,0 +1,30 @@
#ifndef _CHRONOMENON_H
#define _CHRONOMENON_H
#include <vector>
#include <qualeBundle.h>
#include <mentalEntity.h>
class Chronomenon
: public MentalEntity
{
public:
class Timestamp
{
uintptr_t value;
};
class Duration
{
uintptr_t value;
};
public:
Chronomenon extract(Timestamp start, Duration len);
public:
std::vector<QualeBundle> qualia;
};
#endif
+11
View File
@@ -0,0 +1,11 @@
#ifndef _CONCEPT_H
#define _CONCEPT_H
#include <mentalEntity.h>
class Concept
: public MentalEntity
{
};
#endif
+11
View File
@@ -0,0 +1,11 @@
#ifndef _EXISTENT_H
#define _EXISTENT_H
#include <mentalEntity.h>
class Existent
: public MentalEntity
{
};
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef _MENTAL_ENTITY_H
#define _MENTAL_ENTITY_H
class MentalEntity
{
};
#endif
+17 -6
View File
@@ -1,21 +1,32 @@
#ifndef _MIND_H
#define _MIND_H
#include <cstdlib>
#include <memory>
#include <thought.h>
#include <subconscious.h>
#include <concept.h>
#include <attentionGrabber.h>
class Mind
{
public:
void wander(void)
AttentionGrabber poll(void);
void focusOn(std::shared_ptr<Thought> thought)
{
Thought idleThought(subconscious);
idleThought.walk();
currentThought = thought;
}
void execute(void)
{};
bool recognizes(AttentionTrigger intrin)
{ return !!(std::rand() / 2); };
public:
Subconscious subconscious;
std::shared_ptr<Thought> currentThought;
Concept Desirables,
Undesirables;
};
#endif
+1 -1
View File
@@ -3,7 +3,7 @@
#include <quale.h>
class PleasantQuale
class PleasurableQuale
: public NonNeutralQuale
{
public:
+2 -1
View File
@@ -2,6 +2,7 @@
#define _QUALE_H
#include <cstdint>
#include <attentionTrigger.h>
class Quale
{
@@ -27,7 +28,7 @@ class NeutralQuale
};
class NonNeutralQuale
: public Quale
: public Quale, public AttentionTrigger
{
public:
virtual void eventInd(void);
+14
View File
@@ -0,0 +1,14 @@
#ifndef _QUALE_BUNDLE_H
#define _QUALE_BUNDLE_H
#include <config.h>
#include <array>
#include <quale.h>
typedef std::array<Quale, CONFIG_NUM_SENSORS> QualeBundle_t;
class QualeBundle
{
QualeBundle_t qualia;
};
#endif
+40 -4
View File
@@ -3,14 +3,25 @@
#include <iostream>
#include <scene.h>
#include <thoughtContentSource.h>
#include <attentionGrabber.h>
class Thought
{
public:
Thought(ThoughtContentSource csource)
{}
enum class Goal
{
DRIFT,
ASSOCIATE_CAUSAL_QUALE_WITH_INTRINSIC_MOTIVATORS,
RESPOND_TO_CAUSAL_QUALE
};
Thought(void)
{
setGoal(Goal::DRIFT);
}
public:
void walk(void)
{
for (;;)
@@ -20,9 +31,34 @@ public:
};
void step(void) { std::cout <<"Step\n"; }
void setGoal(Goal g)
{ goal = g; }
public:
Scene scene;
Scene scene;
Goal goal;
};
class ActiveThought
: public Thought
{
public:
ActiveThought(AttentionGrabber ag)
: currFocus(ag)
{
setGoal(Goal::ASSOCIATE_CAUSAL_QUALE_WITH_INTRINSIC_MOTIVATORS);
}
public:
AttentionGrabber currFocus;
};
class IdleThought
: public Thought
{
public:
IdleThought(void)
{}
};
#endif
+29 -1
View File
@@ -6,7 +6,35 @@ int main(int argc, char **argv)
for (;;)
{
mind.wander();
AttentionGrabber currentEmergency = mind.poll();
if (!currentEmergency)
{
// Idle thought's goal is automatically Goal::DRIFT.
auto idleThought = std::make_shared<IdleThought>();
mind.focusOn(idleThought);
}
else
{
Thought::Goal goal;
auto urgentThought = std::make_shared<ActiveThought>(currentEmergency);
if (mind.recognizes(currentEmergency.cause)) {
goal = Thought::Goal
::ASSOCIATE_CAUSAL_QUALE_WITH_INTRINSIC_MOTIVATORS;
}
else {
goal = Thought::Goal
::RESPOND_TO_CAUSAL_QUALE;
}
urgentThought->setGoal(goal);
mind.focusOn(urgentThought);
}
mind.execute();
}
return 0;
+10
View File
@@ -0,0 +1,10 @@
#include <mind.h>
AttentionGrabber Mind::poll(void)
{
AttentionTrigger tmpAt;
Chronomenon tmpChron;
return AttentionGrabber(tmpAt, tmpChron);
}
+2
View File
@@ -0,0 +1,2 @@
#include <nonNeutralQualia.h>