Multiobjective example

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiobjective example

Naeem Shakir
hello everyone
when i run example i get an error
Exception in thread "main" java.lang.IllegalStateException: Population size must be greater 0
can anyone tell me what is wrong with example?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Multiobjective example

Klaus Meffert-5
Naem,
 
you are right, there is a problem somewhere in the code. It seems to be related either with the new bulk fitness evaluation or with the MO examples which might need adaptation.
 
I contacted the developer who added the new bulk evaluation logic, maybe he has an idea.
 
Best
 
 


From: Naeem Shakir [mailto:[hidden email]]
Sent: Friday, June 29, 2012 8:43 PM
To: mail to jgap
Subject: [jgap-users] Multiobjective example

hello everyone
when i run example i get an error
Exception in thread "main" java.lang.IllegalStateException: Population size must be greater 0
can anyone tell me what is wrong with example?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Multiobjective example

Klaus Meffert-5
In reply to this post by Naeem Shakir
Naeem.,
 
here is a hotfix for solving the problem:
 
In class org.jgap.impl.GABreeder please replace the code for the following two methods with:
 
  private Population removeEvaluatedChromosomes(Population a_from_pop,
      Configuration a_config)
      throws InvalidConfigurationException {
    Population to_pop = new Population(a_config);
    IChromosome selectedChromosome;
    for (int i = 0; i < a_from_pop.size(); i++) {
      selectedChromosome = a_from_pop.getChromosome(i);
      boolean hasFitness = selectedChromosome.getFitnessValueDirectly() !=
          FitnessFunction.NO_FITNESS_VALUE;
      if(!hasFitness) {
        if (selectedChromosome instanceof Chromosome) {
           if(((Chromosome)selectedChromosome).getMultiObjectives() != null) {
            hasFitness = true;
          }
        }
      }
      if (!hasFitness) {
        to_pop.addChromosome(selectedChromosome);
      }
    }
    return to_pop;
  }
 
  private Population removeChromosomesWithoutFitnessValue(Population a_from_pop,
      Configuration a_config)
      throws InvalidConfigurationException {
    Population to_pop = new Population(a_config);
    IChromosome selectedChromosome;
    for (int i = 0; i < a_from_pop.size(); i++) {
      selectedChromosome = a_from_pop.getChromosome(i);
      boolean hasFitness = selectedChromosome.getFitnessValueDirectly() !=
          FitnessFunction.NO_FITNESS_VALUE;
      if(!hasFitness) {
        if (selectedChromosome instanceof Chromosome) {
           if(((Chromosome)selectedChromosome).getMultiObjectives() != null) {
            hasFitness = true;
          }
        }
      }
      if (hasFitness) {
        to_pop.addChromosome(selectedChromosome);
      }
    }
    return to_pop;
  }
 
Best
 
 


From: Naeem Shakir [mailto:[hidden email]]
Sent: Friday, June 29, 2012 8:43 PM
To: mail to jgap
Subject: [jgap-users] Multiobjective example

hello everyone
when i run example i get an error
Exception in thread "main" java.lang.IllegalStateException: Population size must be greater 0
can anyone tell me what is wrong with example?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users