- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Evaluators/KnapsackEvaluator.cs
r3537 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;22 using System; 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.BinaryVectorEncoding; 26 using HeuristicLab.Operators; 25 27 using HeuristicLab.Parameters; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Encodings.BinaryVectorEncoding;28 using HeuristicLab.Operators;29 using System;30 29 31 30 namespace HeuristicLab.Problems.Knapsack { … … 51 50 get { return (ILookupParameter<DoubleValue>)Parameters["AppliedPenalty"]; } 52 51 } 53 52 54 53 public ILookupParameter<BinaryVector> BinaryVectorParameter { 55 54 get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; } … … 110 109 if (weight > capacity.Value) { 111 110 appliedPenalty = penalty.Value * (weight - capacity.Value); 112 } 111 } 113 112 114 quality = 113 quality = value - appliedPenalty; 115 114 116 115 result.AppliedPenalty = new DoubleValue(appliedPenalty); … … 126 125 127 126 KnapsackEvaluation evaluation = Apply(BinaryVectorParameter.ActualValue, 128 KnapsackCapacityParameter.ActualValue, 129 PenaltyParameter.ActualValue, 130 WeightsParameter.ActualValue, 127 KnapsackCapacityParameter.ActualValue, 128 PenaltyParameter.ActualValue, 129 WeightsParameter.ActualValue, 131 130 ValuesParameter.ActualValue); 132 131
Note: See TracChangeset
for help on using the changeset viewer.