Пример #1
0
  /**
   * This method is used to evaluate the first population,that it is called after the calling to
   * <code>setup</code> method
   *
   * @throws JMException
   */
  public void evaluatePopulation() throws JMException {
    // NOTEIT First evaluation of the SolutionSet

    int loadingPosition = population_.getLoadingPosition();

    // Commented by Bernabe Dorronsoro
    //		if ( ( specialSolution_ != null ) ){
    //
    //			DecisionVariables[] best = new DecisionVariables[problem_.getNumberOfIslands()-1];
    //
    //			population_.clear();
    //			for( int f=0 ; f<populationSize_ ; ++f) {
    //				DecisionVariables specialDV   = problem_.generateSpecial( specialSolution_ );
    //				if ( f < numberOfSolutions_ ){
    //					for( int i=0 ; i<problem_.getNumberOfIslands() ; ++i ){
    //						if (i<loadingPosition)
    //							best[i] = new DecisionVariables( specialDV.extractSlice(i) );
    //						if (i>loadingPosition)
    //							best[i-1] = new DecisionVariables( specialDV.extractSlice(i) );
    //					} // for
    //
    //					population_.setBestRow( best , f );
    //				} // if
    //
    //				DecisionVariables decisionVar = new DecisionVariables( specialDV.extractSlice(
    // loadingPosition ) );
    //				Solution S = new Solution( problem_ , decisionVar );
    //				population_.add( S );
    //				S.unLink();
    //			} // for
    //
    //		} // if

    Iterator<Solution> it = population_.iterator();
    while (it.hasNext()) {
      Solution tmp = it.next();
      tmp.unLink();
      population_.linkExternalDecisionVariables(tmp);
      problem_.evaluate(tmp, loadingPosition);
      problem_.evaluateConstraints(tmp);
      ++evaluations_;
    } // while

    // population_.printObjectivesToFile( "FUN.S."+loadingPosition );
  } // evaluatePopulation