Exemple #1
0
  private int calcMessageBufferSize() {
    int count = 0;

    for (Factor factor : factors) {
      count += factor.getNeighbors().size();
    }

    return count;
  }
Exemple #2
0
  public double getObjective() {
    double objective = 0;

    for (Factor<Factor> factor : factors) {
      if (factor instanceof ParticipantFactor) {
        continue;
      }
      objective += factor.evaluate(solution);
    }

    return objective;
  }
Exemple #3
0
 private void setFactorsMaxOp() {
   for (Factor factor : factors) {
     factor.setMaxOperator(op);
   }
 }
Exemple #4
0
 @SuppressWarnings("unchecked")
 private void setFactorsCommunicationAdapter() {
   for (Factor<Factor> factor : factors) {
     factor.setCommunicationAdapter(com);
   }
 }