Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
core::optimization::Particle Class Reference

Simple data container for PSO algorithm. More...

#include <ParticleSwarmMinimizer.hh>

Inheritance diagram for core::optimization::Particle:
Inheritance graph
[legend]

Public Member Functions

 Particle (Size size)
 
 Particle (Multivec const &p_in)
 
 ~Particle () override=default
 
Real score (Multifunc &f)
 
Real set_score (Real &new_score)
 
void ensure_size (Size minsize)
 Make sure that all arrays are large enough – prevents index-out-of-bound errors. More...
 
Multivec const & pbest () const
 This is why data should be private: you get to ensure it's valid when you read it. More...
 
Real fitness_pbest () const
 

Public Attributes

Multivec p_
 
Real fitness_
 
Multivec v_
 

Private Attributes

bool best_valid_
 
Multivec pbest_
 
Real fitness_pbest_
 

Detailed Description

Simple data container for PSO algorithm.

Constructor & Destructor Documentation

core::optimization::Particle::Particle ( Size  size)
inline
core::optimization::Particle::Particle ( Multivec const &  p_in)
inline
core::optimization::Particle::~Particle ( )
overridedefault

Member Function Documentation

void core::optimization::Particle::ensure_size ( Size  minsize)
inline

Make sure that all arrays are large enough – prevents index-out-of-bound errors.

References p_, pbest_, and v_.

Real core::optimization::Particle::fitness_pbest ( ) const
inline
Multivec const& core::optimization::Particle::pbest ( ) const
inline

This is why data should be private: you get to ensure it's valid when you read it.

References best_valid_, and pbest_.

Real core::optimization::Particle::score ( Multifunc f)
inline
Real core::optimization::Particle::set_score ( Real new_score)
inline

Member Data Documentation

bool core::optimization::Particle::best_valid_
private

Referenced by fitness_pbest(), pbest(), score(), and set_score().

Real core::optimization::Particle::fitness_
Real core::optimization::Particle::fitness_pbest_
private

Referenced by fitness_pbest(), score(), and set_score().

Multivec core::optimization::Particle::p_
Multivec core::optimization::Particle::pbest_
private

Referenced by ensure_size(), pbest(), score(), and set_score().

Multivec core::optimization::Particle::v_

Referenced by ensure_size().


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