Changeset 494 for trunk/sources/HeuristicLab.StructureIdentification
- Timestamp:
- 08/11/08 14:04:12 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/FunctionLibraryInjector.cs
r487 r494 32 32 namespace HeuristicLab.StructureIdentification { 33 33 public class FunctionLibraryInjector : OperatorBase { 34 private const string TARGETVARIABLE = "TargetVariable"; 35 private const string AUTOREGRESSIVE = "Autoregressive"; 34 36 private const string ALLOWEDFEATURES = "AllowedFeatures"; 35 37 private const string MINTIMEOFFSET = "MinTimeOffset"; … … 47 49 public FunctionLibraryInjector() 48 50 : base() { 51 AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In)); 52 AddVariableInfo(new VariableInfo(AUTOREGRESSIVE, "Switch to turn on/off autoregressive modeling (wether to allow the target variable as input)", typeof(BoolData), VariableKind.In)); 49 53 AddVariableInfo(new VariableInfo(ALLOWEDFEATURES, "List of indexes of allowed features", typeof(ItemList<IntData>), VariableKind.In)); 50 54 AddVariableInfo(new VariableInfo(MINTIMEOFFSET, "Minimal time offset for all features", typeof(IntData), VariableKind.In)); … … 57 61 IntData maxTimeOffset = GetVariableValue<IntData>(MAXTIMEOFFSET, scope, true); 58 62 ItemList<IntData> allowedFeatures = GetVariableValue<ItemList<IntData>>(ALLOWEDFEATURES, scope, true); 63 int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data; 64 bool autoregressive = GetVariableValue<BoolData>(AUTOREGRESSIVE, scope, true).Data; 65 66 if(autoregressive) { 67 // make sure the target-variable occures in list of allowed features 68 if(!allowedFeatures.Exists(d => d.Data == targetVariable)) allowedFeatures.Add(new IntData(targetVariable)); 69 } else { 70 // remove the target-variable in case it occures in allowed features 71 List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable); 72 foreach(IntData t in ts) allowedFeatures.Remove(t); 73 } 59 74 60 75 InitDefaultOperatorLibrary();
Note: See TracChangeset
for help on using the changeset viewer.