LibCudaOptimize  1.0
PSO_Optimizer Class Reference

Particle Swarm Optimization. More...

#include <PSO_Optimizer.h>

Inheritance diagram for PSO_Optimizer:
Collaboration diagram for PSO_Optimizer:

List of all members.

Public Member Functions

 PSO_Optimizer (EvalFuncPtr fPtr=NULL, unsigned int dn=PROBLEM_DIMENSIONS, unsigned int sn=NUM_SETS, unsigned int pn=NUM_SOLUTIONS)
 see IOptimizer::IOptimizer
virtual bool init ()
 Initialize the optimizer.
virtual void free ()
 Free memory.
void setInertia (float w)
 set inertia value
void setC1 (float c1)
 set value of parameter C1
void setC2 (float c2)
 set value of parameter C2
void setTopology (TOPOLOGY topology)
 set neighborhood topology
float * getBestSolution ()
 get best solutions of all sets
float * getBestSolution (unsigned int sid)
 get best solution of the set indicated by the index sid
float * getBestFitnesses ()
 get a pointer to best fitnesses of all sets
float getBestFitness (unsigned int sid)
 get value of the best fitness for set indicated by the index sid

Protected Member Functions

virtual void initSolutions (dim3, dim3)
 Initialize solutions.
virtual void fitnessEvaluation (dim3, dim3, bool first=false)
 Evaluate solutions.
virtual void step (dim3, dim3)
 Generate solutions for subsequent fitnessEvaluation.
virtual void update (dim3, dim3, bool first=false)
 Update population according to the algorithm and the results of fitnessEvaluation.
virtual void findBest ()
 Updates global best fitnesses, indexes in SolutionSet device memory.

Detailed Description

Particle Swarm Optimization.

Code based on http://www.ce.unipr.it/people/mussi/projects/CUDA-PSO-v1.0-html_documentation

Definition at line 40 of file PSO_Optimizer.h.


Member Function Documentation

virtual void PSO_Optimizer::fitnessEvaluation ( dim3  initializationGrid,
dim3  initializationBlock,
bool  first = false 
) [protected, virtual]

Evaluate solutions.

Parameters:
initializationGridorganization of the CUDA blocks
initializationBlockorganization of the CUDA threads
firstit signals if it is the first evaluation of the optimization

Implements IOptimizer.

virtual void PSO_Optimizer::initSolutions ( dim3  initializationGrid,
dim3  initializationBlock 
) [protected, virtual]

Initialize solutions.

Parameters:
initializationGridorganization of the CUDA blocks
initializationBlockorganization of the CUDA threads

Implements IOptimizer.

void PSO_Optimizer::setTopology ( TOPOLOGY  topology) [inline]

set neighborhood topology

Actually implemented:
LBEST ring topology with neighborhood size 2 GBEST global topology STAR star topology

Definition at line 91 of file PSO_Optimizer.h.

virtual void PSO_Optimizer::step ( dim3  initializationGrid,
dim3  initializationBlock 
) [protected, virtual]

Generate solutions for subsequent fitnessEvaluation.

Parameters:
initializationGridorganization of the CUDA blocks
initializationBlockorganization of the CUDA threads

Implements IOptimizer.

virtual void PSO_Optimizer::update ( dim3  initializationGrid,
dim3  initializationBlock,
bool  first = false 
) [protected, virtual]

Update population according to the algorithm and the results of fitnessEvaluation.

Parameters:
initializationGridorganization of the CUDA blocks
initializationBlockorganization of the CUDA threads
firstit signals if it is the first evaluation of the optimization

Implements IOptimizer.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Defines