- Timestamp:
- 11/11/12 01:46:34 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding.Views/3.3/HeuristicLab.Encodings.ScheduleEncoding.Views-3.3.csproj
r8800 r8886 109 109 </ItemGroup> 110 110 <ItemGroup> 111 <Compile Include="TaskView.cs"> 112 <SubType>UserControl</SubType> 113 </Compile> 114 <Compile Include="TaskView.Designer.cs"> 115 <DependentUpon>TaskView.cs</DependentUpon> 116 </Compile> 111 117 <Compile Include="GanttChart.cs"> 112 118 <SubType>UserControl</SubType> … … 116 122 </Compile> 117 123 <Compile Include="JobDataPoint.cs" /> 124 <Compile Include="JobView.cs"> 125 <SubType>UserControl</SubType> 126 </Compile> 127 <Compile Include="JobView.Designer.cs"> 128 <DependentUpon>JobView.cs</DependentUpon> 129 </Compile> 118 130 <Compile Include="Plugin.cs" /> 119 131 <Compile Include="Properties\AssemblyInfo.cs" /> -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Job.cs
r8603 r8886 20 20 #endregion 21 21 22 using System.ComponentModel; 22 23 using System.Text; 23 24 using HeuristicLab.Common; … … 28 29 [Item("Job", "Represents a composition of tasks that require processing in a scheduling problem.")] 29 30 [StorableClass] 30 public class Job : Item { 31 [Storable] 32 public double DueDate { get; set; } 33 [Storable] 34 public int Index { get; set; } 35 [Storable] 36 public ItemList<Task> Tasks { get; set; } 31 public class Job : Item, INotifyPropertyChanged { 32 [Storable(Name = "DueDate")] private double dueDate; 33 public double DueDate { 34 get { return dueDate; } 35 set { 36 bool changed = dueDate != value; 37 dueDate = value; 38 if (changed) OnPropertyChanged("DueDate"); 39 } 40 } 41 42 [Storable(Name = "Index")] 43 private int index; 44 public int Index { 45 get { return index; } 46 set { 47 bool changed = index != value; 48 index = value; 49 if (changed) OnPropertyChanged("Index"); 50 } 51 } 52 53 [Storable(Name = "Tasks")] 54 private ItemList<Task> tasks; 55 public ItemList<Task> Tasks { 56 get { return tasks; } 57 set { 58 bool changed = tasks != value; 59 tasks = value; 60 if (changed) OnPropertyChanged("Tasks"); 61 } 62 } 37 63 38 64 [StorableConstructor] … … 49 75 public Job(int index, double dueDate) 50 76 : base() { 77 DueDate = dueDate; 51 78 Index = index; 52 79 Tasks = new ItemList<Task>(); 53 54 DueDate = dueDate;55 56 80 } 57 81 58 82 public override string ToString() { 59 StringBuilder sb = new StringBuilder();83 var sb = new StringBuilder(); 60 84 sb.Append("Job#" + Index + " [ "); 61 85 foreach (Task t in Tasks) { … … 68 92 69 93 internal Task GetPreviousTask(Task t) { 70 if (t.TaskNr == 0) 71 return null; 72 else 73 return Tasks[t.TaskNr - 1]; 94 if (t.TaskNr == 0) return null; 95 return Tasks[t.TaskNr - 1]; 74 96 } 75 97 76 98 public event PropertyChangedEventHandler PropertyChanged; 99 protected virtual void OnPropertyChanged(string propertyName) { 100 var handler = PropertyChanged; 101 if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); 102 } 77 103 } 78 104 } -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Task.cs
r8603 r8886 20 20 #endregion 21 21 22 using System.ComponentModel; 22 23 using System.Text; 23 24 using HeuristicLab.Common; … … 28 29 [Item("Task", "Represents a task that has to be scheduled.")] 29 30 [StorableClass] 30 public class Task : Item { 31 [Storable] 32 public int TaskNr { get; set; } 33 [Storable] 34 public int ResourceNr { get; set; } 35 [Storable] 36 public int JobNr { get; set; } 37 [Storable] 38 public double Duration { get; set; } 39 [Storable] 40 public bool IsScheduled { get; set; } 31 public class Task : Item, INotifyPropertyChanged { 32 [Storable(Name = "TaskNr")] 33 private int taskNr; 34 public int TaskNr { 35 get { return taskNr; } 36 set { 37 bool changed = taskNr != value; 38 taskNr = value; 39 if (changed) OnPropertyChanged("TaskNr"); 40 } 41 } 42 [Storable(Name = "ResourceNr")] 43 private int resourceNr; 44 public int ResourceNr { 45 get { return resourceNr; } 46 set { 47 bool changed = resourceNr != value; 48 resourceNr = value; 49 if (changed) OnPropertyChanged("ResourceNr"); 50 } 51 } 52 53 [Storable(Name = "JobNr")] 54 private int jobNr; 55 public int JobNr { 56 get { return jobNr; } 57 set { 58 bool changed = jobNr != value; 59 jobNr = value; 60 if (changed) OnPropertyChanged("JobNr"); 61 } 62 } 63 64 [Storable(Name = "Duration")] 65 private double duration; 66 public double Duration { 67 get { return duration; } 68 set { 69 bool changed = duration != value; 70 duration = value; 71 if (changed) OnPropertyChanged("Duration"); 72 } 73 } 74 75 [Storable(Name = "IsScheduled")] 76 private bool isScheduled; 77 public bool IsScheduled { 78 get { return isScheduled; } 79 set { 80 bool changed = isScheduled != value; 81 isScheduled = value; 82 if (changed) OnPropertyChanged("IsScheduled"); 83 } 84 } 41 85 42 86 [StorableConstructor] … … 86 130 task1.TaskNr == task2.TaskNr); 87 131 } 132 133 public event PropertyChangedEventHandler PropertyChanged; 134 protected virtual void OnPropertyChanged(string propertyName) { 135 var handler = PropertyChanged; 136 if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); 137 } 88 138 } 89 139 } -
trunk/sources/HeuristicLab.Problems.Scheduling.Views/3.3/HeuristicLab.Problems.Scheduling.Views-3.3.csproj
r8882 r8886 103 103 <Reference Include="System" /> 104 104 <Reference Include="System.Core" /> 105 <Reference Include="System.Data" /> 105 106 <Reference Include="System.Drawing" /> 106 107 <Reference Include="System.Windows.Forms" /> 108 <Reference Include="System.Xml" /> 107 109 </ItemGroup> 108 110 <ItemGroup> -
trunk/sources/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs
r8882 r8886 79 79 } 80 80 81 public ValueParameter<IntValue> JobsParameter {82 get { return ( ValueParameter<IntValue>)Parameters["Jobs"]; }83 } 84 public ValueParameter<IntValue> ResourcesParameter {85 get { return ( ValueParameter<IntValue>)Parameters["Resources"]; }81 public IFixedValueParameter<IntValue> JobsParameter { 82 get { return (IFixedValueParameter<IntValue>)Parameters["Jobs"]; } 83 } 84 public IFixedValueParameter<IntValue> ResourcesParameter { 85 get { return (IFixedValueParameter<IntValue>)Parameters["Resources"]; } 86 86 } 87 87 public ValueParameter<SchedulingEvaluator> SolutionEvaluatorParameter { 88 88 get { return (ValueParameter<SchedulingEvaluator>)Parameters["SolutionEvaluator"]; } 89 }90 public ValueParameter<BoolValue> DueDatesParameter {91 get { return (ValueParameter<BoolValue>)Parameters["DueDates"]; }92 89 } 93 90 #endregion … … 102 99 set { BestKnownSolutionParameter.Value = value; } 103 100 } 104 public IntValueJobs {105 get { return JobsParameter.Value ; }106 set { JobsParameter.Value = value; }107 } 108 public IntValueResources {109 get { return ResourcesParameter.Value ; }110 set { ResourcesParameter.Value = value; }101 public int Jobs { 102 get { return JobsParameter.Value.Value; } 103 set { JobsParameter.Value.Value = value; } 104 } 105 public int Resources { 106 get { return ResourcesParameter.Value.Value; } 107 set { ResourcesParameter.Value.Value = value; } 111 108 } 112 109 public SchedulingEvaluator SolutionEvaluator { 113 110 get { return SolutionEvaluatorParameter.Value; } 114 111 set { SolutionEvaluatorParameter.Value = value; } 115 }116 public BoolValue DueDates {117 get { return DueDatesParameter.Value; }118 set { DueDatesParameter.Value = value; }119 112 } 120 113 public override Image ItemImage { … … 129 122 Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance.")); 130 123 131 Parameters.Add(new ValueParameter<IntValue>("Jobs", "The number of jobs used in this JSSP instance.", new IntValue())); 132 Parameters.Add(new ValueParameter<IntValue>("Resources", "The number of resources used in this JSSP instance.", new IntValue())); 133 Parameters.Add(new ValueParameter<BoolValue>("DueDates", "Determines whether the problem instance uses due dates or not.", new BoolValue())); 124 Parameters.Add(new FixedValueParameter<IntValue>("Jobs", "The number of jobs used in this JSSP instance.", new IntValue())); 125 Parameters.Add(new FixedValueParameter<IntValue>("Resources", "The number of resources used in this JSSP instance.", new IntValue())); 134 126 Parameters.Add(new ValueParameter<SchedulingEvaluator>("SolutionEvaluator", "The evaluator used to determine the quality of a solution.", new MakespanEvaluator())); 135 127 … … 183 175 184 176 JobData = jobData; 185 Jobs = new IntValue(data.Jobs); 186 Resources = new IntValue(data.Resources); 187 DueDates = new BoolValue(data.DueDates != null); 177 Jobs = data.Jobs; 178 Resources = data.Resources; 188 179 } 189 180 … … 192 183 Name = Name, 193 184 Description = Description, 194 Jobs = Jobs .Value,195 Resources = Resources .Value,196 ProcessingTimes = new double[Jobs .Value, Resources.Value],197 Demands = new int[Jobs .Value, Resources.Value],198 DueDates = (DueDates.Value ? new double[Jobs.Value] : null)185 Jobs = Jobs, 186 Resources = Resources, 187 ProcessingTimes = new double[Jobs, Resources], 188 Demands = new int[Jobs, Resources], 189 DueDates = new double[Jobs] 199 190 }; 200 191 201 192 foreach (var job in JobData) { 202 193 var counter = 0; 203 if (DueDates.Value)result.DueDates[job.Index] = job.DueDate;194 result.DueDates[job.Index] = job.DueDate; 204 195 foreach (var task in job.Tasks) { 205 196 result.ProcessingTimes[task.JobNr, counter] = task.Duration;
Note: See TracChangeset
for help on using the changeset viewer.