Changeset 11905
- Timestamp:
- 02/05/15 10:39:46 (10 years ago)
- Location:
- stable
- Files:
-
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11300,11302
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchImprovementOperator.cs
r11170 r11905 38 38 [Item("LocalSearchImprovementOperator", "A local search improvement operator.")] 39 39 [StorableClass] 40 public sealed class LocalSearchImprovementOperator : SingleSuccessorOperator, ILocalImprovement Operator, IStochasticOperator {40 public sealed class LocalSearchImprovementOperator : SingleSuccessorOperator, ILocalImprovementAlgorithmOperator, IStochasticOperator { 41 41 #region IGenericLocalImprovementOperator Properties 42 42 public Type ProblemType { get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); } } -
stable/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingImprovementOperator.cs
r11170 r11905 38 38 [Item("SimulatedAnnealingImprovementOperator", "A simulated annealing improvement operator.")] 39 39 [StorableClass] 40 public sealed class SimulatedAnnealingImprovementOperator : SingleSuccessorOperator, ILocalImprovement Operator, IStochasticOperator {40 public sealed class SimulatedAnnealingImprovementOperator : SingleSuccessorOperator, ILocalImprovementAlgorithmOperator, IStochasticOperator { 41 41 #region IGenericLocalImprovementOperator Properties 42 42 public Type ProblemType { get { return typeof(ISingleObjectiveHeuristicOptimizationProblem); } } -
stable/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs
r11170 r11905 283 283 private void ParameterizeLocalImprovementOperators() { 284 284 foreach (ILocalImprovementOperator op in LocalImprovementParameter.ValidValues) { 285 if (op != LocalImprovementParameter.Value) op.Problem = null;286 285 op.MaximumIterationsParameter.Value = null; 287 286 op.MaximumIterationsParameter.ActualName = LocalImprovementMaximumIterationsParameter.Name; 288 } 289 if (LocalImprovementParameter.Value != null) 290 LocalImprovementParameter.Value.Problem = Problem; 287 288 var algOp = op as ILocalImprovementAlgorithmOperator; 289 if (algOp != null && algOp != LocalImprovementParameter.Value) algOp.Problem = null; 290 } 291 if (LocalImprovementParameter.Value is ILocalImprovementAlgorithmOperator) 292 ((ILocalImprovementAlgorithmOperator)LocalImprovementParameter.Value).Problem = Problem; 291 293 } 292 294 private void InitializeLocalImprovementOperators() { 293 if (Problem == null) { 294 LocalImprovementParameter.ValidValues.Clear(); 295 } else { 296 foreach (var entry in LocalImprovementParameter.ValidValues.ToList()) { 297 if (!entry.ProblemType.IsAssignableFrom(Problem.GetType())) { 298 LocalImprovementParameter.ValidValues.Remove(entry); 299 } 295 LocalImprovementParameter.ValidValues.Clear(); 296 if (Problem != null) { 297 // Regular ILocalImprovementOperators queried from Problem 298 foreach (var op in Problem.Operators.OfType<ILocalImprovementOperator>().Where(x => !(x is ILocalImprovementAlgorithmOperator))) { 299 LocalImprovementParameter.ValidValues.Add(op); 300 300 } 301 foreach (ILocalImprovementOperator op in ApplicationManager.Manager.GetInstances<ILocalImprovementOperator>().Where(x => x.ProblemType.IsAssignableFrom(Problem.GetType()))) { 302 if (!LocalImprovementParameter.ValidValues.Any(x => x.GetType() == op.GetType())) 301 // ILocalImprovementAlgorithmOperators queried from ApplicationManager 302 var algOps = ApplicationManager.Manager.GetInstances<ILocalImprovementAlgorithmOperator>() 303 .Where(x => x.ProblemType.IsInstanceOfType(Problem)); 304 foreach (var op in algOps) { 305 if (LocalImprovementParameter.ValidValues.All(x => x.GetType() != op.GetType())) 303 306 LocalImprovementParameter.ValidValues.Add(op); 304 307 } -
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimization merged: 11300
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r9438 r11905 114 114 </ItemGroup> 115 115 <ItemGroup> 116 <Compile Include="Interfaces\ILocalImprovementAlgorithmOperator.cs" /> 116 117 <Compile Include="Interfaces\ISingleObjectivePathRelinker.cs" /> 117 118 <Compile Include="Interfaces\ISingleObjectiveImprovementOperator.cs" /> -
stable/HeuristicLab.Optimization/3.3/Interfaces/ILocalImprovementOperator.cs
r11170 r11905 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; … … 26 25 namespace HeuristicLab.Optimization { 27 26 public interface ILocalImprovementOperator : IOperator { 28 Type ProblemType { get; }29 IProblem Problem { get; set; }30 27 IValueLookupParameter<IntValue> MaximumIterationsParameter { get; } 31 28 ILookupParameter<IntValue> EvaluatedSolutionsParameter { get; } -
stable/HeuristicLab.Problems.QuadraticAssignment
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.QuadraticAssignment merged: 11300
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs
r11170 r11905 35 35 [StorableClass] 36 36 public class QAPExhaustiveInsertionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator { 37 38 public Type ProblemType {39 get { return typeof(QuadraticAssignmentProblem); }40 }41 42 [Storable]43 private QuadraticAssignmentProblem problem;44 public IProblem Problem {45 get { return problem; }46 set { problem = (QuadraticAssignmentProblem)value; }47 }48 37 49 38 public ILookupParameter<IntValue> LocalIterationsParameter { … … 87 76 protected QAPExhaustiveInsertionLocalImprovement(QAPExhaustiveInsertionLocalImprovement original, Cloner cloner) 88 77 : base(original, cloner) { 89 this.problem = cloner.Clone(original.problem);90 78 } 91 79 public QAPExhaustiveInsertionLocalImprovement() -
stable/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs
r11170 r11905 35 35 [StorableClass] 36 36 public class QAPExhaustiveInversionLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator { 37 38 public Type ProblemType {39 get { return typeof(QuadraticAssignmentProblem); }40 }41 42 [Storable]43 private QuadraticAssignmentProblem problem;44 public IProblem Problem {45 get { return problem; }46 set { problem = (QuadraticAssignmentProblem)value; }47 }48 37 49 38 public ILookupParameter<IntValue> LocalIterationsParameter { … … 87 76 protected QAPExhaustiveInversionLocalImprovement(QAPExhaustiveInversionLocalImprovement original, Cloner cloner) 88 77 : base(original, cloner) { 89 this.problem = cloner.Clone(original.problem);90 78 } 91 79 public QAPExhaustiveInversionLocalImprovement() -
stable/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs
r11170 r11905 35 35 [StorableClass] 36 36 public class QAPExhaustiveSwap2LocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator { 37 38 public Type ProblemType {39 get { return typeof(QuadraticAssignmentProblem); }40 }41 42 [Storable]43 private QuadraticAssignmentProblem problem;44 public IProblem Problem {45 get { return problem; }46 set { problem = (QuadraticAssignmentProblem)value; }47 }48 37 49 38 public ILookupParameter<IntValue> LocalIterationsParameter { … … 91 80 protected QAPExhaustiveSwap2LocalImprovement(QAPExhaustiveSwap2LocalImprovement original, Cloner cloner) 92 81 : base(original, cloner) { 93 this.problem = cloner.Clone(original.problem);94 82 } 95 83 public QAPExhaustiveSwap2LocalImprovement() -
stable/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs
r11170 r11905 35 35 [StorableClass] 36 36 public class QAPStochasticScrambleLocalImprovement : SingleSuccessorOperator, ILocalImprovementOperator, IStochasticOperator { 37 38 public Type ProblemType {39 get { return typeof(QuadraticAssignmentProblem); }40 }41 42 [Storable]43 private QuadraticAssignmentProblem problem;44 public IProblem Problem {45 get { return problem; }46 set { problem = (QuadraticAssignmentProblem)value; }47 }48 37 49 38 public ILookupParameter<IntValue> LocalIterationsParameter { … … 95 84 protected QAPStochasticScrambleLocalImprovement(QAPStochasticScrambleLocalImprovement original, Cloner cloner) 96 85 : base(original, cloner) { 97 this.problem = cloner.Clone(original.problem);98 86 } 99 87 public QAPStochasticScrambleLocalImprovement() -
stable/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
r11170 r11905 302 302 Operators.Add(new QAPAlleleFrequencyAnalyzer()); 303 303 Operators.Add(new QAPPopulationDiversityAnalyzer()); 304 305 Operators.Add(new QAPExhaustiveInsertionLocalImprovement()); 306 Operators.Add(new QAPExhaustiveInversionLocalImprovement()); 307 Operators.Add(new QAPStochasticScrambleLocalImprovement()); 304 308 Operators.Add(new QAPExhaustiveSwap2LocalImprovement()); 309 305 310 Operators.Add(new QAPSimilarityCalculator()); 306 311 ParameterizeAnalyzers(); -
stable/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 11300,11302
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs
r11170 r11905 37 37 [StorableClass] 38 38 public class AlbaLambdaInterchangeLocalImprovementOperator : VRPOperator, IStochasticOperator, ILocalImprovementOperator { 39 public Type ProblemType {40 get { return typeof(VehicleRoutingProblem); }41 }42 43 [Storable]44 private VehicleRoutingProblem problem;45 public IProblem Problem {46 get { return problem; }47 set { problem = (VehicleRoutingProblem)value; }48 }49 39 50 40 public IValueLookupParameter<IntValue> MaximumIterationsParameter { … … 84 74 protected AlbaLambdaInterchangeLocalImprovementOperator(AlbaLambdaInterchangeLocalImprovementOperator original, Cloner cloner) 85 75 : base(original, cloner) { 86 this.problem = cloner.Clone(original.problem);87 76 } 88 77 public AlbaLambdaInterchangeLocalImprovementOperator() … … 102 91 } 103 92 104 public static void Apply(AlbaEncoding solution, int maxIterations, 93 public static void Apply(AlbaEncoding solution, int maxIterations, 105 94 int lambda, int samples, IRandom random, IVRPProblemInstance problemInstance, ref double quality, out int evaluatedSolutions) { 106 95 evaluatedSolutions = 0; … … 120 109 } 121 110 } 122 if (bestMove != null) 111 if (bestMove != null) 123 112 AlbaLambdaInterchangeMoveMaker.Apply(solution, bestMove); 124 113 } -
stable/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r11333 r11905 33 33 using HeuristicLab.PluginInfrastructure; 34 34 using HeuristicLab.Problems.Instances; 35 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba; 35 36 using HeuristicLab.Problems.VehicleRouting.Interfaces; 36 37 using HeuristicLab.Problems.VehicleRouting.Interpreters; … … 263 264 defaultCreator = creator; 264 265 } 266 Operators.Add(new AlbaLambdaInterchangeLocalImprovementOperator()); 265 267 if (defaultCreator != null) 266 268 solutionCreatorParameter.Value = defaultCreator;
Note: See TracChangeset
for help on using the changeset viewer.