Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/02/12 17:16:21 (10 years ago)
Author:
abeham
Message:

#1855:

  • Added IStorableContent to HungarianAlgorithm, LinearAssignmentProblem, and LAPAssignment (it was only storable, because the result is storable)
  • Added separate AfterDeserialization hook and renamed AttachEventHandlers to RegisterEventHandlers
  • Added cloning of rowNames and columnNames in LAPAssignment
  • Changed the default instance of the LinearAssignmentProblem
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblem.cs

    r8093 r8183  
    3636  [Creatable("Problems")]
    3737  [StorableClass]
    38   public sealed class LinearAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<ILAPEvaluator, IPermutationCreator> {
     38  public sealed class LinearAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<ILAPEvaluator, IPermutationCreator>, IStorableContent {
    3939    public static readonly string CostsDescription = "The cost matrix that describes the assignment of rows to columns.";
    4040    public static readonly string RowNamesDescription = "The elements represented by the rows of the costs matrix.";
    4141    public static readonly string ColumnNamesDescription = "The elements represented by the columns of the costs matrix.";
     42
     43    public string Filename { get; set; }
    4244
    4345    public override Image ItemImage {
     
    108110      ((OptionalValueParameter<StringArray>)ColumnNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
    109111
    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;
    115117
    116118      bestLAPSolutionAnalyzer = new BestLAPSolutionAnalyzer();
Note: See TracChangeset for help on using the changeset viewer.