LoveBrains  1.0.0
Public Types | Public Member Functions | List of all members
Simulator::SConfig Class Reference

Manage the configuration of the simulator. More...

#include <simulator_config.h>

Public Types

enum  DisplayMode { NONE, ENVIRONMENT_2D }
 Contains several display options.
 

Public Member Functions

 SConfig (void) throw ()
 Constructor.
 
 ~SConfig (void) throw ()
 Destructor.
 
void setCrossingRate (double rate)
 Set the crossing rate that will be used by the GAEngine. More...
 
void setMutationRate (double rate)
 Set the mutation rate that will be used by the GAEngine. More...
 
void setSelectionRate (double rate)
 Set the selection rate that will be used by the GAEngine. More...
 
void setExpectedFitness (double rate) throw ()
 Set the expected fitness that will be used by the GAEngine. More...
 
void setPoolSize (unsigned int size)
 Set the pool size for the tournament in the GAEngine. More...
 
void setMaxEpochs (int max) throw ()
 Set the maximum epochs for the GAEngine. More...
 
void setReportInterval (unsigned int interval) throw ()
 Set the report interval for the GAEngine. More...
 
void setPopulationSize (unsigned int size)
 Set the population size of the GAEngine. More...
 
void setANNInfos (std::string infos)
 Set the topology of the neural network used by the AI objects. More...
 
void setActivation (GANN::ANNLayer::FActivate function, GANN::ANN::ActivationType type)
 Set the activation function for the intern layers of the neural network. More...
 
void setOutputsActivation (GANN::ANNLayer::FActivate function, GANN::ANN::ActivationType type)
 Set the activation function for the output layer of the neural network. More...
 
void setEnvironmentSize (unsigned int width, unsigned int height)
 Set the environment size (window size). More...
 
void setIsTournament (bool isTournament) throw ()
 Set if it's a tournament or not. More...
 
void setDisplayMode (DisplayMode display) throw ()
 Set the display mode of the environment. More...
 
double getCrossingRate (void) const throw ()
 Get the crossing rate member. More...
 
double getMutationRate (void) const throw ()
 Get the mutation rate member. More...
 
double getSelectionRate (void) const throw ()
 Get the selection rate member. More...
 
double getExpectedFitness (void) const throw ()
 Get the expected fitness member. More...
 
unsigned int getPoolSize (void) const throw ()
 Get the pool size member. More...
 
int getMaxEpochs (void) const throw ()
 Get the maximum epochs member. More...
 
unsigned int getReportInterval (void) const throw ()
 Get the report interval member. More...
 
unsigned int getPopulationSize (void) const throw ()
 Get the population size member. More...
 
std::vector< unsigned int > const & getANNInfos (void) const throw ()
 Get the neural network topology member. More...
 
GANN::ANNLayer::FActivate getActivation (void) const throw ()
 Get the activation function pointer of the intern layers. More...
 
GANN::ANNLayer::FActivate getOutputsActivation (void) const throw ()
 Get the activation function pointer of the output layer. More...
 
unsigned int getEnvironmentWidth (void) const throw ()
 Get the window's width. More...
 
unsigned int getEnvironmentHeight (void) const throw ()
 Get the window's height. More...
 
GANN::ANN::ActivationType getLayerActivationType (void) const throw ()
 Get the type of the activation function pointer inside an intern layer. More...
 
GANN::ANN::ActivationType getOutputActivationType (void) const throw ()
 Get the type of the activation function pointer inside the output layer. More...
 
bool isTournament (void) const throw ()
 Get the boolean that says if it's a tournament. More...
 
DisplayMode getDisplayMode (void) const throw ()
 Get the current display mode of the environment. More...
 
SConfigoperator= (SConfig const &config)
 

Detailed Description

Manage the configuration of the simulator.

Member Function Documentation

GANN::ANNLayer::FActivate Simulator::SConfig::getActivation ( void  ) const
throw (
)

Get the activation function pointer of the intern layers.

Returns
GANN::ANNLayer::FActivate
std::vector< unsigned int > const & Simulator::SConfig::getANNInfos ( void  ) const
throw (
)

Get the neural network topology member.

Returns
std::vector<unsigned int> const&
double Simulator::SConfig::getCrossingRate ( void  ) const
throw (
)

Get the crossing rate member.

Returns
double
SConfig::DisplayMode Simulator::SConfig::getDisplayMode ( void  ) const
throw (
)

Get the current display mode of the environment.

Returns
SConfig::DisplayMode
unsigned int Simulator::SConfig::getEnvironmentHeight ( void  ) const
throw (
)

Get the window's height.

Returns
unsigned int
unsigned int Simulator::SConfig::getEnvironmentWidth ( void  ) const
throw (
)

Get the window's width.

Returns
unsigned int
double Simulator::SConfig::getExpectedFitness ( void  ) const
throw (
)

Get the expected fitness member.

Returns
double
GANN::ANN::ActivationType Simulator::SConfig::getLayerActivationType ( void  ) const
throw (
)

Get the type of the activation function pointer inside an intern layer.

Returns
GANN::ANN::ActivationType
int Simulator::SConfig::getMaxEpochs ( void  ) const
throw (
)

Get the maximum epochs member.

Returns
int
double Simulator::SConfig::getMutationRate ( void  ) const
throw (
)

Get the mutation rate member.

Returns
double
GANN::ANN::ActivationType Simulator::SConfig::getOutputActivationType ( void  ) const
throw (
)

Get the type of the activation function pointer inside the output layer.

Returns
GANN::ANN::ActivationType
GANN::ANNLayer::FActivate Simulator::SConfig::getOutputsActivation ( void  ) const
throw (
)

Get the activation function pointer of the output layer.

Returns
GANN::ANNLayer::FActivate
unsigned int Simulator::SConfig::getPoolSize ( void  ) const
throw (
)

Get the pool size member.

Returns
unsigned int
unsigned int Simulator::SConfig::getPopulationSize ( void  ) const
throw (
)

Get the population size member.

Returns
unsigned int
unsigned int Simulator::SConfig::getReportInterval ( void  ) const
throw (
)

Get the report interval member.

Returns
unsigned int
double Simulator::SConfig::getSelectionRate ( void  ) const
throw (
)

Get the selection rate member.

Returns
double
bool Simulator::SConfig::isTournament ( void  ) const
throw (
)

Get the boolean that says if it's a tournament.

Returns
bool
void Simulator::SConfig::setActivation ( GANN::ANNLayer::FActivate  function,
GANN::ANN::ActivationType  type 
)

Set the activation function for the intern layers of the neural network.

Parameters
function: Contains the function pointer of the new activation function.
type: Contains the type of the function pointer.
Returns
error : SimulatorException
void Simulator::SConfig::setANNInfos ( std::string  infos)

Set the topology of the neural network used by the AI objects.

Parameters
infos: Contains a string that describe the topology.
Returns
error : SimulatorException
void Simulator::SConfig::setCrossingRate ( double  rate)

Set the crossing rate that will be used by the GAEngine.

Parameters
rate: Contains the new crossing rate.
Returns
error : SimulatorException
void Simulator::SConfig::setDisplayMode ( SConfig::DisplayMode  display)
throw (
)

Set the display mode of the environment.

Parameters
display: Contains the display mode.
void Simulator::SConfig::setEnvironmentSize ( unsigned int  width,
unsigned int  height 
)

Set the environment size (window size).

Parameters
width: Window's width.
height: Window's height.
Returns
error : SimulatorException
void Simulator::SConfig::setExpectedFitness ( double  rate)
throw (
)

Set the expected fitness that will be used by the GAEngine.

Parameters
rate: Contains the new expected fitness.
void Simulator::SConfig::setIsTournament ( bool  isTournament)
throw (
)

Set if it's a tournament or not.

Parameters
isTournament: (true) if it's a tournament, (false) is it's not.
void Simulator::SConfig::setMaxEpochs ( int  max)
throw (
)

Set the maximum epochs for the GAEngine.

Parameters
max: Contains the maximum epochs.
void Simulator::SConfig::setMutationRate ( double  rate)

Set the mutation rate that will be used by the GAEngine.

Parameters
rate: Contains the new mutation rate.
Returns
error : SimulatorException
void Simulator::SConfig::setOutputsActivation ( GANN::ANNLayer::FActivate  function,
GANN::ANN::ActivationType  type 
)

Set the activation function for the output layer of the neural network.

Parameters
function: Contains the function pointer of the new activation function.
type: Contains the type of the function pointer.
Returns
error : SimulatorException
void Simulator::SConfig::setPoolSize ( unsigned int  size)

Set the pool size for the tournament in the GAEngine.

Parameters
size: Contains the pool size.
Returns
error : SimulatorException
void Simulator::SConfig::setPopulationSize ( unsigned int  size)

Set the population size of the GAEngine.

Parameters
size: Contains the new population size.
Returns
error : SimulatorException
void Simulator::SConfig::setReportInterval ( unsigned int  interval)
throw (
)

Set the report interval for the GAEngine.

Parameters
interval: Contains the new interval between each report.
void Simulator::SConfig::setSelectionRate ( double  rate)

Set the selection rate that will be used by the GAEngine.

Parameters
rate: Contains the new selection rate.
Returns
error : SimulatorException

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