More wireframing
This commit is contained in:
+20
-4
@@ -1,6 +1,7 @@
|
||||
AC_INIT([The Harriman-Peikoff Project], [0.00],
|
||||
[latentprion@gmail.com], [harikoff],
|
||||
[github.com/latentprion/harikoff])
|
||||
AC_INIT([The Harriman-Peikoff Project],[0.00],[latentprion@gmail.com],[harikoff],[github.com/latentprion/harikoff])
|
||||
|
||||
AC_DEFUN([TEST_IS_NUMBER], [`echo $1 | grep -c '^[0-9]\+$'` -gt 0])
|
||||
AC_DEFUN([TEST_NOT_NUMBER], [`echo $1 | grep -c '^[0-9]\+$'` -eq 0])
|
||||
|
||||
# Safety checks in case user overwritten --srcdir
|
||||
AC_CONFIG_SRCDIR(core/main.cpp)
|
||||
@@ -17,8 +18,23 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
# AC_CHECK_HEADERS([stdio.h])
|
||||
|
||||
# AC_MSG_ERROR([You must set the number of sensors with num_sensors], 1))
|
||||
AS_IF([test "X$num_sensors" = "X"],
|
||||
AC_MSG_ERROR([You must set num_sensors]))
|
||||
AS_IF([test `echo $num_sensors | grep -c '^[0-9]\+$'` -gt 0],
|
||||
AC_MSG_ERROR([num_sensors must be an integer]))
|
||||
AS_IF([test $num_sensors -lt 1],
|
||||
AC_MSG_ERROR([Harikoff needs at least 1 sensor]))
|
||||
|
||||
num_sensors_desc="Number of sensors harikoff has direct purview over"
|
||||
AC_ARG_VAR([num_sensors],
|
||||
AS_HELP_STRING([num_sensors=<n>],[$num_sensors_desc]))
|
||||
|
||||
AC_DEFINE_UNQUOTED([CONFIG_NUM_SENSORS], [$num_sensors], [$num_sensors_desc])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_CONFIG_FILES([Makefile core/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef _ATTENTION_TRIGGER_H
|
||||
#define _ATTENTION_TRIGGER_H
|
||||
|
||||
class AttentionTrigger
|
||||
{};
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef _CONCEPT_H
|
||||
#define _CONCEPT_H
|
||||
|
||||
#include <mentalEntity.h>
|
||||
|
||||
class Concept
|
||||
: public MentalEntity
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef _EXISTENT_H
|
||||
#define _EXISTENT_H
|
||||
|
||||
#include <mentalEntity.h>
|
||||
|
||||
class Existent
|
||||
: public MentalEntity
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef _MENTAL_ENTITY_H
|
||||
#define _MENTAL_ENTITY_H
|
||||
|
||||
class MentalEntity
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
+17
-6
@@ -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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <quale.h>
|
||||
|
||||
class PleasantQuale
|
||||
class PleasurableQuale
|
||||
: public NonNeutralQuale
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
#include <mind.h>
|
||||
|
||||
AttentionGrabber Mind::poll(void)
|
||||
{
|
||||
AttentionTrigger tmpAt;
|
||||
Chronomenon tmpChron;
|
||||
|
||||
return AttentionGrabber(tmpAt, tmpChron);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
#include <nonNeutralQualia.h>
|
||||
Reference in New Issue
Block a user