Changeset 8086 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/Improvers/VRPImprovementOperator.cs
- Timestamp:
- 06/22/12 11:11:38 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting (added) merged: 7895,7900,7904,7906,7923,7934,7999,8006,8053
- Property svn:mergeinfo changed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.VehicleRouting/3.3/Improvers/VRPImprovementOperator.cs
r7821 r8086 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 25 26 using HeuristicLab.Operators; 26 27 using HeuristicLab.Optimization; 27 using HeuristicLab.Optimization.Operators;28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 110 110 : base() { 111 111 #region Create parameters 112 Parameters.Add(new LookupParameter<DoubleValue>("Capacity" ));113 Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates" ));114 Parameters.Add(new ScopeParameter("CurrentScope" ));115 Parameters.Add(new LookupParameter<DoubleArray>("Demand" ));116 Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor" ));117 Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix" ));118 Parameters.Add(new LookupParameter<DoubleArray>("DueTime" ));119 Parameters.Add(new LookupParameter<IEvaluator>("Evaluator" ));120 Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor" ));121 Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", new IntValue(100)));122 Parameters.Add(new ValueParameter<IntValue>("Lambda", new IntValue(1)));123 Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty" ));124 Parameters.Add(new LookupParameter<IRandom>("Random" ));125 Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime" ));126 Parameters.Add(new ValueParameter<IntValue>("SampleSize", new IntValue(100)));127 Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime" ));128 Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty" ));129 Parameters.Add(new ValueLookupParameter<IItem>("Target" ));130 Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor" ));131 Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix" ));132 Parameters.Add(new LookupParameter<IntValue>("Vehicles" ));112 Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle.")); 113 Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities.")); 114 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope that contains the solution to be improved.")); 115 Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer.")); 116 Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation.")); 117 Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities.")); 118 Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer.")); 119 Parameters.Add(new LookupParameter<IEvaluator>("Evaluator", "The operator used to evaluate solutions.")); 120 Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation.")); 121 Parameters.Add(new ValueParameter<IntValue>("ImprovementAttempts", "The number of improvement attempts the operator should perform.", new IntValue(100))); 122 Parameters.Add(new ValueParameter<IntValue>("Lambda", "The number of neighbors that should be exchanged.", new IntValue(1))); 123 Parameters.Add(new LookupParameter<DoubleValue>("EvalOverloadPenalty", "The overload penalty considered in the evaluation.")); 124 Parameters.Add(new LookupParameter<IRandom>("Random", "A pseudo random number generator.")); 125 Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer.")); 126 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The number of moves that should be executed.", new IntValue(100))); 127 Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer.")); 128 Parameters.Add(new LookupParameter<DoubleValue>("EvalTardinessPenalty", "The tardiness penalty considered in the evaluation.")); 129 Parameters.Add(new ValueLookupParameter<IItem>("Target", "This parameter is used for name translation only.")); 130 Parameters.Add(new LookupParameter<DoubleValue>("EvalTimeFactor", "The time factor considered in the evaluation.")); 131 Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false")); 132 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles.")); 133 133 #endregion 134 134 } … … 143 143 AlbaEncoding.ConvertFrom(TargetParameter.ActualValue as IVRPEncoding, VehiclesParameter.ActualValue.Value, DistanceMatrixParameter); 144 144 145 if (solution == null) 146 throw new ArgumentException("Cannot improve solution because it has the wrong type."); 147 145 148 double quality = -1; 146 149 int evaluatedSolutions; … … 154 157 155 158 TargetParameter.ActualValue = PotvinEncoding.ConvertFrom(solution, DistanceMatrixParameter); 159 CurrentScopeParameter.ActualValue.Variables.Add(new Variable("LocalEvaluatedSolutions", new IntValue(evaluatedSolutions))); 156 160 157 161 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.