________ ________
/ \ / \
( Motorium ) ______ ( Security )
________ \________/\ / \ /\________/ _________
/ \ \/ main \/ / \
( Volition )-----------( Alife )----------( Sensorium )
\________/ ________ /\ loop /\ _______ \_________/
/ \/ \______/ \/ \
( Think ) ( Emotion )
\________/ \_______/
First
implement the main
Alife Mind loop at the core of the AI
framework from|
SAT.10.FEB.2007 C++ for Modular AI is where C++ programmers may read or post the latest news and ask or answer questions about modular AI in C++. Before the Singularity overwhelms us, everything is open for discussion and debate. There are no mandatory Standards in Artificial Intelligence. AI coders are free to read (the start of) AI4U on-line about some AI modules pre-existing in Mind.Forth and Mind.html for MSIE, and are then free to suggest entirely new AI modules and entirely new theories of how to code modular AI. One thing keep in mind, please. If you put the first module up on the Web as a skeletal framework for others to work on, you may trigger a Technological Singularity. Sun.7.SEP.2003 in the evolution of Do-It-Yourself Artificial Intelligence.
This weblog invites C++ programmers to implement the main
Alife Mind loop of the simplest artificial intelligence. An embedded systems engineer has roughed out the initial code.
// Member function definitions of the AI class.
// For reference only 9/3/03
#include <iomanip.h>
#include "AI.h"
AI::AI() // Constructor
{
// Use extensible Array class here
// rather than fixed size array
PsiAryPtr = new PsiStr[ARYSIZ];
EnAryPtr = new EnStr[ARYSIZ];
AudAryPtr = new AudStr[ARYSIZ];
}
AI::~AI() // Destructor
{
delete [] PsiAryPtr;
delete [] EnAryPtr;
delete [] AudAryPtr;
}
// Member Functions
// set functions
// Templates to be used for data base functions
BOOL AI::setEle( PsiStr *, const int ); // set concept array element
BOOL AI::setEle( EnStr *, const int ); // set english lexicon element, element index
BOOL AI::setEle( AudStr *, const int ); // set auditory memory element, element index
// get functions
BOOL AI::getEle( const int, PsiStr * ); // return concept array element
BOOL AI::getEle( const int, EnStr * ); // return english lexicon element
BOOL AI::getEle( const int, AudStr * ); // return auditory memory element
// delete functions
BOOL AI::delPsi( const int ); // delete concept array element, element index
BOOL AI::delEn( const int ); // delete english lexicon element, element index
BOOL AI::delAud( const int ); // delete auditory memory element, element index
// print functions
BOOL AI::printPsiElements(); // output
BOOL AI::printEnElements(); // output
BOOL AI::printAudElements(); // output
BOOL AI::setDefaults()
{
return (True);
}
// Functions below to be classes that are members of
// the AI class rather than functions
void AI::Security() // Human input module with AI attention
{
}
void AI::Sensorium() // AI Initial processing of Input
{
}
void AI::Think // AI Syntax and vocabulary of natural language
{
}
void AI::Motorium() // AI Output
{
}
void AI::Alife()
{
setDefaults();
while(True)
{
Security(); // Human input module with AI management
Sensorium(); // AI Initial processing of Input
Think(); // AI Syntax and vocabulary of natural language
Motorium(); // AI Output
};
}
void main(void)
{
AI AI1;
AI1.Alife();
}
------------------------------------------------------------------AI.H
// Declaration of the AI class.
// Member functions defined in AI.cpp
// preprocessor directives that
// prevent multiple inclusions of header file
#ifndef AI_H
#define AI_H
typedef int BOOL;
BOOL True = 1;
BOOL False = 0;
#define ARYSIZ 1024
class AI {
public:
AI();
~AI();
void Alife();
private:
typedef struct AudStrTag // Auditory Memory Array
{
int pho; // Phoneme
int act; // Activation Level
int pov; // Point of View
int beg; // Beginning
int ctu; // Continuation
int psi; // Tag number to a concept
} AudStr;
typedef struct EnStrTag // English Lexicon Array
{
int nen; // English concept number
int act; // Activation Level
int fex; // Mindcore Exit tag
int pos; // Part of Speech
int fin; // Mindcore In tag
int aud; // Auditory Tag
} EnStr;
typedef struct PsiStrTag // Mindcore Concept Array
{
int psi; // Mindcore concept number
int act; // Activation level
int jux; // Juxtaposed modifier
int pre; // Previous associated
int pos; // Part of Speech
int seq; // Subsequent tag
int enx; // Transfer to English
} PsiStr;
AudStr * AudStrPtr;
EnStr * EnStrPtr;
PsiStr * PsiStrPtr;
PsiStr * PsiAryPtr;
EnStr * EnAryPtr;
AudStr * AudAryPtr;
// set functions
BOOL setEle( PsiStr *, const int ); // set concept array element, element index
BOOL setEle( EnStr *, const int ); // set english lexicon element, element index
BOOL setEle( AudStr *, const int ); // set auditory memory element, element index
// get functions
BOOL getEle( const int, PsiStr * ); // return concept array element
BOOL getEle( const int, EnStr * ); // return english lexicon element
BOOL getEle( const int, AudStr * ); // return auditory memory element
// delete functions
BOOL delPsi( const int ); // delete concept array element, element index
BOOL delEn( const int ); // delete english lexicon element, element index
BOOL delAud( const int ); // delete auditory memory element, element index
// print functions
BOOL printPsiElements(); // output
BOOL printEnElements(); // output
BOOL printAudElements(); // output
BOOL setDefaults();
void Security(); // Human input module with AI attention
void Sensorium(); // AI Initial processing of Input
void Think(); // AI Syntax and vocabulary of natural language
void Motorium(); // AI Output
};
#endif
|