|
ACM (1998) AI4U (2002) ACM (2004) AI Coding Steps Index of AI4U C++ Robots BiPed Cylon ER1 Ester LUCY Rodney Yosef Forums AGI Mailing List AI Chat AI Meetup Day AI Poll: Results Amazon CogNews comp.lang.c++ KurzweilAI.net Resources AI C++ Source Code AI FAQ: Software AI Funding C++ AI Parts C++ Glossary del.icio.us C++ DMoz -- C++ FAQTs -- C++ Free Software Donation Directory Genetic Daemon JavaScript AI Mind ManC++ Mind.Forth AI NLP++ (tm) Novamente PAIR PC AI -- C++ Player Standard Template Library Standards in AI Theory of Cognitivity Turing Machine Variables in AI4U VISLCG VISLPSG Weblogs Via Technorati Ahoyhoy.org ( q.v.) Eckel, Bruce ( q.v.) |
________ ________
/ \ / \
( Motorium ) ______ ( Security )
________ \________/\ / \ /\________/ _________
/ \ \/ main \/ / \
( Volition )-----------( Alife )----------( Sensorium )
\________/ ________ /\ loop /\ _______ \_________/
/ \/ \______/ \/ \
( Think ) ( Emotion )
\________/ \_______/
First
implement the main
Alife Mind loop at the core of the AI
framework from|
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
|