LoveBrains  1.0.0
Public Member Functions | List of all members
Graphics::Physics Class Reference

Define the physics engine used by the environment. More...

#include <physics.h>

Public Member Functions

 Physics (void)
 Constructor.
 
 ~Physics (void)
 Destructor.
 
std::vector< ICollider * > const & getColliders (void) const
 Get all the colliders that are managed by the physics engine. More...
 
std::vector< ISensor * > const & getSensors (void) const
 Get all the sensors that are managed by the physics engine. More...
 
std::map< std::string, int > const & getEnvironmentSettings (void) const
 Get the environment settings that are contained in a map. More...
 
std::map< std::string, int > const & getCurrentEnvironment (void) const
 Get the current state of the environment settings that are contained in a map. More...
 
std::map< std::string, bool > const & getGenerationSettings (void) const
 Get the generation settings that are contained in a map. More...
 
void addCollider (ICollider *collider)
 Add a new collider to the physics engine. More...
 
void addSensor (ISensor *sensor)
 Add a new sensor to the physics engine. More...
 
void addGenerationSetting (std::string type, bool generate)
 Add a new generator setting to the physics engine. More...
 
void LoadEnvironmentSettings (std::list< IObject * > &env)
 Load the environment settings from the environment. More...
 
void UpdateEnvironment (std::list< IObject * > &env)
 Update the environment. More...
 
void UpdateColliders (std::list< IObject * > &env) const
 Update all the colliders in the physics engine. More...
 
void UpdateSensors (std::list< IObject * > &env) const
 Update all the sensors in the physics engine. More...
 
void GenerateEnvironment (std::list< IObject * > &env, std::list< GA::IDNA * > &brains)
 Generate the environment in terms of the environment settings. More...
 
void GenerateTournament (std::list< IObject * > &env, std::list< GA::IDNA * > &brains)
 Generate the environment in terms of the environment settings for the tournament. More...
 
Physicsoperator= (Physics const &physics)
 

Detailed Description

Define the physics engine used by the environment.

Member Function Documentation

void Graphics::Physics::addCollider ( ICollider collider)

Add a new collider to the physics engine.

Parameters
collider: Contains the new ICollider.
void Graphics::Physics::addGenerationSetting ( std::string  type,
bool  generate 
)

Add a new generator setting to the physics engine.

Parameters
type: Contains the key of the setting.
generate: true if it's generated on each death, or false.
void Graphics::Physics::addSensor ( ISensor sensor)

Add a new sensor to the physics engine.

Parameters
sensor: Contains the new ISensor.
void Graphics::Physics::GenerateEnvironment ( std::list< IObject * > &  env,
std::list< GA::IDNA * > &  brains 
)

Generate the environment in terms of the environment settings.

Parameters
env: Contains all the objects in the environment.
brains: Contains all the neural networks.
void Graphics::Physics::GenerateTournament ( std::list< IObject * > &  env,
std::list< GA::IDNA * > &  brains 
)

Generate the environment in terms of the environment settings for the tournament.

Parameters
env: Contains all the objects in the environment.
brains: Contains all the neural networks.
std::vector< ICollider * > const & Graphics::Physics::getColliders ( void  ) const

Get all the colliders that are managed by the physics engine.

Returns
std::vector<ICollider *> const&
std::map< std::string, int > const & Graphics::Physics::getCurrentEnvironment ( void  ) const

Get the current state of the environment settings that are contained in a map.

Returns
std::map<std::string, int> const&
std::map< std::string, int > const & Graphics::Physics::getEnvironmentSettings ( void  ) const

Get the environment settings that are contained in a map.

Returns
std::map<std::string, int> const&
std::map< std::string, bool > const & Graphics::Physics::getGenerationSettings ( void  ) const

Get the generation settings that are contained in a map.

Returns
std::map<std::string, bool> const&
std::vector< ISensor * > const & Graphics::Physics::getSensors ( void  ) const

Get all the sensors that are managed by the physics engine.

Returns
std::vector<ISensor *> const&
void Graphics::Physics::LoadEnvironmentSettings ( std::list< IObject * > &  env)

Load the environment settings from the environment.

Parameters
env: Contains all the objects in the environment.
void Graphics::Physics::UpdateColliders ( std::list< IObject * > &  env) const

Update all the colliders in the physics engine.

Parameters
env: Contains all the objects in the environment.
void Graphics::Physics::UpdateEnvironment ( std::list< IObject * > &  env)

Update the environment.

Parameters
env: Contains all the objects in the environment.
void Graphics::Physics::UpdateSensors ( std::list< IObject * > &  env) const

Update all the sensors in the physics engine.

Parameters
env: Contains all the objects in the environment.

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