Changeset 13412 for branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs
- Timestamp:
- 11/28/15 23:38:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PTSP/HeuristicLab.Problems.PTSP.Views/3.3/ProbabilisticTravelingSalesmanProblemView.cs
r12269 r13412 21 21 22 22 using System; 23 using System.Windows.Forms;23 using HeuristicLab.Data; 24 24 using HeuristicLab.MainForm; 25 25 using HeuristicLab.Optimization.Views; 26 using HeuristicLab.Problems.PTSP; 27 using HeuristicLab.Data; 26 using HeuristicLab.Random; 28 27 29 28 namespace HeuristicLab.Problems.PTSP.Views { … … 40 39 41 40 /// <summary> 42 /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesman View"/>.41 /// Initializes a new instance of <see cref="ProbabilisticTravelingSalesmanProblemView"/>. 43 42 /// </summary> 44 43 public ProbabilisticTravelingSalesmanProblemView() { … … 47 46 48 47 protected override void DeregisterContentEvents() { 49 Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged); 50 Content.ProbabilityMatrixParameter.ValueChanged -= new EventHandler(ProbabilityParameter_ValueChanged); 51 //Content.BestKnownQualityParameter.ValueChanged -= new EventHandler(BestKnownQualityParameter_ValueChanged); 52 Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged); 48 Content.CoordinatesParameter.ValueChanged -= CoordinatesParameter_ValueChanged; 49 Content.ProbabilitiesParameter.ValueChanged -= ProbabilityParameter_ValueChanged; 50 Content.BestKnownSolutionParameter.ValueChanged -= BestKnownSolutionParameter_ValueChanged; 53 51 base.DeregisterContentEvents(); 54 52 } 55 53 protected override void RegisterContentEvents() { 56 54 base.RegisterContentEvents(); 57 Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 58 Content.ProbabilityMatrixParameter.ValueChanged += new EventHandler(ProbabilityParameter_ValueChanged); 59 //Content.BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged); 60 Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged); 55 Content.CoordinatesParameter.ValueChanged += CoordinatesParameter_ValueChanged; 56 Content.ProbabilitiesParameter.ValueChanged += ProbabilityParameter_ValueChanged; 57 Content.BestKnownSolutionParameter.ValueChanged += BestKnownSolutionParameter_ValueChanged; 61 58 } 62 59 protected override void OnContentChanged() { … … 65 62 pathPTSPTourView.Content = null; 66 63 } else { 67 pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.Probabilit yMatrix, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality));64 pathPTSPTourView.Content = new PathPTSPTour(Content.Coordinates, Content.Probabilities, Content.BestKnownSolution, new DoubleValue(Content.BestKnownQuality)); 68 65 } 69 66 } … … 77 74 pathPTSPTourView.Content.Coordinates = Content.Coordinates; 78 75 } 79 80 76 private void ProbabilityParameter_ValueChanged(object sender, EventArgs e) { 81 pathPTSPTourView.Content.Probabilities = Content.ProbabilityMatrix; 82 } 83 private void BestKnownQualityParameter_ValueChanged(object sender, EventArgs e) { 84 pathPTSPTourView.Content.Quality = new DoubleValue(Content.BestKnownQuality); 77 pathPTSPTourView.Content.Probabilities = Content.Probabilities; 85 78 } 86 79 private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) { 87 80 pathPTSPTourView.Content.Permutation = Content.BestKnownSolution; 81 pathPTSPTourView.Content.Quality = new DoubleValue(Content.Evaluate(Content.BestKnownSolution, new MersenneTwister())); 88 82 } 89 83 }
Note: See TracChangeset
for help on using the changeset viewer.