ECJ-INTEREST-L Archives

December 2018

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eric 'Siggy' Scott <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Sun, 9 Dec 2018 17:30:34 -0500
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (1723 bytes) , text/html (2892 bytes)
Hi Adrián,

The problem is that NSGA2 expects to be working with Fitness objects that
are specifically of type NSGA2Fitness (which is itself a subclass of
MultiObjectiveFitness).

If you have your CustomFitness class inherent from NSGA2Fitness instead of
MultiObjectiveFitness, you should be good to go.

Thanks,
Siggy

On Sun, Dec 9, 2018 at 4:38 PM Adrián Romero Cáceres <
[log in to unmask]> wrote:

> Hello!
>
> I have implemented a new betterThan operator into a CustomFitness class,
> which is an extended class of MultiObjectiveFitness.  I wrote
> pop.subpop.0.species.fitness = ec.multiobjective.CustomFitness inside my
> experiment param file. Once the execution starts, after the first
> generation fails, returning the next error:
>
> Exception in thread "main" java.lang.ClassCastException:
> ec.multiobjective.CustomFitness cannot be cast to
> ec.multiobjective.nsga2.NSGA2MultiObjectiveFitness
>          at
>
> ec.multiobjective.nsga2.NSGA2Breeder.assignFrontRanks(NSGA2Breeder.java:185)
>          at
> ec.multiobjective.nsga2.NSGA2Breeder.buildArchive(NSGA2Breeder.java:121)
>          at
> ec.multiobjective.nsga2.NSGA2Breeder.loadElites(NSGA2Breeder.java:82)
>          at ec.simple.SimpleBreeder.breedPopulation(SimpleBreeder.java:225)
>          at
> ec.multiobjective.nsga2.NSGA2Breeder.breedPopulation(NSGA2Breeder.java:113)
>          at
> ec.simple.SimpleEvolutionState.evolve(SimpleEvolutionState.java:104)
>          at ec.EvolutionState.run(EvolutionState.java:482)
>          at ec.Evolve.main(Evolve.java:771)
>
> I forgot something? Is it the right way to extend the betterThan operator?
>
> Thanks in advance,
> Adrián.
>


-- 

Doctoral Candidate, George Mason University
http://mason.gmu.edu/~escott8/


ATOM RSS1 RSS2