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