Class: DRP::SearchAlgorithms::PSO::InteractiveParticleSwarmOptimizer
- Inherits:
-
AbstractParticleSwarmOptimizer
- Object
- AbstractParticleSwarmOptimizer
- DRP::SearchAlgorithms::PSO::InteractiveParticleSwarmOptimizer
- Defined in:
- lib/pso.rb
Instance Attribute Summary collapse
-
#particles ⇒ Object
readonly
Returns the value of attribute particles.
Attributes inherited from AbstractParticleSwarmOptimizer
#global_best_error, #global_best_vector
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(swarm_size, vector_size, rebirth = 0.0) ⇒ InteractiveParticleSwarmOptimizer
constructor
A new instance of InteractiveParticleSwarmOptimizer.
- #reinit_all ⇒ Object
- #roam_all ⇒ Object
Constructor Details
#initialize(swarm_size, vector_size, rebirth = 0.0) ⇒ InteractiveParticleSwarmOptimizer
Returns a new instance of InteractiveParticleSwarmOptimizer.
100 101 102 103 |
# File 'lib/pso.rb', line 100 def initialize swarm_size, vector_size, rebirth = 0.0 super init_particles InteractiveParticle end |
Instance Attribute Details
#particles ⇒ Object (readonly)
Returns the value of attribute particles.
98 99 100 |
# File 'lib/pso.rb', line 98 def particles @particles end |
Instance Method Details
#each ⇒ Object
104 105 106 107 108 |
# File 'lib/pso.rb', line 104 def each @particles.each do |p| yield p end end |
#reinit_all ⇒ Object
112 113 114 |
# File 'lib/pso.rb', line 112 def reinit_all each { |p| p.init_vector } end |
#roam_all ⇒ Object
109 110 111 |
# File 'lib/pso.rb', line 109 def roam_all each { |p| p.roam } end |