Changeset 8183 for trunk/sources/HeuristicLab.Problems.LinearAssignment
- Timestamp:
- 07/02/12 17:16:21 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/HungarianAlgorithm.cs
r8124 r8183 37 37 [Creatable("Algorithms")] 38 38 [StorableClass] 39 public sealed class HungarianAlgorithm : EngineAlgorithm { 39 public sealed class HungarianAlgorithm : EngineAlgorithm, IStorableContent { 40 public string Filename { get; set; } 41 40 42 #region Problem Properties 41 43 public override Type ProblemType { … … 68 70 private HungarianAlgorithm(HungarianAlgorithm original, Cloner cloner) 69 71 : base(original, cloner) { 70 AttachEventHandlers();72 RegisterEventHandlers(); 71 73 } 72 74 public HungarianAlgorithm() … … 83 85 84 86 UpdateAnalyzers(); 85 AttachEventHandlers();87 RegisterEventHandlers(); 86 88 87 89 Problem = new LinearAssignmentProblem(); … … 121 123 #region Helpers 122 124 [StorableHook(HookType.AfterDeserialization)] 123 private void AttachEventHandlers() { 125 private void AfterDeserialization() { 126 RegisterEventHandlers(); 127 } 128 129 private void RegisterEventHandlers() { 124 130 if (Problem != null) { 125 131 Problem.SolutionCreatorChanged += new EventHandler(Problem_SolutionCreatorChanged); -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/LAPAssignment.cs
r8093 r8183 30 30 [Item("LAP Assignment", "Represents a solution to the LAP.")] 31 31 [StorableClass] 32 public sealed class LAPAssignment : Item, INotifyPropertyChanged { 32 public sealed class LAPAssignment : Item, INotifyPropertyChanged, IStorableContent { 33 public string Filename { get; set; } 33 34 34 35 [Storable] … … 93 94 costs = cloner.Clone(original.costs); 94 95 assignment = cloner.Clone(original.assignment); 96 rowNames = cloner.Clone(original.rowNames); 97 columnNames = cloner.Clone(original.columnNames); 95 98 quality = cloner.Clone(original.quality); 96 99 } … … 117 120 } 118 121 119 120 122 public event PropertyChangedEventHandler PropertyChanged; 121 123 private void OnPropertyChanged(string propertyName) { -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblem.cs
r8093 r8183 36 36 [Creatable("Problems")] 37 37 [StorableClass] 38 public sealed class LinearAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<ILAPEvaluator, IPermutationCreator> {38 public sealed class LinearAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<ILAPEvaluator, IPermutationCreator>, IStorableContent { 39 39 public static readonly string CostsDescription = "The cost matrix that describes the assignment of rows to columns."; 40 40 public static readonly string RowNamesDescription = "The elements represented by the rows of the costs matrix."; 41 41 public static readonly string ColumnNamesDescription = "The elements represented by the columns of the costs matrix."; 42 43 public string Filename { get; set; } 42 44 43 45 public override Image ItemImage { … … 108 110 ((OptionalValueParameter<StringArray>)ColumnNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false; 109 111 110 RowNames = new StringArray(new string[] { " Human", "Von Neumann machine", "Quantum computer" });111 ColumnNames = new StringArray(new string[] { " Find a person's e-mail address", "Compute first 1000 decimals of Pi", "Factorize large integers" });112 Costs[0, 0] = 1; Costs[0, 1] = 10; Costs[0, 2] = 100;113 Costs[1, 0] = 10; Costs[1, 1] = 1; Costs[1, 2] = 100;114 Costs[2, 0] = 100; Costs[2, 1] = 10; Costs[2, 1] = 1;112 RowNames = new StringArray(new string[] { "Eric", "Robert", "Allison" }); 113 ColumnNames = new StringArray(new string[] { "MRI", "Blood test", "Angiogram" }); 114 Costs[0, 0] = 4; Costs[0, 1] = 5; Costs[0, 2] = 3; 115 Costs[1, 0] = 6; Costs[1, 1] = 6; Costs[1, 2] = 4; 116 Costs[2, 0] = 5; Costs[2, 1] = 5; Costs[2, 2] = 1; 115 117 116 118 bestLAPSolutionAnalyzer = new BestLAPSolutionAnalyzer();
Note: See TracChangeset
for help on using the changeset viewer.