Now builds.
* Cut out all extraneous includes.
This commit is contained in:
+4
-2
@@ -1,5 +1,7 @@
|
||||
SUBDIRS = corelogic
|
||||
SUBDIRS = hcore
|
||||
|
||||
AM_CPPFLAGS+= -I"$(abs_srcdir)/hcore/include"
|
||||
|
||||
bin_PROGRAMS = harikoff
|
||||
harikoff_SOURCES = main.cpp
|
||||
harikoff_LDADD = corelogic/libcorelogic.a
|
||||
harikoff_LDADD = hcore/libhcore.a
|
||||
|
||||
+3
-4
@@ -3,7 +3,7 @@ AC_INIT([The Harriman-Peikoff Project], [0.00.000],
|
||||
[harikoff],
|
||||
[github.com/latentprion/harikoff])
|
||||
|
||||
AC_CONFIG_SRCDIR([corelogic/mind.cpp])
|
||||
AC_CONFIG_SRCDIR([hcore/mind.cpp])
|
||||
AC_CONFIG_AUX_DIR([autotools-aux])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
||||
@@ -13,14 +13,13 @@ AC_PROG_CXX
|
||||
AC_PROG_RANLIB
|
||||
AM_PROG_AR
|
||||
|
||||
AM_CPPFLAGS=m4_normalize(["-I\"\$(abs_top_srcdir)/include\" \
|
||||
-I\"\$(abs_top_srcdir)/corelogic/include\""])
|
||||
AM_CPPFLAGS=m4_normalize(["-I\"\$(abs_top_srcdir)/include\""])
|
||||
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
|
||||
AC_CONFIG_HEADERS([include/config.h])
|
||||
AC_CONFIG_FILES([
|
||||
Makefile corelogic/Makefile
|
||||
Makefile hcore/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
+4
-2
@@ -1,2 +1,4 @@
|
||||
noinst_LIBRARIES = libcorelogic.a
|
||||
libcorelogic_a_SOURCES = painfulQuale.cpp mind.cpp
|
||||
AM_CPPFLAGS+= -I"$(abs_top_srcdir)/hcore/include"
|
||||
|
||||
noinst_LIBRARIES = libhcore.a
|
||||
libhcore_a_SOURCES = mind.cpp
|
||||
|
||||
@@ -43,7 +43,12 @@ public:
|
||||
|
||||
void reset() { iter = commandList.commands.begin(); }
|
||||
bool hasNext() const { return iter != commandList.commands.end(); }
|
||||
Cursor next() { return Cursor(commandList, ++iter); }
|
||||
Cursor next() { return ++(*this); }
|
||||
|
||||
Cursor& operator++() {
|
||||
++iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
Cursor(
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef DIRECTOR_H
|
||||
#define DIRECTOR_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
namespace director {
|
||||
|
||||
class Director {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
class MentalEntity
|
||||
{
|
||||
public:
|
||||
using Id = uint32_t;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+9
-20
@@ -1,32 +1,21 @@
|
||||
#ifndef _MIND_H
|
||||
#define _MIND_H
|
||||
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <config.h>
|
||||
#include <thread>
|
||||
|
||||
#include <thought.h>
|
||||
#include <concept.h>
|
||||
#include <attentionGrabber.h>
|
||||
#include <director/director.h>
|
||||
#include <simulator/simulator.h>
|
||||
|
||||
class Mind
|
||||
{
|
||||
public:
|
||||
AttentionGrabber poll(void);
|
||||
void focusOn(std::shared_ptr<Thought> thought)
|
||||
{
|
||||
currentThought = thought;
|
||||
}
|
||||
std::thread directorThread;
|
||||
std::thread simulatorThread;
|
||||
std::thread subconsciousThread;
|
||||
|
||||
void execute(void)
|
||||
{};
|
||||
|
||||
bool recognizes(AttentionTrigger intrin)
|
||||
{ return !!(std::rand() / 2); };
|
||||
|
||||
public:
|
||||
std::shared_ptr<Thought> currentThought;
|
||||
Concept Desirables,
|
||||
Undesirables;
|
||||
director::Director director;
|
||||
simulator::Simulator simulator;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,12 @@ public:
|
||||
|
||||
void reset() { iter = commandList.commands.begin(); }
|
||||
bool hasNext() const { return iter != commandList.commands.end(); }
|
||||
Cursor next() { return Cursor(commandList, ++iter); }
|
||||
Cursor next() { return ++(*this); }
|
||||
|
||||
Cursor& operator++() {
|
||||
++iter;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
Cursor(
|
||||
|
||||
@@ -13,8 +13,10 @@ class Scene
|
||||
public:
|
||||
using Id = uint32_t;
|
||||
|
||||
Scene();
|
||||
~Scene();
|
||||
Scene() :
|
||||
cursor(commands)
|
||||
{}
|
||||
~Scene() = default;
|
||||
|
||||
bool hasMentalEntity(const MentalEntity::Id menty) const;
|
||||
MentalEntity::Id addMentalEntity(const MentalEntity& menty);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef SIMULATOR_H
|
||||
#define SIMULATOR_H
|
||||
|
||||
#include <config.h>
|
||||
#include <simulator/scene.h>
|
||||
|
||||
namespace simulator {
|
||||
|
||||
@@ -1,10 +1,2 @@
|
||||
|
||||
#include <mind.h>
|
||||
|
||||
AttentionGrabber Mind::poll(void)
|
||||
{
|
||||
AttentionTrigger tmpAt;
|
||||
Chronomenon tmpChron;
|
||||
|
||||
return AttentionGrabber(tmpAt, tmpChron);
|
||||
}
|
||||
|
||||
@@ -4,38 +4,5 @@ int main(int argc, char **argv)
|
||||
{
|
||||
Mind mind;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user