Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/06/11 11:23:43 (13 years ago)
Author:
jhelm
Message:

#1329: Did some minor refactoring.

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

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MeanTardinessEvaluator.cs

    r6293 r6364  
    3131using HeuristicLab.Parameters;
    3232using HeuristicLab.Encodings.SchedulingEncoding;
     33using HeuristicLab.Problems.Scheduling.Interfaces;
    3334
    3435namespace HeuristicLab.Problems.Scheduling.Evaluators {
    35   [Item("Men tardiness Evaluator", "Represents an evaluator using the mean tardiness of a schedule.")]
     36  [Item("Mean tardiness Evaluator", "Represents an evaluator using the mean tardiness of a schedule.")]
    3637  [StorableClass]
    37   public class MeanTardinessEvaluator : SchedulingEvaluator {
     38  public class MeanTardinessEvaluator : SchedulingEvaluator, IJSSPOperator {
    3839    [StorableConstructor]
    3940    protected MeanTardinessEvaluator(bool deserializing) : base(deserializing) { }
     
    4647
    4748    #region Parameter Properties
    48     public ILookupParameter<ItemList<Job>> JobsParameter {
    49       get { return (ILookupParameter<ItemList<Job>>)Parameters["Jobs"]; }
     49    public ILookupParameter<ItemList<Job>> JobDataParameter {
     50      get { return (ILookupParameter<ItemList<Job>>)Parameters["JobData"]; }
    5051    }
    5152    #endregion
    5253    #region Properties
    53     public ItemList<Job> Jobs {
    54       get { return JobsParameter.ActualValue; }
     54    public ItemList<Job> JobData {
     55      get { return JobDataParameter.ActualValue; }
    5556    }
    5657    #endregion
    5758
    5859    public MeanTardinessEvaluator() : base() {
    59       Parameters.Add(new LookupParameter<ItemList<Job>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance."));
     60      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance."));
    6061    }
    6162
     
    6364      double totalTardiness = 0;
    6465      foreach (Resource r in schedule.Resources) {
    65         double tardiness = r.Tasks[r.Tasks.Count - 1].EndTime.Value - Jobs[r.Tasks[r.Tasks.Count - 1].JobNr.Value].DueDate.Value;
     66        double tardiness = r.Tasks[r.Tasks.Count - 1].EndTime.Value - JobData[r.Tasks[r.Tasks.Count - 1].JobNr.Value].DueDate.Value;
    6667        if (tardiness > 0)
    6768          totalTardiness += tardiness;
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluationAlgorithm.cs

    r6293 r6364  
    3535
    3636namespace HeuristicLab.Problems.Scheduling.Evaluators {
    37   [Item("Scheduling Evaluator", "Represents a general evaluator class for scheduling problems.")]
     37  [Item("Scheduling Evaluation Algorithm", "Represents a composition of a decoder and an evaluator for scheduling problems.")]
    3838  [StorableClass]
    39   public class SchedulingEvaluationAlgorithm : AlgorithmOperator, ISchedulingEvaluator {
     39  public class SchedulingEvaluationAlgorithm : AlgorithmOperator, ISchedulingEvaluationAlgorithm {
    4040    [StorableConstructor]
    4141    protected SchedulingEvaluationAlgorithm(bool deserializing) : base(deserializing) { }
    4242    protected SchedulingEvaluationAlgorithm(SchedulingEvaluationAlgorithm original, Cloner cloner)
    4343      : base(original, cloner) {
     44        this.evaluator = cloner.Clone(original.evaluator);
    4445    }
    4546    public override IDeepCloneable Clone(Cloner cloner) {
    4647      return new SchedulingEvaluationAlgorithm(this, cloner);
    4748    }
     49
     50    [Storable]
     51    private Placeholder evaluator;
    4852
    4953    public ILookupParameter<DoubleValue> QualityParameter {
     
    5660    }
    5761
    58     public void InitializeOperatorGraph<T>(SchedulingDecoder<T> decoder, SchedulingEvaluator evaluator) where T: Item, ISchedulingEncoding{
     62    public void InitializeOperatorGraph<T>(SchedulingDecoder<T> decoder) where T: Item, ISchedulingEncoding{
    5963      OperatorGraph.Operators.Clear();
    6064      OperatorGraph.InitialOperator = decoder;
     
    6569      : base() {
    6670        Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution."));
     71        evaluator = new Placeholder();
     72        evaluator.OperatorParameter.ActualName = "SolutionEvaluator";
    6773    }
    6874
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs

    r6293 r6364  
    3535
    3636namespace HeuristicLab.Problems.Scheduling.Evaluators {
    37   [Item("JSSP Evaluator", "Represents a evaluator class for standard job shop scheduling problems.")]
     37  [Item("Scheduling Evaluator", "Represents a evaluator class for standard scheduling problems.")]
    3838  [StorableClass]
    3939  public abstract class SchedulingEvaluator : SingleSuccessorOperator, ISchedulingEvaluator {
Note: See TracChangeset for help on using the changeset viewer.