Beispiel #1
0
  private void normalizeServiceTemplateWeights() {

    // normalize the general criteria
    System.out.println("SYSTEM: Normalizing Service Template Weights");
    double total = 0;
    for (ServiceTemplate template : data.getServiceTemplates()) {
      total = total + template.getWeight();
    }

    for (ServiceTemplate template : data.getServiceTemplates()) {
      double res = template.getWeight() / total;
      System.out.println(
          "SYSTEM: Total: " + total + " || value: " + template.getWeight() + "|| res: " + res);
      template.setWeight((float) res);
    }
  }