Ejemplo n.º 1
0
  /**
   * Creates a new DTLZ6 problem instance
   *
   * @param numberOfVariables Number of variables
   * @param numberOfObjectives Number of objective functions
   * @param solutionType The solution type must "Real" or "BinaryReal".
   */
  public DTLZ6(Integer numberOfVariables, Integer numberOfObjectives, String solutionType) {
    numberOfVariables_ = numberOfVariables.intValue();
    numberOfObjectives_ = numberOfObjectives.intValue();
    numberOfConstraints_ = 0;
    problemName_ = "DTLZ6";

    lowerLimit_ = new double[numberOfVariables_];
    upperLimit_ = new double[numberOfVariables_];
    for (int var = 0; var < numberOfVariables_; var++) {
      lowerLimit_[var] = 0.0;
      upperLimit_[var] = 1.0;
    } // for

    solutionType_ = Enum.valueOf(SolutionType_.class, solutionType);

    // All the variables are of the same type, so the solutionType name is the
    // same than the variableType name
    variableType_ = new VariableType_[numberOfVariables_];
    for (int var = 0; var < numberOfVariables_; var++) {
      variableType_[var] = Enum.valueOf(VariableType_.class, solutionType);
    } // for
  } // DTLZ6
Ejemplo n.º 2
0
  public QAP(String filename) throws FileNotFoundException, IOException {
    numberOfVariables_ = 1;
    numberOfObjectives_ = 2;
    numberOfConstraints_ = 0;
    problemName_ = "QAP";

    solutionType_ = SolutionType_.Permutation;

    variableType_ = new VariableType_[numberOfVariables_];
    length_ = new int[numberOfVariables_];

    variableType_[0] = Enum.valueOf(VariableType_.class, "Permutation");

    readProblem(filename);
    System.out.println(numberOfCities_);
    length_[0] = numberOfCities_;

    /*
    System.out.println();
    System.out.println("Matriz de flujo1");
       for (int k = 0; k < numberOfCities_; k++) {
                 for (int j =0; j < numberOfCities_; j++) {
                    System.out.print(flujo1[k][j] + "\t");
                 } // for
                 System.out.println();
         } // for

    System.out.println();
    System.out.println("Matriz de flujo2");
       for (int k = 0; k < numberOfCities_; k++) {
                 for (int j =0; j < numberOfCities_; j++) {
                    System.out.print(flujo2[k][j] + "\t");
                 } // for
                 System.out.println();
         } // for

      System.out.println();
      System.out.println("Matriz de distancias");
      for (int k = 0; k < numberOfCities_; k++) {
             for (int j =0; j < numberOfCities_; j++) {
                System.out.print(distanceMatrix_[k][j] + "\t");
             }
             System.out.println();
       }*/
  }