Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/11 12:49:03 (14 years ago)
Author:
mkommend
Message:

#1479: Merged trunk changes into branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPEvaluator.cs

    r5838 r6377  
    6969    }
    7070
     71    public static double Impact(int facility, Permutation assignment, DoubleMatrix weights, DoubleMatrix distances) {
     72      double impact = 0;
     73      for (int i = 0; i < assignment.Length; i++) {
     74        impact += weights[facility, i] * distances[assignment[facility], assignment[i]];
     75        impact += weights[i, facility] * distances[assignment[i], assignment[facility]];
     76      }
     77      return impact;
     78    }
     79
    7180    public override IOperation Apply() {
    7281      Permutation assignment = PermutationParameter.ActualValue;
Note: See TracChangeset for help on using the changeset viewer.