Brain Class Reference

the variables and methods that a Brain contains put in this file More...

#include <Brain.h>

Collaboration diagram for Brain:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Brain (std::string *_script, PyObject *_main, PyObject *_dict, ngl::Vec3 &_pos, ngl::Vec3 &_vel, AIagent *_p, Graph *_graph)
 ctor
 ~Brain ()
 dtor
void setScript (std::string *_script)
 set the python script#
ngl::Vec3 getPos ()
 get the position of the agent
void setPos (const ngl::Vec3 _pos)
 set the pos of the agent
void setVel (const ngl::Vec3 _vel)
 set the velocity of the agent
ngl::Vec3 getVelocity ()
 get the velocity
ngl::Vec3 getForce ()
 get the force
void brainFunction ()
 a method to execute the script
void reset ()
 recet the brain script
void setGraphdata ()
 set the graph data to traversal

Private Attributes

ngl::Vec3 m_pos
 the position of the agent, this will be represented as pos in the python sctipt
ngl::Vec3 m_dir
 the direction of the agent, this will be represented as dir in the python sctipt
ngl::Vec3 m_velocity
 the speed of the agent, this will be represented as speed in the python sctipt
ngl::Vec3 m_force
 the force on the agent, this will be represented as force in the python sctipt
std::string * m_script
 the source string of the python script to be run
std::string m_filename
 the name of the source string loaded (for the re-load)
PyObject * m_main
 these are the python object we are going to hook into the above objects
PyObject * m_dict
 a pointer to the python dictionary for all variables in __main__
PyObject * m_pyPos
 the python object used to get the pos and m_pos data to and from the scripts / agent
PyObject * m_pyDir
 the python object used to get the dir and m_dir data to and from the scripts / agent
PyObject * m_pySpeed
 the python object used to get the speed and m_speed data to and from the scripts / agent
PyObject * m_pyForce
 the python object used to get the force and m_force data to and from the scripts / agent
PyObject * m_pyGraph
 the python object used to get the speed and m_speed data to and from the scripts / agent
PyObject * m_startScript
 the python object used to check if the script is executed for the first time
AIagentm_parent
 the parent Agent
bool m_queryResponse
 the response to the query
Graphm_graph
 the Graph
PyObject * m_pyNodes
 the Nodes for the Graph
PyObject * m_pyNodePos
 the Node position
PyObject * m_pyNextNodePos
 the Next Node position
PyObject * m_pyEdgeData
 the Edge data position
PyObject * m_pyDirection
 the Edge data position
PyObject * m_pyMessage
 the Message
PyObject * m_pyChase
 the variable to pass the data to chase
PyObject * m_pyHome
 the variable to hold the home position value
PyObject * m_pyState
 the State of the Agents
int m_index
 the index
int m_nextIndex
 the nextIndex

Detailed Description

the variables and methods that a Brain contains put in this file

Definition at line 34 of file Brain.h.


Constructor & Destructor Documentation

Brain::Brain ( std::string *  _script,
PyObject *  _main,
PyObject *  _dict,
ngl::Vec3 &  _pos,
ngl::Vec3 &  _vel,
AIagent _p,
Graph _graph 
)

ctor

Parameters:
[in] the name of the python file to load, this will be stored so the file can be re-loaded.
[in] Python variable main
[in] Python variable dictionary
[in] the initial position on the graph node where the agent is placed
[in] the initial velocity
[in] the parent agent
[in] the graph variable for traversing
Brain::~Brain (  ) 

dtor


Member Function Documentation

void Brain::brainFunction (  ) 

a method to execute the script

ngl::Vec3 Brain::getForce (  )  [inline]

get the force

Definition at line 79 of file Brain.h.

References m_force.

00079 {return m_force;}

ngl::Vec3 Brain::getPos (  )  [inline]

get the position of the agent

Definition at line 61 of file Brain.h.

References m_pos.

00061 {return m_pos;}

ngl::Vec3 Brain::getVelocity (  )  [inline]

get the velocity

Definition at line 75 of file Brain.h.

References m_velocity.

00075 {return m_velocity;}

void Brain::reset (  ) 

recet the brain script

void Brain::setGraphdata (  ) 

set the graph data to traversal

void Brain::setPos ( const ngl::Vec3  _pos  )  [inline]

set the pos of the agent

Parameters:
[in] the new position _pos

Definition at line 66 of file Brain.h.

References m_pos.

00066 {m_pos = _pos;}

void Brain::setScript ( std::string *  _script  )  [inline]

set the python script#

Parameters:
[in] _script the new script to set

Definition at line 57 of file Brain.h.

References m_script.

00057 {m_script = _script;}

void Brain::setVel ( const ngl::Vec3  _vel  )  [inline]

set the velocity of the agent

Parameters:
[in] the new velocity _vel

Definition at line 71 of file Brain.h.

References m_velocity.

00071 {m_velocity = _vel;}


Member Data Documentation

PyObject* Brain::m_dict [private]

a pointer to the python dictionary for all variables in __main__

Definition at line 131 of file Brain.h.

ngl::Vec3 Brain::m_dir [private]

the direction of the agent, this will be represented as dir in the python sctipt

Definition at line 105 of file Brain.h.

std::string Brain::m_filename [private]

the name of the source string loaded (for the re-load)

Definition at line 121 of file Brain.h.

ngl::Vec3 Brain::m_force [private]

the force on the agent, this will be represented as force in the python sctipt

Definition at line 113 of file Brain.h.

Graph* Brain::m_graph [private]

the Graph

Definition at line 167 of file Brain.h.

int Brain::m_index [private]

the index

Definition at line 207 of file Brain.h.

PyObject* Brain::m_main [private]

these are the python object we are going to hook into the above objects

a hook into the python __main__ function where I program is to be run from

Definition at line 127 of file Brain.h.

int Brain::m_nextIndex [private]

the nextIndex

Definition at line 211 of file Brain.h.

the parent Agent

Definition at line 159 of file Brain.h.

ngl::Vec3 Brain::m_pos [private]

the position of the agent, this will be represented as pos in the python sctipt

Definition at line 101 of file Brain.h.

PyObject* Brain::m_pyChase [private]

the variable to pass the data to chase

Definition at line 195 of file Brain.h.

PyObject* Brain::m_pyDir [private]

the python object used to get the dir and m_dir data to and from the scripts / agent

Definition at line 139 of file Brain.h.

PyObject* Brain::m_pyDirection [private]

the Edge data position

Definition at line 187 of file Brain.h.

PyObject* Brain::m_pyEdgeData [private]

the Edge data position

Definition at line 183 of file Brain.h.

PyObject* Brain::m_pyForce [private]

the python object used to get the force and m_force data to and from the scripts / agent

Definition at line 147 of file Brain.h.

PyObject* Brain::m_pyGraph [private]

the python object used to get the speed and m_speed data to and from the scripts / agent

Definition at line 151 of file Brain.h.

PyObject* Brain::m_pyHome [private]

the variable to hold the home position value

Definition at line 199 of file Brain.h.

PyObject* Brain::m_pyMessage [private]

the Message

Definition at line 191 of file Brain.h.

PyObject* Brain::m_pyNextNodePos [private]

the Next Node position

Definition at line 179 of file Brain.h.

PyObject* Brain::m_pyNodePos [private]

the Node position

Definition at line 175 of file Brain.h.

PyObject* Brain::m_pyNodes [private]

the Nodes for the Graph

Definition at line 171 of file Brain.h.

PyObject* Brain::m_pyPos [private]

the python object used to get the pos and m_pos data to and from the scripts / agent

Definition at line 135 of file Brain.h.

PyObject* Brain::m_pySpeed [private]

the python object used to get the speed and m_speed data to and from the scripts / agent

Definition at line 143 of file Brain.h.

PyObject* Brain::m_pyState [private]

the State of the Agents

Definition at line 203 of file Brain.h.

bool Brain::m_queryResponse [private]

the response to the query

Definition at line 163 of file Brain.h.

std::string* Brain::m_script [private]

the source string of the python script to be run

Definition at line 117 of file Brain.h.

PyObject* Brain::m_startScript [private]

the python object used to check if the script is executed for the first time

Definition at line 155 of file Brain.h.

ngl::Vec3 Brain::m_velocity [private]

the speed of the agent, this will be represented as speed in the python sctipt

Definition at line 109 of file Brain.h.


The documentation for this class was generated from the following file:

Generated on 16 Aug 2013 for Multi-AgentSystem by  doxygen 1.6.1