Subject: | |
From: | |
Reply To: | |
Date: | Mon, 11 Feb 2008 11:42:37 +1100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Looks like the PSOSubpopulation.java file may not have been committed
to CVS post minGene/maxGene updates.
Here's a patch to fix it (I think):
Index: PSOSubpopulation.java
===================================================================
RCS file: /cvs/ecj/ecj/ec/pso/PSOSubpopulation.java,v
retrieving revision 1.2
diff -c -r1.2 PSOSubpopulation.java
*** PSOSubpopulation.java 29 Oct 2007 23:35:44 -0000 1.2
--- PSOSubpopulation.java 11 Feb 2008 00:39:01 -0000
***************
*** 109,115 ****
if (loadInds == null) // we're generating new individuals,
not reading them from a file
{
FloatVectorSpecies fvSpecies =
(FloatVectorSpecies)species;
- double range = fvSpecies.maxGene - fvSpecies.minGene;
for (int i = 0; i < individuals.length; i++)
{
--- 109,114 ----
***************
*** 119,124 ****
--- 118,124 ----
for(int j = 0; j < prevInd.genomeLength(); j++)
{
double val = prevInd.genome[j];
+ double range = fvSpecies.maxGene(j) -
fvSpecies.minGene(j);
do
prevInd.genome[j] = val + (range *
initialVelocityScale) * (state.random[thread].nextDouble()*2.0 - 1.0);
while (prevInd.genome[j] < fvSpecies.minGene(j)
|| prevInd.genome[j] > fvSpecies.maxGene(j));
|
|
|