コード例 #1
0
 /**
  * Reset this optimization algorithm. This does also reset the iteration counter but doesn't
  * affect the total iteration counter.
  */
 @Override
 public void reset() {
   super.reset();
   this.m_innerPipe.eof();
   synchronized (this.m_pop1) {
     this.m_pop1.clear();
   }
   synchronized (this.m_pop2) {
     this.m_pop2.clear();
   }
 }
コード例 #2
0
  /**
   * this method is invoked before each iteration is performed
   *
   * @param index the index of the current itertion
   */
  @Override
  protected void beforeIteration(final long index) { //
    IPopulation<G, PP> p;
    super.beforeIteration(index);

    synchronized (this) {
      p = this.m_pop1;
      this.m_pop1 = this.m_pop2;
      this.m_pop2 = p;
    }
    p.clear();
    this.m_innerPipe.setOutputPipe(p);
  }
コード例 #3
0
  /**
   * Set that this activity is finished. This leads to a transition into the state <code>TERMINATED
   * </code>.
   */
  @Override
  protected void finished() {
    IPipeIn<? super G, ? super PP> p1;
    IPipe<G, PP> p2, p3;

    p1 = this.getOutputPipe();

    if (p1 != null) {
      p2 = new NonPrevalenceFilter<G, PP>();
      p2.setOutputPipe(p1);
      p3 = new NoEofPipe<G, PP>();
      p3.setOutputPipe(p2);
      this.outputResults(p3);
      p2.eof();
    }

    super.finished();
  }
コード例 #4
0
 /**
  * this method is invoked after each iteration is performed
  *
  * @param index the index of the current itertion
  */
 @Override
 protected void afterIteration(final long index) { //
   this.getHost().flushJobs();
   super.afterIteration(index);
 }