Menu

#1 some bugs in JAGA-Source-v.1.0.b-13.04.04.zip

open
None
9
2004-05-06
2004-05-04
No

I have installed this version and in eclipse I have
bugs in the following packages, all concerning assert
token:

package org.jaga.selection;
package org.jaga.individualRepresentation.booleanFormulas;
package org.jaga.fitnessEvaluation.multiplexer;

some others have the same problem.

When I Run Example2 It gives me the following errors:

...
96) {size=2; repr=00000101010000111101; vals=(25.0,
41.0); fit=-2.5318365560288174}
97) {size=2; repr=00000110110000100100; vals=(18.0,
56.0); fit=-2.8201640821612215}
98) {size=2; repr=00001101000000101110; vals=(39.0,
52.0); fit=-2.391592653589793}
99) {size=2; repr=00011100100001100111; vals=(92.0,
69.0); fit=-1.8082593202564599}java.lang.Error:
Unresolved compilation problem:
Syntax error on token "assert", assert expected

Best result (in generation 0):
{size=2; repr=00011100100000010001; vals=(92.0, 30.0);
fit=-0.07492598692312624}
--------------------------------------------------
at
org.jaga.selection.RouletteWheelSelection.getRelativeFitnessValue(RouletteWheelSelection.java:118)
at
org.jaga.selection.RouletteWheelSelection.calculateCumulativeFitness(RouletteWheelSelection.java:82)
at
org.jaga.selection.RouletteWheelSelection.select(RouletteWheelSelection.java:71)
at
org.jaga.masterAlgorithm.SimpleGA.selectForReproduction(SimpleGA.java:149)
at
org.jaga.masterAlgorithm.SimpleGA.generateNextPopulation(SimpleGA.java:82)
at
org.jaga.masterAlgorithm.SimpleGA.exec(SimpleGA.java:60)
at
org.jaga.masterAlgorithm.ReusableSimpleGA.exec(ReusableSimpleGA.java:50)
at
org.jaga.exampleApplications.Example2.exec(Example2.java:66)
at
org.jaga.exampleApplications.Example2.main(Example2.java:80)
Exception in thread "main"

Discussion

  • Greg Paperin

    Greg Paperin - 2004-05-06
    • priority: 5 --> 9
    • assigned_to: nobody --> gragus
     
  • Greg Paperin

    Greg Paperin - 2004-05-06

    Logged In: YES
    user_id=1016872

    Hi,

    thanks very much for bringing this to my attention.

    I will look into this over the weekend and post a solution
    ASAP.

    Best Regards,

    Greg.

     
  • Greg Paperin

    Greg Paperin - 2004-05-06

    Logged In: YES
    user_id=1016872

    Oh, just thougt of something:

    which version of JDK are you using with Eclipse?
    JAGA requires JDK 1.4.1 or higher (because it uses the assert
    keyword). Also, please check for the options
    javac -source 1.4
    and
    java -ea
    or equivalent options in Eclipse.

    It could be that you have the assert-keywords disabled.

    It is just a thought - I will look into it properly on the
    weekend.

    Cheers,

    Greg.

     
  • Humberto Santos

    Humberto Santos - 2004-05-07

    Logged In: YES
    user_id=657390

    I'm using in Eclipse

    Compiler compliance level: 1.4

    and used J2SDK 1.4.2_04

     
  • Humberto Santos

    Humberto Santos - 2004-05-21

    Logged In: YES
    user_id=657390

    I think I found the solution!

    In package
    org.jaga.individualRepresentation.greycodedNumbers the class
    NDecimalsIndividualSimpleFactory I thing the function
    getDecimalScale() should be changed to:

    public int getDecimalScale() {
    //double scal = Math.log(decimalScale) / Math.log(10); //
    i.e. log(10, scale)
    //return (byte) scal;
    return (int) decimalScale;
    }

    Without this change, the valid() function in the same class
    will have problems here:
    if (indiv.getDecimalScale() != this.getDecimalScale()
    || indiv.getSize() != this.getIndividualSize()
    || indiv.getPrecision() != this.getPrecision()) {
    throw new IllegalArgumentException("The given individual
    (" + indiv
    + ") is likely not created by this factory.");
    }

    and throw off.

    Whith that chage my program start to work and also the
    Example2.class

    What you think?

     
  • Vermaak

    Vermaak - 2004-06-17

    Logged In: YES
    user_id=1065315

    Yes, I'm another end user and had the same problem,
    compiling with JDK1.4 under eclipse. Commented out the
    asserts for now.

     
  • Vermaak

    Vermaak - 2004-06-17

    Logged In: YES
    user_id=1065315

    Excellent! Looking forward to using this library.

    I am using Java 1.4.2 as well, so it can't be that.

     
  • Nobody/Anonymous

    Logged In: NO

    About that getDecimalScale() problem. Don't you have to
    change setDecimalScale(int value) too ?

     

Log in to post a comment.

MongoDB Logo MongoDB