Changeset 3717 for trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs
- Timestamp:
- 05/08/10 04:36:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs
r3632 r3717 61 61 62 62 [Storable] 63 private intconstraintColumn;64 public intConstraintColumn {63 private string constraintColumn; 64 public string ConstraintColumn { 65 65 get { return constraintColumn; } 66 66 set { 67 if ( value < 0 || value >= ((IStringConvertibleMatrix)ConstrainedValue).ColumnNames.Count())67 if (!((IStringConvertibleMatrix)ConstrainedValue).ColumnNames.Contains(value)) 68 68 throw new ArgumentException("Could not set ConstraintData to not existing column index."); 69 69 if (constraintColumn != value) { … … 80 80 if (handler != null) 81 81 handler(this, EventArgs.Empty); 82 } 83 84 protected override void OnConstrainedValueChanged() { 85 base.OnConstrainedValueChanged(); 86 IStringConvertibleMatrix matrix = (IStringConvertibleMatrix)ConstrainedValue; 87 if (constraintColumn == null && ConstrainedValue != null && matrix.Columns != 0) 88 constraintColumn = matrix.ColumnNames.ElementAt(0); 82 89 } 83 90 … … 111 118 IStringConvertibleMatrix matrix = ConstrainedValue; 112 119 if (matrix != null && matrix.ColumnNames.Count() != 0) 113 s += matrix.ColumnNames.ElementAt(constraintColumn)+ " ";120 s += constraintColumn + " "; 114 121 else 115 122 return "ComparisonConstraint";
Note: See TracChangeset
for help on using the changeset viewer.