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:
2 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/Evaluators/SchedulingEvaluator.cs

    r6364 r6406  
    2020#endregion
    2121
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
     24using HeuristicLab.Data;
     25using HeuristicLab.Encodings.ScheduleEncoding;
     26using HeuristicLab.Operators;
     27using HeuristicLab.Parameters;
     28using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2229
    2330
    24 using HeuristicLab.Core;
    25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Data;
    28 using HeuristicLab.Common;
    29 using HeuristicLab.Parameters;
    30 using System;
    31 using HeuristicLab.Operators;
    32 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces;
    33 using HeuristicLab.Encodings.SchedulingEncoding;
    34 
    35 
    36 namespace HeuristicLab.Problems.Scheduling.Evaluators {
     31namespace HeuristicLab.Problems.Scheduling {
    3732  [Item("Scheduling Evaluator", "Represents a evaluator class for standard scheduling problems.")]
    3833  [StorableClass]
    39   public abstract class SchedulingEvaluator : SingleSuccessorOperator, ISchedulingEvaluator {
     34  public abstract class SchedulingEvaluator : SingleSuccessorOperator, IScheduleEvaluator {
    4035    [StorableConstructor]
    4136    protected SchedulingEvaluator(bool deserializing) : base(deserializing) { }
     
    4843    }
    4944    public ILookupParameter<DoubleValue> QualityParameter {
    50       get { 
     45      get {
    5146        if (Parameters.ContainsKey("Quality"))
    5247          return (ILookupParameter<DoubleValue>)Parameters["Quality"];
     
    5550      }
    5651    }
    57     public ILookupParameter<Schedule> DecodedSchedulingSolutionParameter {
    58       get { return (ILookupParameter<Schedule>)Parameters["DecodedSchedulingSolution"]; }
     52    public ILookupParameter<Schedule> ScheduleParameter {
     53      get { return (ILookupParameter<Schedule>)Parameters["Schedule"]; }
    5954    }
    6055
    61     public SchedulingEvaluator () : base () {
     56    public SchedulingEvaluator()
     57      : base() {
    6258      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution."));
    63       Parameters.Add(new LookupParameter<Schedule>("DecodedSchedulingSolution", "The decoded scheduling solution represented as generalized schedule."));
     59      Parameters.Add(new LookupParameter<Schedule>("Schedule", "The decoded scheduling solution represented as generalized schedule."));
    6460      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    6561    }
    6662
    6763    protected abstract DoubleValue evaluate(Schedule schedule);
    68    
     64
    6965    public override IOperation Apply() {
    70       Schedule decodedSchedulingSolution = DecodedSchedulingSolutionParameter.ActualValue;
    71       QualityParameter.ActualValue = evaluate(decodedSchedulingSolution);
     66      Schedule schedule = ScheduleParameter.ActualValue;
     67      QualityParameter.ActualValue = evaluate(schedule);
    7268      return base.Apply();
    7369    }
Note: See TracChangeset for help on using the changeset viewer.