Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/25/11 14:10:06 (14 years ago)
Author:
svonolfe
Message:

Implemented first version of success progress analysis (#1392)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SuccessProgressAnalysis/HeuristicLab.Operators/3.3/StochasticMultiBranch.cs

    r4722 r5372  
    4949      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    5050    }
     51    public ValueLookupParameter<StringValue> ExecutedOperatorParameter {
     52      get { return (ValueLookupParameter<StringValue>)Parameters["ExecutedOperator"]; }
     53    }
    5154
    5255    public DoubleArray Probabilities {
    5356      get { return ProbabilitiesParameter.Value; }
    5457      set { ProbabilitiesParameter.Value = value; }
     58    }
     59
     60    [StorableHook(HookType.AfterDeserialization)]
     61    private void AfterDeserializationHook() {
     62      #region Backwards Compatibility
     63      if (!Parameters.ContainsKey("ExecutedOperator")) {
     64        Parameters.Add(new ValueLookupParameter<StringValue>("ExecutedOperator", "The operator that was executed."));
     65      }
     66      #endregion
    5567    }
    5668
     
    6880      Parameters.Add(new ValueLookupParameter<DoubleArray>("Probabilities", "The array of relative probabilities for each operator.", new DoubleArray()));
    6981      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
     82      Parameters.Add(new ValueLookupParameter<StringValue>("ExecutedOperator", "The operator that was executed."));
    7083    }
    7184
     
    133146      OperationCollection next = new OperationCollection(base.Apply());
    134147      if (successor != null) {
     148        ExecutedOperatorParameter.ActualValue = new StringValue(successor.GetType().Name);
     149
    135150        if (CreateChildOperation)
    136151          next.Insert(0, ExecutionContext.CreateChildOperation(successor));
    137152        else next.Insert(0, ExecutionContext.CreateOperation(successor));
     153      } else {
     154        ExecutedOperatorParameter.ActualValue = new StringValue("");
    138155      }
    139156      return next;
Note: See TracChangeset for help on using the changeset viewer.