Changeset 6406 for branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs
- Timestamp:
- 06/10/11 16:18:44 (13 years ago)
- 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 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/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.