Changeset 9166 for branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/Model/ControllerModel.cs
- Timestamp:
- 01/15/13 15:50:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Controller/Interfaces/Model/ControllerModel.cs
r9062 r9166 45 45 public string[] RowNames { get; set; } 46 46 47 public void CopyRow(int index) { 48 var newData = new double[Value.Length + 1][]; 49 var copyRow = new double[Value[index].Length]; 50 for (var i = 0; i < copyRow.Length; i++) { 51 copyRow[i] = Value[index][i]; 52 } 53 for (var i = 0; i < newData.Length; i++) { 54 if (i < index) { 55 newData[i] = Value[i]; 56 } 57 else if (i == index) { 58 newData[i] = copyRow; 59 } 60 else if (i > index) { 61 newData[i] = Value[i - 1]; 62 } 63 } 64 Value = newData; 65 } 66 67 public void DeleteRow(int index) { 68 if (Value.Length == 1) 69 return; 70 71 var newData = new double[Value.Length - 1][]; 72 for (var i = 0; i < Value.Length; i++) { 73 if (i < index) { 74 newData[i] = Value[i]; 75 } 76 else if (i > index) { 77 newData[i - 1] = Value[i]; 78 } 79 } 80 Value = newData; 81 } 82 47 83 public override bool TrySetFromString(string input) { 48 84 var splitted = input.Split(':'); … … 61 97 return false; 62 98 // very, very buggy 63 if (i >= Value.Length || j >= Value[0].Length ) {99 /*if (i >= Value.Length || j >= Value[0].Length ) { 64 100 double[][] valueArr = new double[i >= Value.GetLength(0) ? i : Value.GetLength(0)][]; 65 101 for (int k = 0; k < Value.Length; k++) { … … 70 106 } 71 107 Value = valueArr; 72 } 108 }*/ 73 109 74 110 Value[i][j] = value; … … 186 222 187 223 [DataContract] 188 public class InputParameters {224 public class ProblemParameters { 189 225 private IList<Parameter> items = new List<Parameter>(); 190 226 … … 226 262 227 263 [DataContract] 264 public class Problem { 265 public Problem() { Parameters = new ProblemParameters(); } 266 267 [DataMember] 268 public ProblemParameters Parameters { get; set; } 269 270 [DataMember] 271 public string Class { get; set; } 272 } 273 274 [DataContract] 275 public class Algorithm { 276 public Algorithm() { Parameters = new AlgorithmParameters(); } 277 278 [DataMember] 279 public AlgorithmParameters Parameters { get; set; } 280 281 [DataMember] 282 public Problem Problem{ get; set; } 283 284 [DataMember] 285 public IList<Algorithm> ChildAlgorithms { get; set; } 286 287 [DataMember] 288 public string Class { get; set; } 289 290 [DataMember] 291 public string Mapper { get; set; } 292 } 293 294 [DataContract] 228 295 public class OptimizationScenario { 229 296 [DataMember] 297 public string Id { get; set; } 298 299 [DataMember] 300 public IList<Algorithm> Algorithm { get; set; } 301 302 public Algorithm FirstAlgorithm { get { return Algorithm.FirstOrDefault(); } } 303 } 304 305 [DataContract] 306 public class Experiment { 307 [DataMember] 308 public IList<OptimizationScenario> Scenarios { get; set; } 309 310 public Experiment() { 311 Scenarios = new List<OptimizationScenario>(); 312 } 313 } 314 315 [DataContract] 316 public enum JobState { 317 [EnumMember] 318 Waiting, 319 [EnumMember] 320 Calculating, 321 [EnumMember] 322 Aborted, 323 [EnumMember] 324 Failed, 325 [EnumMember] 326 Finished 327 } 328 329 [DataContract] 330 public class JobExecutionDetails { 331 [DataMember] 332 public int Repititions { get; set; } 333 334 [DataMember] 335 public string JobTitle { get; set; } 336 337 [DataMember] 338 public string Group { get; set; } 339 } 340 341 [DataContract] 342 public class Job { 343 [DataMember] 344 public string Id { get; set; } 345 346 [DataMember] 347 public JobState State { get; set; } 348 349 [DataMember] 230 350 public string Name { get; set; } 231 351 232 352 [DataMember] 233 public string ProblemType { get; set; } 234 235 [DataMember] 236 public string AlgorithmType { get; set; } 237 238 [DataMember] 239 public string MapperType { get; set; } 240 241 private InputParameters inputParams = new InputParameters(); 242 243 [DataMember] 244 public InputParameters InputParameters { 245 get { return inputParams; } 246 set { inputParams = value; } 247 } 248 249 250 private AlgorithmParameters algorithmParameters = new AlgorithmParameters(); 251 252 [DataMember] 253 public AlgorithmParameters AlgorithmParameters { 254 get { return algorithmParameters; } 255 set { algorithmParameters = value; } 256 } 257 } 258 259 [DataContract] 260 public enum JobState { 261 [EnumMember] 262 Waiting, 263 [EnumMember] 264 Calculating, 265 [EnumMember] 266 Aborted, 267 [EnumMember] 268 Failed, 269 [EnumMember] 270 Finished 271 } 272 273 [DataContract] 274 public class Job { 353 public string Resource { get; set; } 354 355 [DataMember] 356 public DateTime DateCreated { get; set; } 357 } 358 359 [DataContract] 360 public class Run { 275 361 [DataMember] 276 362 public string Id { get; set; } 277 363 278 364 [DataMember] 279 public JobState State { get; set; }280 281 [DataMember]282 365 public string Name { get; set; } 283 366 284 367 [DataMember] 285 public string Resource { get; set; }286 287 [DataMember]288 public DateTime DateCreated { get; set; }289 }290 291 [DataContract]292 public class Run {293 [DataMember]294 public string Id { get; set; }295 296 [DataMember]297 public string Name { get; set; }298 299 [DataMember]300 368 public IList<Parameter> Results { get; set; } 301 369 }
Note: See TracChangeset
for help on using the changeset viewer.