Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/20/14 14:56:39 (10 years ago)
Author:
gkronber
Message:

#2093: merged trunk changes to prepare for reintegration

Location:
branches/LogResidualEvaluator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LogResidualEvaluator

  • branches/LogResidualEvaluator/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Task.cs

    r9456 r10483  
    3838        bool changed = taskNr != value;
    3939        taskNr = value;
    40         if (changed) OnPropertyChanged("TaskNr");
     40        if (changed) {
     41          OnPropertyChanged("TaskNr");
     42          OnToStringChanged();
     43        }
    4144      }
    4245    }
     
    4851        bool changed = resourceNr != value;
    4952        resourceNr = value;
    50         if (changed) OnPropertyChanged("ResourceNr");
     53        if (changed) {
     54          OnPropertyChanged("ResourceNr");
     55          OnToStringChanged();
     56        }
    5157      }
    5258    }
     
    8995    protected Task(Task original, Cloner cloner)
    9096      : base(original, cloner) {
    91       this.ResourceNr = original.ResourceNr;
    92       this.JobNr = original.JobNr;
    93       this.Duration = original.Duration;
    94       this.TaskNr = original.TaskNr;
    95       this.IsScheduled = original.IsScheduled;
     97      this.resourceNr = original.ResourceNr;
     98      this.jobNr = original.JobNr;
     99      this.duration = original.Duration;
     100      this.taskNr = original.TaskNr;
     101      this.isScheduled = original.IsScheduled;
    96102    }
    97103    public Task() : this(-1, -1, -1, 0) { }
    98104    public Task(int taskNr, int resNr, int jobNr, double duration)
    99105      : base() {
    100       Duration = duration;
    101       ResourceNr = resNr;
    102       JobNr = jobNr;
    103       TaskNr = taskNr;
    104       IsScheduled = false;
     106      this.duration = duration;
     107      this.resourceNr = resNr;
     108      this.jobNr = jobNr;
     109      this.taskNr = taskNr;
     110      this.isScheduled = false;
    105111    }
    106112
     
    115121    }
    116122
    117     public override bool Equals(object obj) {
    118       if (obj.GetType() == typeof(Task))
    119         return AreEqual(this, obj as Task);
    120       else
    121         return false;
    122     }
    123 
    124     public override int GetHashCode() {
    125       return TaskNr ^ JobNr;
    126     }
    127 
    128     public static bool AreEqual(Task task1, Task task2) {
    129       return (task1.Duration == task2.Duration &&
    130         task1.IsScheduled == task2.IsScheduled &&
    131         task1.JobNr == task2.JobNr &&
    132         task1.ResourceNr == task2.ResourceNr &&
    133         task1.TaskNr == task2.TaskNr);
    134     }
    135 
    136123    public event PropertyChangedEventHandler PropertyChanged;
    137124    protected virtual void OnPropertyChanged(string propertyName) {
Note: See TracChangeset for help on using the changeset viewer.