Changeset 2891 for trunk/sources/HeuristicLab.Problems.TSP
- Timestamp:
- 03/01/10 04:46:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TSP/3.3/TSP.cs
r2890 r2891 75 75 public TSP() 76 76 : base() { 77 Parameters.Add(new OptionalValueParameter<BoolData>("Maximization", "Set to false as the Traveling Salesman Problem is a minimization problem.", new BoolData(false))); 78 Parameters.Add(new OptionalValueParameter<DoubleMatrixData>("Coordinates", "The x- and y-Coordinates of the cities.", new DoubleMatrixData(0, 0))); 79 Parameters.Add(new OptionalValueParameter<IPermutationCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.")); 80 Parameters.Add(new OptionalValueParameter<ITSPEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.")); 77 RandomPermutationCreator creator = new RandomPermutationCreator(); 78 TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator(); 79 80 Parameters.Add(new ValueParameter<BoolData>("Maximization", "Set to false as the Traveling Salesman Problem is a minimization problem.", new BoolData(false))); 81 Parameters.Add(new ValueParameter<DoubleMatrixData>("Coordinates", "The x- and y-Coordinates of the cities.", new DoubleMatrixData(0, 0))); 82 Parameters.Add(new ValueParameter<IPermutationCreator>("SolutionCreator", "The operator which should be used to create new TSP solutions.", creator)); 83 Parameters.Add(new ValueParameter<ITSPEvaluator>("Evaluator", "The operator which should be used to evaluate TSP solutions.", evaluator)); 81 84 Parameters.Add(new OptionalValueParameter<DoubleData>("BestKnownQuality", "The quality of the best known solution of this TSP instance.")); 85 86 creator.PermutationParameter.ActualName = "TSPTour"; 87 creator.LengthParameter.Value = new IntData(0); 88 evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name; 89 evaluator.PermutationParameter.ActualName = creator.PermutationParameter.ActualName; 90 evaluator.QualityParameter.ActualName = "TSPTourLength"; 82 91 83 92 MaximizationParameter.ValueChanged += new EventHandler(MaximizationParameter_ValueChanged); 84 93 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 85 94 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 86 87 RandomPermutationCreator creator = new RandomPermutationCreator();88 creator.PermutationParameter.ActualName = "TSPTour";89 creator.LengthParameter.Value = new IntData(0);90 SolutionCreatorParameter.Value = creator;91 TSPRoundedEuclideanPathEvaluator evaluator = new TSPRoundedEuclideanPathEvaluator();92 evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name;93 evaluator.PermutationParameter.ActualName = creator.PermutationParameter.ActualName;94 evaluator.QualityParameter.ActualName = "TSPTourLength";95 EvaluatorParameter.Value = evaluator;96 95 97 96 var ops = ApplicationManager.Manager.GetInstances<IPermutationOperator>();
Note: See TracChangeset
for help on using the changeset viewer.