- Timestamp:
- 06/06/11 11:23:43 (13 years ago)
- 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 31 31 using HeuristicLab.Parameters; 32 32 using HeuristicLab.Encodings.SchedulingEncoding; 33 using HeuristicLab.Problems.Scheduling.Interfaces; 33 34 34 35 namespace HeuristicLab.Problems.Scheduling.Evaluators { 35 [Item("Me n 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.")] 36 37 [StorableClass] 37 public class MeanTardinessEvaluator : SchedulingEvaluator {38 public class MeanTardinessEvaluator : SchedulingEvaluator, IJSSPOperator { 38 39 [StorableConstructor] 39 40 protected MeanTardinessEvaluator(bool deserializing) : base(deserializing) { } … … 46 47 47 48 #region Parameter Properties 48 public ILookupParameter<ItemList<Job>> Job sParameter {49 get { return (ILookupParameter<ItemList<Job>>)Parameters["Job s"]; }49 public ILookupParameter<ItemList<Job>> JobDataParameter { 50 get { return (ILookupParameter<ItemList<Job>>)Parameters["JobData"]; } 50 51 } 51 52 #endregion 52 53 #region Properties 53 public ItemList<Job> Job s{54 get { return Job sParameter.ActualValue; }54 public ItemList<Job> JobData { 55 get { return JobDataParameter.ActualValue; } 55 56 } 56 57 #endregion 57 58 58 59 public MeanTardinessEvaluator() : base() { 59 Parameters.Add(new LookupParameter<ItemList<Job>>("Job s", "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.")); 60 61 } 61 62 … … 63 64 double totalTardiness = 0; 64 65 foreach (Resource r in schedule.Resources) { 65 double tardiness = r.Tasks[r.Tasks.Count - 1].EndTime.Value - Job s[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; 66 67 if (tardiness > 0) 67 68 totalTardiness += tardiness; -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluationAlgorithm.cs
r6293 r6364 35 35 36 36 namespace HeuristicLab.Problems.Scheduling.Evaluators { 37 [Item("Scheduling Evaluat or", "Represents a general evaluator classfor scheduling problems.")]37 [Item("Scheduling Evaluation Algorithm", "Represents a composition of a decoder and an evaluator for scheduling problems.")] 38 38 [StorableClass] 39 public class SchedulingEvaluationAlgorithm : AlgorithmOperator, ISchedulingEvaluat or{39 public class SchedulingEvaluationAlgorithm : AlgorithmOperator, ISchedulingEvaluationAlgorithm { 40 40 [StorableConstructor] 41 41 protected SchedulingEvaluationAlgorithm(bool deserializing) : base(deserializing) { } 42 42 protected SchedulingEvaluationAlgorithm(SchedulingEvaluationAlgorithm original, Cloner cloner) 43 43 : base(original, cloner) { 44 this.evaluator = cloner.Clone(original.evaluator); 44 45 } 45 46 public override IDeepCloneable Clone(Cloner cloner) { 46 47 return new SchedulingEvaluationAlgorithm(this, cloner); 47 48 } 49 50 [Storable] 51 private Placeholder evaluator; 48 52 49 53 public ILookupParameter<DoubleValue> QualityParameter { … … 56 60 } 57 61 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{ 59 63 OperatorGraph.Operators.Clear(); 60 64 OperatorGraph.InitialOperator = decoder; … … 65 69 : base() { 66 70 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution.")); 71 evaluator = new Placeholder(); 72 evaluator.OperatorParameter.ActualName = "SolutionEvaluator"; 67 73 } 68 74 -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs
r6293 r6364 35 35 36 36 namespace HeuristicLab.Problems.Scheduling.Evaluators { 37 [Item(" JSSP Evaluator", "Represents a evaluator class for standard job shopscheduling problems.")]37 [Item("Scheduling Evaluator", "Represents a evaluator class for standard scheduling problems.")] 38 38 [StorableClass] 39 39 public abstract class SchedulingEvaluator : SingleSuccessorOperator, ISchedulingEvaluator {
Note: See TracChangeset
for help on using the changeset viewer.