private int calcMessageBufferSize() { int count = 0; for (Factor factor : factors) { count += factor.getNeighbors().size(); } return count; }
public double getObjective() { double objective = 0; for (Factor<Factor> factor : factors) { if (factor instanceof ParticipantFactor) { continue; } objective += factor.evaluate(solution); } return objective; }
private void setFactorsMaxOp() { for (Factor factor : factors) { factor.setMaxOperator(op); } }
@SuppressWarnings("unchecked") private void setFactorsCommunicationAdapter() { for (Factor<Factor> factor : factors) { factor.setCommunicationAdapter(com); } }