Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 16:46:35 (12 years ago)
Author:
gkronber
Message:

#1847: merged r8084:8205 from trunk into GP move operators branch

Location:
branches/GP-MoveOperators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators

  • branches/GP-MoveOperators/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblem.cs

    r8022 r8206  
    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.";
     40    public static readonly string RowNamesDescription = "The elements represented by the rows of the costs matrix.";
     41    public static readonly string ColumnNamesDescription = "The elements represented by the columns of the costs matrix.";
     42
     43    public string Filename { get; set; }
    4044
    4145    public override Image ItemImage {
     
    5256    public IValueParameter<Permutation> BestKnownSolutionParameter {
    5357      get { return (IValueParameter<Permutation>)Parameters["BestKnownSolution"]; }
     58    }
     59    public IValueParameter<StringArray> RowNamesParameter {
     60      get { return (IValueParameter<StringArray>)Parameters["RowNames"]; }
     61    }
     62    public IValueParameter<StringArray> ColumnNamesParameter {
     63      get { return (IValueParameter<StringArray>)Parameters["ColumnNames"]; }
    5464    }
    5565    #endregion
     
    5969      get { return CostsParameter.Value; }
    6070      set { CostsParameter.Value = value; }
     71    }
     72    public StringArray RowNames {
     73      get { return RowNamesParameter.Value; }
     74      set { RowNamesParameter.Value = value; }
     75    }
     76    public StringArray ColumnNames {
     77      get { return ColumnNamesParameter.Value; }
     78      set { ColumnNamesParameter.Value = value; }
    6179    }
    6280    public ItemSet<Permutation> BestKnownSolutions {
     
    85103      Parameters.Add(new OptionalValueParameter<ItemSet<Permutation>>("BestKnownSolutions", "The list of best known solutions which is updated whenever a new better solution is found or may be the optimal solution if it is known beforehand.", null));
    86104      Parameters.Add(new OptionalValueParameter<Permutation>("BestKnownSolution", "The best known solution which is updated whenever a new better solution is found or may be the optimal solution if it is known beforehand.", null));
    87      
     105      Parameters.Add(new OptionalValueParameter<StringArray>("RowNames", RowNamesDescription));
     106      Parameters.Add(new OptionalValueParameter<StringArray>("ColumnNames", ColumnNamesDescription));
     107
    88108      ((ValueParameter<DoubleMatrix>)CostsParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
     109      ((OptionalValueParameter<StringArray>)RowNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
     110      ((OptionalValueParameter<StringArray>)ColumnNamesParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
     111
     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;
    89117
    90118      bestLAPSolutionAnalyzer = new BestLAPSolutionAnalyzer();
Note: See TracChangeset for help on using the changeset viewer.