- Timestamp:
- 12/04/15 10:35:04 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs
r12012 r13435 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Common; … … 77 78 if (bestSolution == null) { 78 79 bestSolution = (Schedule)solutions[i].Clone(); 79 bestSolution.Quality = (DoubleValue)qualities[i].Clone();80 bestSolution.Quality = qualities[i].Value; 80 81 BestSolutionParameter.ActualValue = bestSolution; 81 82 results.Add(new Result("Best Scheduling Solution", bestSolution)); 82 83 } else { 83 if (max && bestSolution.Quality.Value < qualities[i].Value || 84 !max && bestSolution.Quality.Value > qualities[i].Value) { 85 bestSolution.Quality.Value = qualities[i].Value; 86 bestSolution.Resources = (ItemList<Resource>)solutions[i].Resources.Clone(); 84 if (max && bestSolution.Quality < qualities[i].Value || 85 !max && bestSolution.Quality > qualities[i].Value) { 86 bestSolution.Quality = qualities[i].Value; 87 bestSolution.Resources.Clear(); 88 bestSolution.Resources.AddRange((IEnumerable<Resource>)solutions[i].Resources.Clone()); 87 89 } 88 90 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Decoders/JSMDecoder.cs
r12012 r13435 177 177 } 178 178 179 public override Schedule CreateScheduleFromEncoding(ISchedule Encodingencoding) {179 public override Schedule CreateScheduleFromEncoding(ISchedule encoding) { 180 180 var solution = encoding as JSMEncoding; 181 181 if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding"); -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Decoders/PRVDecoder.cs
r12012 r13435 202 202 } 203 203 204 public override Schedule CreateScheduleFromEncoding(ISchedule Encodingencoding) {204 public override Schedule CreateScheduleFromEncoding(ISchedule encoding) { 205 205 var solution = encoding as PRVEncoding; 206 if (solution == null) throw new InvalidOperationException("Encoding is not of type P WREncoding");206 if (solution == null) throw new InvalidOperationException("Encoding is not of type PRVEncoding"); 207 207 208 208 var jobs = (ItemList<Job>)JobDataParameter.ActualValue.Clone(); -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Decoders/PWRDecoder.cs
r12012 r13435 55 55 } 56 56 57 public override Schedule CreateScheduleFromEncoding(ISchedule Encodingencoding) {57 public override Schedule CreateScheduleFromEncoding(ISchedule encoding) { 58 58 var solution = encoding as PWREncoding; 59 59 if (solution == null) throw new InvalidOperationException("Encoding is not of type PWREncoding"); -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Decoders/ScheduleDecoder.cs
r12012 r13435 32 32 public abstract class ScheduleDecoder : SingleSuccessorOperator, IScheduleDecoder { 33 33 34 public ILookupParameter<ISchedule Encoding> ScheduleEncodingParameter {35 get { return (ILookupParameter<ISchedule Encoding>)Parameters["ScheduleEncoding"]; }34 public ILookupParameter<ISchedule> ScheduleEncodingParameter { 35 get { return (ILookupParameter<ISchedule>)Parameters["ScheduleEncoding"]; } 36 36 } 37 37 public ILookupParameter<Schedule> ScheduleParameter { … … 44 44 public ScheduleDecoder() 45 45 : base() { 46 Parameters.Add(new LookupParameter<ISchedule Encoding>("ScheduleEncoding", "The new scheduling solution represented as encoding."));46 Parameters.Add(new LookupParameter<ISchedule>("ScheduleEncoding", "The new scheduling solution represented as encoding.")); 47 47 Parameters.Add(new LookupParameter<Schedule>("Schedule", "The decoded scheduling solution represented as generalized schedule.")); 48 48 } 49 49 50 public abstract Schedule CreateScheduleFromEncoding(ISchedule Encodingsolution);50 public abstract Schedule CreateScheduleFromEncoding(ISchedule solution); 51 51 52 52 public override IOperation Apply() { -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Interfaces/IScheduleDecoder.cs
r12012 r13435 24 24 namespace HeuristicLab.Encodings.ScheduleEncoding { 25 25 public interface IScheduleDecoder : IOperator { 26 ILookupParameter<ISchedule Encoding> ScheduleEncodingParameter { get; }26 ILookupParameter<ISchedule> ScheduleEncodingParameter { get; } 27 27 ILookupParameter<Schedule> ScheduleParameter { get; } 28 28 } -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs
r13173 r13435 164 164 ScheduleEvaluatorParameter.ValueChanged += ScheduleEvaluatorParameter_ValueChanged; 165 165 ScheduleEvaluator.QualityParameter.ActualNameChanged += ScheduleEvaluator_QualityParameter_ActualNameChanged; 166 SolutionCreator.Schedule EncodingParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged;166 SolutionCreator.ScheduleParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged; 167 167 ScheduleDecoderParameter.ValueChanged += ScheduleDecoderParameter_ValueChanged; 168 168 if (ScheduleDecoder != null) ScheduleDecoder.ScheduleParameter.ActualNameChanged += ScheduleDecoder_ScheduleParameter_ActualNameChanged; … … 171 171 #region Events 172 172 protected override void OnSolutionCreatorChanged() { 173 SolutionCreator.Schedule EncodingParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged;173 SolutionCreator.ScheduleParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged; 174 174 InitializeOperators(); 175 175 } … … 288 288 289 289 if (ScheduleDecoder != null) 290 ScheduleDecoder.ScheduleEncodingParameter.ActualName = SolutionCreator.Schedule EncodingParameter.ActualName;290 ScheduleDecoder.ScheduleEncodingParameter.ActualName = SolutionCreator.ScheduleParameter.ActualName; 291 291 292 292 if (ScheduleDecoder != null) { … … 295 295 } else if (SolutionCreator is DirectScheduleRandomCreator) { 296 296 var directEvaluator = (DirectScheduleRandomCreator)SolutionCreator; 297 ScheduleEvaluator.ScheduleParameter.ActualName = directEvaluator.Schedule EncodingParameter.ActualName;297 ScheduleEvaluator.ScheduleParameter.ActualName = directEvaluator.ScheduleParameter.ActualName; 298 298 ScheduleEvaluator.ScheduleParameter.Hidden = true; 299 299 } else { … … 303 303 304 304 foreach (var op in Operators.OfType<IScheduleManipulator>()) { 305 op.Schedule EncodingParameter.ActualName = SolutionCreator.ScheduleEncodingParameter.ActualName;306 op.Schedule EncodingParameter.Hidden = true;305 op.ScheduleParameter.ActualName = SolutionCreator.ScheduleParameter.ActualName; 306 op.ScheduleParameter.Hidden = true; 307 307 } 308 308 309 309 foreach (var op in Operators.OfType<IScheduleCrossover>()) { 310 op.ChildParameter.ActualName = SolutionCreator.Schedule EncodingParameter.ActualName;310 op.ChildParameter.ActualName = SolutionCreator.ScheduleParameter.ActualName; 311 311 op.ChildParameter.Hidden = true; 312 op.ParentsParameter.ActualName = SolutionCreator.Schedule EncodingParameter.ActualName;312 op.ParentsParameter.ActualName = SolutionCreator.ScheduleParameter.ActualName; 313 313 op.ParentsParameter.Hidden = true; 314 314 } … … 320 320 op.ScheduleParameter.Hidden = true; 321 321 } else if (SolutionCreator is DirectScheduleRandomCreator) { 322 op.ScheduleParameter.ActualName = ((DirectScheduleRandomCreator)SolutionCreator).Schedule EncodingParameter.ActualName;322 op.ScheduleParameter.ActualName = ((DirectScheduleRandomCreator)SolutionCreator).ScheduleParameter.ActualName; 323 323 op.ScheduleParameter.Hidden = true; 324 324 } else {
Note: See TracChangeset
for help on using the changeset viewer.