예제 #1
0
 public void initByPopulation(Population pop, boolean reset) {
   this.m_Population = (Population) pop.clone();
   if (reset) {
     this.m_Population.init();
     this.m_Problem.evaluate(this.m_Population);
     this.firePropertyChangedEvent(Population.nextGenerationPerformed);
   }
 }
예제 #2
0
 /**
  * Return a SolutionSet of TribesExplorers (AbstractEAIndividuals) of which some where memory
  * particles, thus the returned population is larger than the current population.
  *
  * @return a population of possible solutions.
  */
 public InterfaceSolutionSet getAllSolutions() {
   // return population and memories?
   Population all = (Population) population.clone();
   List<TribesPosition> mems = swarm.collectMem();
   for (Iterator<TribesPosition> iterator = mems.iterator(); iterator.hasNext(); ) {
     TribesPosition tp = iterator.next();
     all.add(positionToExplorer(tp));
   }
   all.SetFunctionCalls(population.getFunctionCalls());
   all.setGenerationTo(population.getGeneration());
   // all.addPopulation(pop);
   return new SolutionSet(population, all);
 }