From: <lab...@gm...> - 2009-01-06 22:45:51
|
Yes, thanks. I think I can modify the velocityupdatestrategy program to handle a matrix representation. It's a tradeoff between doing it like that or translating back and forth in other places. On Jan 6, 2009 12:13am, Gary Pampara <gpa...@gm...> wrote: > Hi, > > > > There is absolutely nothing wrong with the XML specification. The > > problem is in fact with the representation and the current standard > > classes in CIlib. > > > > By default, the larger majority of Swarm Intelligence problems have > > candidate solutions that are represented by a single vector. In your > > XML, you have defined that the domain in which the you want the > > algorithm to operate in, is a space that can effectively be represented > > as a matrix (or multi-dimensional array). > > > > During the algorithm setup and construction, the particles that are > > generated do in fact have matrices as their internal representations. > > The problem comes in that the default Velocity and Position update > > equations expect Vectors and not a Vector of Vectors (which is the > > current manner a Matrix is built using the domain strings - this may > > change in the near future). > > > > There should be 3 things that need to change. > > - The particles need to be told that their velocity and position update > > equations need to be altered so that they can handle Matrix instances. > > - The problem needs to be aware that the candidate solution that it > > needs to evaluate is in fact a matrix and not a simple Vector class. > > > > Does this all make sense? > > > > Regards, > > Gary > > > > lab...@gm... wrote: > > > Sorry, I was on vacation. Happy New Year to all, BTW :-) > > > > > > Here's an xml file. Maybe I'm doing something wrong? TIA. > > > > > > > > > > > > > > > > > > > > > > > ]> > > > > > > > > > > > > > > > > > maximumIterations="1000" /> > > > > > > > > > > > > > > > > > > > > domain="[R(-5.0,5.0)^5]^5"/> > > > > > > > > > > > > > > resolution="10" samples="1"> > > > > > > > > > > > > > > > > > > > > > > > > > > file="data/spherical3.gbest.p20w1.0c1_2c2_2NoVmax.txt"/> > > > > > > > > > > > > > > > > > > On Dec 23, 2008 6:54am, Gary Pampara gpa...@gm...> wrote: > > >> Continuing this discussion on the developer list. > > >> > > >> > > >> > > >> Gary Pampara wrote: > > >> > > >> > Hi, > > >> > > >> > > > >> > > >> > I'll have a look at this. > > >> > > >> > > > >> > > >> > Regards, > > >> > > >> > Gary > > >> > > >> > > > >> > > >> > lab...@gm... wrote: > > >> > > >> >> registry.setDomainString("[R(-5.0, 5.0)^10]^10"); > > >> > > >> >> yeah, that does not work too well. I get the following error: > > >> > > >> >> > > >> > > >> >> Exception in thread "main" java.lang.UnsupportedOperationException: > > >> > > >> >> Attempted to perform a numeric operation on non-numeric type > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.type.types.container.Vector.getNumeric(Vector.java:414) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.type.types.container.Vector.getReal(Vector.java:466) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.pso.velocityupdatestrategies.StandardVelocityUpdate.updateVelocity(StandardVelocityUpdate.java:89) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.pso.particle.StandardParticle.updateVelocity(StandardParticle.java:186) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.pso.iterationstrategies.SynchronousIterationStrategy.performIteration(SynchronousIterationStrategy.java:69) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.pso.iterationstrategies.SynchronousIterationStrategy.performIteration(SynchronousIterationStrategy.java:36) > > >> > > >> >> at net.sourceforge.cilib.pso.PSO.algorithmIteration(PSO.java:125) > > >> > > >> >> at > > >> > > >> >> > > > net.sourceforge.cilib.algorithm.Algorithm.performIteration(Algorithm.java:140) > > >> > > >> >> at net.sourceforge.cilib.algorithm.Algorithm.run(Algorithm.java:182) > > >> > > >> >> > > >> > > >> >> > > >> > > >> >> > > > ------------------------------------------------------------------------ > > >> > > >> >> > > >> > > >> >> > > > ------------------------------------------------------------------------------ > > >> > > >> >> > > >> > > >> >> > > >> > > >> >> > > > ------------------------------------------------------------------------ > > >> > > >> >> > > >> > > >> >> _______________________________________________ > > >> > > >> >> Cilib-users mailing list > > >> > > >> >> Cil...@li... > > >> > > >> >> https://lists.sourceforge.net/lists/listinfo/cilib-users > > >> > > >> > > > >> > > >> > > > > ------------------------------------------------------------------------------ > > >> > > >> > _______________________________________________ > > >> > > >> > Cilib-users mailing list > > >> > > >> > Cil...@li... > > >> > > >> > https://lists.sourceforge.net/lists/listinfo/cilib-users > > >> > |