DART  6.10.1
dart::optimizer::Population Class Reference

#include <Population.hpp>

Public Member Functions

 Population (std::shared_ptr< MultiObjectiveProblem > problem, std::size_t populationSize=0u)
 Constructor. More...
 
MultiObjectiveProblemgetProblem ()
 Returns the associated problem, which is always not null. More...
 
const MultiObjectiveProblemgetProblem () const
 Returns the associated problem, which is always not null. More...
 
void pushBack (const Eigen::VectorXd &x)
 Adds the decision vector at the back of the population. More...
 
void pushBack (const Eigen::VectorXd &x, const Eigen::VectorXd &f)
 Adds the decision vector and the fitness vector at the back of the population. More...
 
void set (std::size_t index, const Eigen::VectorXd &x)
 Sets the decision vector. More...
 
void set (std::size_t index, const Eigen::VectorXd &x, const Eigen::VectorXd &f)
 Sets the decision vector and fitness vector at index in the population. More...
 
std::size_t getSize () const
 Returns the size of this population. More...
 
Eigen::VectorXd getDecisionVector (std::size_t index) const
 Returns a decision vectors at index. More...
 
Eigen::VectorXd getFitnessVector (std::size_t index) const
 Returns a fitness vectors at index. More...
 
std::ostream & print (std::ostream &os) const
 Prints information of this class to a stream. More...
 

Protected Attributes

std::shared_ptr< MultiObjectiveProblemmProblem
 Multi-objective problem that this population is accosiated with. More...
 
Eigen::MatrixXd mPopulation
 Decision vectors. A column represents a decision vector. More...
 
Eigen::MatrixXd mFitness
 Fitness vectors. A column represents a fitness vector. More...
 

Constructor & Destructor Documentation

◆ Population()

dart::optimizer::Population::Population ( std::shared_ptr< MultiObjectiveProblem problem,
std::size_t  populationSize = 0u 
)

Constructor.

Population stores a clone of a problem.

Member Function Documentation

◆ getDecisionVector()

Eigen::VectorXd dart::optimizer::Population::getDecisionVector ( std::size_t  index) const

Returns a decision vectors at index.

◆ getFitnessVector()

Eigen::VectorXd dart::optimizer::Population::getFitnessVector ( std::size_t  index) const

Returns a fitness vectors at index.

◆ getProblem() [1/2]

MultiObjectiveProblem * dart::optimizer::Population::getProblem ( )

Returns the associated problem, which is always not null.

◆ getProblem() [2/2]

const MultiObjectiveProblem * dart::optimizer::Population::getProblem ( ) const

Returns the associated problem, which is always not null.

◆ getSize()

std::size_t dart::optimizer::Population::getSize ( ) const

Returns the size of this population.

◆ print()

std::ostream & dart::optimizer::Population::print ( std::ostream &  os) const

Prints information of this class to a stream.

◆ pushBack() [1/2]

void dart::optimizer::Population::pushBack ( const Eigen::VectorXd &  x)

Adds the decision vector at the back of the population.

The corresponding fitness vector will be evaulated and set.

◆ pushBack() [2/2]

void dart::optimizer::Population::pushBack ( const Eigen::VectorXd &  x,
const Eigen::VectorXd &  f 
)

Adds the decision vector and the fitness vector at the back of the population.

◆ set() [1/2]

void dart::optimizer::Population::set ( std::size_t  index,
const Eigen::VectorXd &  x 
)

Sets the decision vector.

The corresponding fitness vector will be evaulated and set.

◆ set() [2/2]

void dart::optimizer::Population::set ( std::size_t  index,
const Eigen::VectorXd &  x,
const Eigen::VectorXd &  f 
)

Sets the decision vector and fitness vector at index in the population.

Member Data Documentation

◆ mFitness

Eigen::MatrixXd dart::optimizer::Population::mFitness
protected

Fitness vectors. A column represents a fitness vector.

◆ mPopulation

Eigen::MatrixXd dart::optimizer::Population::mPopulation
protected

Decision vectors. A column represents a decision vector.

◆ mProblem

std::shared_ptr<MultiObjectiveProblem> dart::optimizer::Population::mProblem
protected

Multi-objective problem that this population is accosiated with.

This is always not null.