Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/10/11 16:18:44 (13 years ago)
Author:
jhelm
Message:

#1329: Applied suggestions from codereview. Added unit-tests. Renamed encoding-project.

Location:
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3

    • Property svn:ignore
      •  

        old new  
        22bin
        33obj
         4HeuristicLab.Problems.Scheduling-3.3.csproj.user
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs

    r6293 r6406  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    2422using System.Linq;
    25 using System.Text;
     23using HeuristicLab.Common;
     24using HeuristicLab.Core;
     25using HeuristicLab.Data;
     26using HeuristicLab.Encodings.ScheduleEncoding;
    2627using HeuristicLab.Optimization;
    27 using HeuristicLab.Core;
     28using HeuristicLab.Parameters;
    2829using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Common;
    30 using HeuristicLab.Parameters;
    31 using HeuristicLab.Data;
    32 using HeuristicLab.Encodings.SchedulingEncoding;
    3330
    34 namespace HeuristicLab.Problems.Scheduling.Analyzers {
     31namespace HeuristicLab.Problems.Scheduling {
    3532
    3633  [Item("BestSchedulingSolutionAnalyzer", "An operator for analyzing the best solution of Scheduling Problems given in schedule-representation.")]
     
    5350    }
    5451
    55     public BestSchedulingSolutionAnalyzer () : base () {
     52    public BestSchedulingSolutionAnalyzer()
     53      : base() {
    5654      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    5755    }
     
    5957    public override IOperation Apply() {
    6058      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    61       ItemArray<Schedule> solutions = SchedulingSolutionParameter.ActualValue;
     59      ItemArray<Schedule> solutions = ScheduleParameter.ActualValue;
    6260      ResultCollection results = ResultsParameter.ActualValue;
    6361      bool max = MaximizationParameter.ActualValue.Value;
     
    7977      if (bestSolution == null) {
    8078        bestSolution = (Schedule)solutions[i].Clone();
    81         bestSolution.Quality.Value = qualities [i].Value;
     79        bestSolution.Quality = (DoubleValue)qualities[i].Clone();
    8280        BestSolutionParameter.ActualValue = bestSolution;
    8381        results.Add(new Result("Best Scheduling Solution", bestSolution));
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/SchedulingAnalyzer.cs

    r6293 r6406  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Encodings.ScheduleEncoding;
    2626using HeuristicLab.Operators;
    2727using HeuristicLab.Optimization;
    2828using HeuristicLab.Parameters;
    29 using HeuristicLab.Data;
    30 using HeuristicLab.Core;
    3129using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    32 using HeuristicLab.Common;
    33 using HeuristicLab.Encodings.SchedulingEncoding;
    3430
    35 namespace HeuristicLab.Problems.Scheduling.Analyzers {
    36   [Item("Scheduling Analyzer", "Represents the generalized form of Analyzers for Scheduling Problems.")]
     31namespace HeuristicLab.Problems.Scheduling {
     32  [Item("SchedulingAnalyzer", "Represents the generalized form of Analyzers for Scheduling Problems.")]
    3733  [StorableClass]
    3834  public abstract class SchedulingAnalyzer : SingleSuccessorOperator, IAnalyzer {
     
    6258      get { return (LookupParameter<Schedule>)Parameters["BestKnownSolution"]; }
    6359    }
    64     public ScopeTreeLookupParameter<Schedule> SchedulingSolutionParameter {
    65       get { return (ScopeTreeLookupParameter<Schedule>)Parameters["DecodedSchedulingSolution"]; }
     60    public ScopeTreeLookupParameter<Schedule> ScheduleParameter {
     61      get { return (ScopeTreeLookupParameter<Schedule>)Parameters["Schedule"]; }
    6662    }
    6763    #endregion
    6864
    69     public SchedulingAnalyzer () : base() {
     65    public SchedulingAnalyzer()
     66      : base() {
    7067      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
    7168      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the JSSP solutions which should be analyzed."));
    72       Parameters.Add(new ScopeTreeLookupParameter<Schedule>("DecodedSchedulingSolution", "The solutions from which the best solution has to be chosen from."));
     69      Parameters.Add(new ScopeTreeLookupParameter<Schedule>("Schedule", "The solutions from which the best solution has to be chosen from."));
    7370      Parameters.Add(new LookupParameter<Schedule>("BestSolution", "The best JSSP solution."));
    7471      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best JSSP solution should be stored."));
Note: See TracChangeset for help on using the changeset viewer.