- Timestamp:
- 06/10/11 16:18:44 (13 years ago)
- Location:
- branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 HeuristicLab.Problems.Scheduling-3.3.csproj.user
-
- Property svn:ignore
-
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MakespanEvaluator.cs
r6293 r6406 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Common; 26 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.ScheduleEncoding; 27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common;29 using HeuristicLab.Data;30 using HeuristicLab.Optimization;31 using HeuristicLab.Parameters;32 using HeuristicLab.Encodings.SchedulingEncoding;33 27 34 namespace HeuristicLab.Problems.Scheduling .Evaluators{28 namespace HeuristicLab.Problems.Scheduling { 35 29 [Item("Makespan Evaluator", "Represents an evaluator using the maximum makespan of a schedule.")] 36 30 [StorableClass] … … 45 39 } 46 40 47 public MakespanEvaluator () : base() { }41 public MakespanEvaluator() : base() { } 48 42 49 43 protected override DoubleValue evaluate(Schedule schedule) { 50 DoubleValue quality = new DoubleValue 44 DoubleValue quality = new DoubleValue(0); 51 45 foreach (Resource r in schedule.Resources) { 52 46 if (r.TotalDuration.Value > quality.Value) { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MeanTardinessEvaluator.cs
r6364 r6406 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Common; 26 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.ScheduleEncoding; 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Common;29 using HeuristicLab.Data;30 using HeuristicLab.Optimization;31 using HeuristicLab.Parameters;32 using HeuristicLab.Encodings.SchedulingEncoding;33 using HeuristicLab.Problems.Scheduling.Interfaces;34 28 35 namespace HeuristicLab.Problems.Scheduling .Evaluators{29 namespace HeuristicLab.Problems.Scheduling { 36 30 [Item("Mean tardiness Evaluator", "Represents an evaluator using the mean tardiness of a schedule.")] 37 31 [StorableClass] … … 57 51 #endregion 58 52 59 public MeanTardinessEvaluator() : base() { 53 public MeanTardinessEvaluator() 54 : base() { 60 55 Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.")); 61 56 } -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluationAlgorithm.cs
r6364 r6406 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.ScheduleEncoding; 26 26 using HeuristicLab.Operators; 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Core;29 using HeuristicLab.Common;30 using HeuristicLab.Optimization;31 using HeuristicLab.Data;32 using HeuristicLab.Parameters;33 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces;34 using HeuristicLab.Encodings.SchedulingEncoding;35 29 36 namespace HeuristicLab.Problems.Scheduling .Evaluators{30 namespace HeuristicLab.Problems.Scheduling { 37 31 [Item("Scheduling Evaluation Algorithm", "Represents a composition of a decoder and an evaluator for scheduling problems.")] 38 32 [StorableClass] 39 public class SchedulingEvaluationAlgorithm : AlgorithmOperator, ISchedul ingEvaluationAlgorithm {33 public class SchedulingEvaluationAlgorithm : AlgorithmOperator, IScheduleEvaluationAlgorithm { 40 34 [StorableConstructor] 41 35 protected SchedulingEvaluationAlgorithm(bool deserializing) : base(deserializing) { } 42 36 protected SchedulingEvaluationAlgorithm(SchedulingEvaluationAlgorithm original, Cloner cloner) 43 37 : base(original, cloner) { 44 38 this.evaluator = cloner.Clone(original.evaluator); 45 39 } 46 40 public override IDeepCloneable Clone(Cloner cloner) { … … 60 54 } 61 55 62 public void InitializeOperatorGraph<T>(Schedul ingDecoder<T> decoder) where T: Item, ISchedulingEncoding{56 public void InitializeOperatorGraph<T>(ScheduleDecoder<T> decoder) where T : Item, IScheduleEncoding { 63 57 OperatorGraph.Operators.Clear(); 64 58 OperatorGraph.InitialOperator = decoder; … … 68 62 public SchedulingEvaluationAlgorithm() 69 63 : base() { 70 71 72 64 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution.")); 65 evaluator = new Placeholder(); 66 evaluator.OperatorParameter.ActualName = "SolutionEvaluator"; 73 67 } 74 68 -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs
r6364 r6406 20 20 #endregion 21 21 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.ScheduleEncoding; 26 using HeuristicLab.Operators; 27 using HeuristicLab.Parameters; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 22 29 23 30 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 { 31 namespace HeuristicLab.Problems.Scheduling { 37 32 [Item("Scheduling Evaluator", "Represents a evaluator class for standard scheduling problems.")] 38 33 [StorableClass] 39 public abstract class SchedulingEvaluator : SingleSuccessorOperator, ISchedul ingEvaluator {34 public abstract class SchedulingEvaluator : SingleSuccessorOperator, IScheduleEvaluator { 40 35 [StorableConstructor] 41 36 protected SchedulingEvaluator(bool deserializing) : base(deserializing) { } … … 48 43 } 49 44 public ILookupParameter<DoubleValue> QualityParameter { 50 get { 45 get { 51 46 if (Parameters.ContainsKey("Quality")) 52 47 return (ILookupParameter<DoubleValue>)Parameters["Quality"]; … … 55 50 } 56 51 } 57 public ILookupParameter<Schedule> DecodedSchedulingSolutionParameter {58 get { return (ILookupParameter<Schedule>)Parameters[" DecodedSchedulingSolution"]; }52 public ILookupParameter<Schedule> ScheduleParameter { 53 get { return (ILookupParameter<Schedule>)Parameters["Schedule"]; } 59 54 } 60 55 61 public SchedulingEvaluator () : base () { 56 public SchedulingEvaluator() 57 : base() { 62 58 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.")); 64 60 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 65 61 } 66 62 67 63 protected abstract DoubleValue evaluate(Schedule schedule); 68 64 69 65 public override IOperation Apply() { 70 Schedule decodedSchedulingSolution = DecodedSchedulingSolutionParameter.ActualValue;71 QualityParameter.ActualValue = evaluate( decodedSchedulingSolution);66 Schedule schedule = ScheduleParameter.ActualValue; 67 QualityParameter.ActualValue = evaluate(schedule); 72 68 return base.Apply(); 73 69 }
Note: See TracChangeset
for help on using the changeset viewer.