Changeset 5682 for branches/SuccessProgressAnalysis/HeuristicLab.Operators
- Timestamp:
- 03/15/11 09:51:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SuccessProgressAnalysis/HeuristicLab.Operators/3.3/StochasticMultiBranch.cs
r5492 r5682 49 49 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 50 50 } 51 public ValueParameter<BoolValue> ReportExecutedOperatorParameter {52 get { return (ValueParameter<BoolValue>)Parameters[" ReportExecutedOperator"]; }51 public ValueParameter<BoolValue> TraceSelectedOperatorParameter { 52 get { return (ValueParameter<BoolValue>)Parameters["TraceSelectedOperator"]; } 53 53 } 54 public ValueLookupParameter<StringValue> ExecutedOperatorParameter {55 get { return (ValueLookupParameter<StringValue>)Parameters[" ExecutedOperator"]; }54 public ValueLookupParameter<StringValue> SelectedOperatorParameter { 55 get { return (ValueLookupParameter<StringValue>)Parameters["SelectedOperator"]; } 56 56 } 57 57 … … 64 64 private void AfterDeserializationHook() { 65 65 #region Backwards Compatibility 66 if (!Parameters.ContainsKey(" ExecutedOperator")) {67 Parameters.Add(new ValueLookupParameter<StringValue>(" ExecutedOperator", "The operator that was executed."));66 if (!Parameters.ContainsKey("SelectedOperator")) { 67 Parameters.Add(new ValueLookupParameter<StringValue>("SelectedOperator", "If the TraceSelectedOperator flag is set, the name of the operator is traced in this parameter.")); 68 68 } 69 if (!Parameters.ContainsKey(" ReportExecutedOperator")) {70 Parameters.Add(new ValueParameter<BoolValue>(" ReportExecutedOperator", "Report the executed operator", new BoolValue(false)));69 if (!Parameters.ContainsKey("TraceSelectedOperator")) { 70 Parameters.Add(new ValueParameter<BoolValue>("TraceSelectedOperator", "Indicates, if the selected operator should be traced.", new BoolValue(false))); 71 71 } 72 72 #endregion … … 86 86 Parameters.Add(new ValueLookupParameter<DoubleArray>("Probabilities", "The array of relative probabilities for each operator.", new DoubleArray())); 87 87 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 88 Parameters.Add(new ValueLookupParameter<StringValue>(" ExecutedOperator", "The operator that was executed."));89 Parameters.Add(new ValueParameter<BoolValue>(" ReportExecutedOperator", "Report the executed operator", new BoolValue(false)));88 Parameters.Add(new ValueLookupParameter<StringValue>("SelectedOperator", "If the TraceSelectedOperator flag is set, the name of the operator is traced in this parameter.")); 89 Parameters.Add(new ValueParameter<BoolValue>("TraceSelectedOperator", "Indicates, if the selected operator should be traced.", new BoolValue(false))); 90 90 } 91 91 … … 136 136 } 137 137 IOperator successor = null; 138 int index = -1; 138 139 var checkedOperators = Operators.CheckedItems; 139 140 if (checkedOperators.Count() > 0) { … … 147 148 if (sum > r) { 148 149 successor = indexedItem.Value; 150 index = indexedItem.Index; 149 151 break; 150 152 } … … 153 155 OperationCollection next = new OperationCollection(base.Apply()); 154 156 if (successor != null) { 155 if (ReportExecutedOperatorParameter.Value.Value)156 ExecutedOperatorParameter.ActualValue = new StringValue(successor.Name);157 if (TraceSelectedOperatorParameter.Value.Value) 158 SelectedOperatorParameter.ActualValue = new StringValue(index + ": " + successor.Name); 157 159 158 160 if (CreateChildOperation) … … 160 162 else next.Insert(0, ExecutionContext.CreateOperation(successor)); 161 163 } else { 162 if ( ReportExecutedOperatorParameter.Value.Value)163 ExecutedOperatorParameter.ActualValue = new StringValue("");164 if (TraceSelectedOperatorParameter.Value.Value) 165 SelectedOperatorParameter.ActualValue = new StringValue(""); 164 166 } 165 167 return next;
Note: See TracChangeset
for help on using the changeset viewer.