P
Phil Tomson
Does anyone have a Particle Swarm Optimization package written in Ruby?
Phil
Phil
I wrote one up as a ruby learning exercise. I'll post you the code if
you like. (I'll probably have to go back through it to make sure
there's nothing too embarassing) I don't think there's much out there
otherwise. The algorithm itself is quite simple.
(http://en.wikipedia.org/wiki/Particle_swarm_optimization) Consider
coding it yourself if you like. Let me know.
Maybe this would be a good ruby quiz?
Yeah, the hard part of PSO and genetic algorithms is coming up with a
way to represent the problem with a vector of a predetermined length
(ok well with genetic algorithms there are ways around the set vector
length actually). In your case it looks pretty simple actually. I
assume that the number of atoms is constant (If not then it would take
a lot more thought). Just string out all of their positions together
into one long vector. When you calculate the fitness you just have to
know how to pull out the correct position of each individual atom from
the particle's position vector. (If they're not unique then I guess
this doesn't really matter.) I believe that this would work just fine.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.