Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/24/11 14:23:19 (13 years ago)
Author:
jhelm
Message:

#1329: Added DirectSchedule-Classes for optimization with the direct-schedule encoding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Schedule.cs

    r6412 r6475  
    3131  [Item("Schedule", "Represents the general solution for scheduling problems.")]
    3232  [StorableClass]
    33   public class Schedule : NamedItem {
     33  public class Schedule : NamedItem, IScheduleEncoding {
    3434    #region Properties
    3535    [Storable]
     
    7979      lastScheduledTaskOfJob = new Dictionary<int, ScheduledTask>();
    8080    }
     81
    8182
    8283
     
    159160      return quality;
    160161    }
     162
     163    public override bool Equals(object obj) {
     164      if (obj.GetType() == typeof(Schedule))
     165        return AreEqual(this, obj as Schedule);
     166      else
     167        return false;
     168    }
     169
     170    private static bool AreEqual(Schedule schedule1, Schedule schedule2) {
     171      if (schedule1.Resources.Count != schedule2.Resources.Count)
     172        return false;
     173      for (int i = 0; i < schedule1.Resources.Count; i++) {
     174        if (!schedule1.Resources[i].Equals(schedule2.Resources[i]))
     175          return false;
     176      }
     177
     178      return true;
     179    }
     180
    161181  }
    162182}
Note: See TracChangeset for help on using the changeset viewer.