our agents and its basic atrributes put in this file More...
#include <Agent.h>
Public Member Functions | |
Agent (Environment *_environment, Models *_model, Graph *_graph) | |
ctor passing in the environment variable which is the parent in which the agents exist the models class variable which contains the meshes to draw Graph class for the nodes | |
~Agent () | |
dtor will clear the agents it contains | |
void | update () |
this method updates all the agents | |
void | draw (ngl::TransformStack *_tx, ngl::Camera *_cam) |
draw the scene | |
float | getScore () |
get the score of the agent | |
void | setScore (const int _score) |
set the score of the agent | |
void | resetScore () |
reset the score of the agent | |
int | getReset () |
int | getPrecision () |
get the precision value i.e, no of nodes per dimension in the node graph | |
ngl::Vec3 | getAITargetPos (int _ID) |
void | setAITargetPos (const ngl::Vec3 _pos, const int _ID) |
set the target object position to the agent | |
void | setAITargetPos (const ngl::Vec3 _pos) |
set the target object position to all the agents | |
ngl::Vec3 | getUserPosition (std::string _name) |
get the user agent position | |
void | addNewArmy (PyObject *_main, PyObject *_dict) |
create a new Army with a set of artificial agents | |
void | addAIagent (std::string _file, PyObject *_main, PyObject *_dict, int _index, std::string _meshName, float _radius, std::string _type, int _id, int _armyId, std::string _state) |
add a new AI agent | |
void | addAIagent (std::string _file, PyObject *_main, PyObject *_dict, ngl::Vec3 _pos, std::string _type, float _radius, std::string _meshName, int _ID) |
add a new AI agent | |
void | addUserAgent (int _index, std::string _meshName, std::string _name) |
add a new User agent | |
AIagent * | getAIagent (int _id) |
get the AI agent | |
UserAgent * | getUserAgent (std::string _name) |
get the user agent | |
void | addPongPlayers (PyObject *_main, PyObject *_dict) |
add agents for the pong game | |
void | clearAgents () |
clear the agents | |
void | resetAgents () |
reset the agents to their home positions | |
void | setInitialOccupiedStatus () |
set the initial status of the nodes occupied by the agents to occupuied | |
void | addPongPlayers (PyObject *_main, PyObject *_dict, ngl::Vec3 _pos1, ngl::Vec3 _pos2) |
add agents fot the pong game | |
void | agentsQueryUpdate (AIagent *_agent) |
query the environment in each iteration for collisions and update | |
void | checkUserBulletsCollision (std::list< Ammo * > _bullets) |
the User bullets collision status | |
void | checKTheAIhitstatus (Ammo *_ammo) |
check if the agents are hit with the bullets | |
std::list< AIagent * > | getAIagentsList () |
get the list of AI agents | |
Private Attributes | |
PyObject * | m_main |
a hook into the python __main__ function where I program is to be run from | |
PyObject * | m_dict |
a pointer to the python dictionary for all variables in __main__ | |
Environment * | m_environment |
a pointer to the environment variable | |
Models * | m_model |
a pointer to the models variable | |
Graph * | m_graph |
a pointer to the graph variable | |
int | m_precision |
a variable to specify the dimension of the graph | |
std::list< AIagent * > | m_aiAgents |
a list to hold the AI agents | |
std::list< AIagent * > | m_aiAgentsTempVector |
a temporary list to hold the AI agents while creating army with the agents | |
std::list< UserAgent * > | m_userAgent |
a list to hold the user agents | |
std::map< int, AIagent * > | m_aiAgentMap |
a map to hold the agents with the unique ID | |
std::map< std::string, UserAgent * > | m_userAgentMap |
a map to hold the user agents with the name | |
std::list< Army * > | m_armies |
a list to hold the armies | |
std::map< int, Army * > | m_armyMap |
a map of the armies with the ID | |
int | m_aiagentID |
a int to assign the agent ID | |
int | m_armyID |
a int to assign the army ID |
our agents and its basic atrributes put in this file
Definition at line 46 of file Agent.h.
Agent::Agent | ( | Environment * | _environment, | |
Models * | _model, | |||
Graph * | _graph | |||
) |
ctor passing in the environment variable which is the parent in which the agents exist the models class variable which contains the meshes to draw Graph class for the nodes
[in] | the | environment |
[in] | the | model |
[in] | the | graph |
Agent::~Agent | ( | ) |
dtor will clear the agents it contains
void Agent::addAIagent | ( | std::string | _file, | |
PyObject * | _main, | |||
PyObject * | _dict, | |||
ngl::Vec3 | _pos, | |||
std::string | _type, | |||
float | _radius, | |||
std::string | _meshName, | |||
int | _ID | |||
) |
add a new AI agent
[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 where the agent is placed |
[in] | the | radius for boundary and collision checking |
[in] | the | type of the agent |
[in] | the | unique ID of the agent |
void Agent::addAIagent | ( | std::string | _file, | |
PyObject * | _main, | |||
PyObject * | _dict, | |||
int | _index, | |||
std::string | _meshName, | |||
float | _radius, | |||
std::string | _type, | |||
int | _id, | |||
int | _armyId, | |||
std::string | _state | |||
) |
add a new AI agent
[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 index on the graph node where the agent is placed |
[in] | the | mesh name that is associated with the agent |
[in] | the | radius for boundary and collision checking |
[in] | the | type of the agent |
[in] | the | unique ID of the agent |
[in] | the | unique army to which the agent belongs to |
[in] | the | state in which the agent is created |
void Agent::addNewArmy | ( | PyObject * | _main, | |
PyObject * | _dict | |||
) |
create a new Army with a set of artificial agents
[in] | Python | variable main |
[in] | Python | variable dictionary |
void Agent::addPongPlayers | ( | PyObject * | _main, | |
PyObject * | _dict, | |||
ngl::Vec3 | _pos1, | |||
ngl::Vec3 | _pos2 | |||
) |
add agents fot the pong game
[in] | Python | variables |
[in] | Positions | for the placement of the agents |
void Agent::addPongPlayers | ( | PyObject * | _main, | |
PyObject * | _dict | |||
) |
add agents for the pong game
[in] | the | python varialbes |
void Agent::addUserAgent | ( | int | _index, | |
std::string | _meshName, | |||
std::string | _name | |||
) |
add a new User agent
[in] | the | initial index on the graph node where the agent is placed |
[in] | the | mesh name that is associated with the agent |
[in] | the | name of the agent |
void Agent::agentsQueryUpdate | ( | AIagent * | _agent | ) |
query the environment in each iteration for collisions and update
void Agent::checKTheAIhitstatus | ( | Ammo * | _ammo | ) |
check if the agents are hit with the bullets
void Agent::checkUserBulletsCollision | ( | std::list< Ammo * > | _bullets | ) |
the User bullets collision status
void Agent::clearAgents | ( | ) |
clear the agents
void Agent::draw | ( | ngl::TransformStack * | _tx, | |
ngl::Camera * | _cam | |||
) |
draw the scene
[in] | _tx | the transform stack of the current scene |
[in] | _cam | the current camera |
AIagent* Agent::getAIagent | ( | int | _id | ) |
get the AI agent
[in] | the | unique index of the agent |
std::list<AIagent* > Agent::getAIagentsList | ( | ) | [inline] |
get the list of AI agents
Definition at line 200 of file Agent.h.
References m_aiAgents.
00200 {return m_aiAgents;}
ngl::Vec3 Agent::getAITargetPos | ( | int | _ID | ) |
int Agent::getPrecision | ( | ) |
get the precision value i.e, no of nodes per dimension in the node graph
[out] | the | precision |
int Agent::getReset | ( | ) | [inline] |
float Agent::getScore | ( | ) | [inline] |
get the score of the agent
[out] | the | score of the agent |
UserAgent* Agent::getUserAgent | ( | std::string | _name | ) |
get the user agent
[in] | the | name of the agent |
ngl::Vec3 Agent::getUserPosition | ( | std::string | _name | ) |
get the user agent position
void Agent::resetAgents | ( | ) |
reset the agents to their home positions
void Agent::resetScore | ( | ) | [inline] |
reset the score of the agent
void Agent::setAITargetPos | ( | const ngl::Vec3 | _pos | ) |
set the target object position to all the agents
[in] | the | new target position |
void Agent::setAITargetPos | ( | const ngl::Vec3 | _pos, | |
const int | _ID | |||
) |
set the target object position to the agent
[in] | the | new target position |
[in] | the | ID of the agent |
void Agent::setInitialOccupiedStatus | ( | ) |
set the initial status of the nodes occupied by the agents to occupuied
void Agent::setScore | ( | const int | _score | ) | [inline] |
set the score of the agent
[in] | the | new score of the agent |
void Agent::update | ( | ) |
this method updates all the agents
int Agent::m_aiagentID [private] |
std::map<int, AIagent *> Agent::m_aiAgentMap [private] |
std::list<AIagent *> Agent::m_aiAgents [private] |
std::list<AIagent *> Agent::m_aiAgentsTempVector [private] |
std::list<Army* > Agent::m_armies [private] |
int Agent::m_armyID [private] |
std::map<int , Army *> Agent::m_armyMap [private] |
PyObject* Agent::m_dict [private] |
Environment* Agent::m_environment [private] |
Graph* Agent::m_graph [private] |
PyObject* Agent::m_main [private] |
Models* Agent::m_model [private] |
int Agent::m_precision [private] |
std::list<UserAgent *> Agent::m_userAgent [private] |
std::map<std::string, UserAgent*> Agent::m_userAgentMap [private] |