From: Gary P. <gpa...@cs...> - 2008-05-21 05:43:37
|
Hi, Just bear in mind that CIlib handles the actual algorithm, problem and then the associated measurements separately. They are tied together only at the point where the algorithm is to be executed. > Now that I have an "OptimisationProblem" defined I'm working to implement > the PSO algorithm as a test. Progress is good but looking at the code for > PSO I don't see a setParticles method. This differs from the specification > in the API docs. If the API docs are wrong then how am I meant to > configure this parameter? Within all PopulationBasedAlgorithms there is a notion of a swarm or population size. As a result we have pulled it out into a generic form that all these algorithms an use. We decided to refer to this as the PopulationInitialisationStrategy and within the PSO class this is defaultly defined to be an instance of ClonedPopulationInitialisationStrategy, whereby a prototype particle is provided and the rest of the population look "similar" to the prototype. On the PopuationInitialisationStrategy, there is an entityNumber variable that you should alter to define the size of the swarm. This parameter is defined to have a default value of 20. Please note that CIlib has reasonable default values defined for all classes. Differing behaviour can be added or set by redefining the default values. > Also, I see that there are different velocity, parameter and position > updating strategies available amongst others. How are these applied to > this > algorithm? I see a IterationStrategy method but not much else. PSO particles know how they are supposed to perform velocity / position updates. All the required fields are set on the particle itself. Using the above PopulationInitialisationStrategy, defining the way one particle is structured, results in the entire swarm's particles having the same velocity update strategy, position update strategy etc. > p.s. I don't see the GCPSO algorithm amongst the listed PSO classes. The GCPSO does in fact exsist. It's important to note that the algorithm is not any different from a normal PSO. The only difference is the manner in which VelocityUpdateStrategy is handled. As a result, a GCPSO can be created by defining that the VelocityUpdateStrategy to use is a GCVelocityUpdateStrategy. Hope this helps. We are currently formulating a "CIlib: Cookbook" where this type of recipe information can be located. It's still very young, but please feel free to post on this list and we'll get right back to you. Regards, Gary |