Free cookie consent management tool by TermsFeed Policy Generator

Changeset 461


Ignore:
Timestamp:
08/06/08 16:59:39 (16 years ago)
Author:
gkronber
Message:

improved StructIdProblemInjector (user can remove variables which shouldn't be injected)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjector.cs

    r397 r461  
    3838      : base() {
    3939      AddVariableInfo(new VariableInfo("Dataset", "Dataset", typeof(Dataset), VariableKind.New));
     40      GetVariableInfo("Dataset").Local = true;
    4041      AddVariable(new Variable("Dataset", new Dataset()));
     42
    4143      AddVariableInfo(new VariableInfo("TargetVariable", "TargetVariable", typeof(IntData), VariableKind.New));
     44      GetVariableInfo("TargetVariable").Local = true;
    4245      AddVariable(new Variable("TargetVariable", new IntData()));
     46
    4347      AddVariableInfo(new VariableInfo("TrainingSamplesStart", "TrainingSamplesStart", typeof(IntData), VariableKind.New));
     48      GetVariableInfo("TrainingSamplesStart").Local = true;
    4449      AddVariable(new Variable("TrainingSamplesStart", new IntData()));
     50
    4551      AddVariableInfo(new VariableInfo("TrainingSamplesEnd", "TrainingSamplesEnd", typeof(IntData), VariableKind.New));
     52      GetVariableInfo("TrainingSamplesEnd").Local = true;
    4653      AddVariable(new Variable("TrainingSamplesEnd", new IntData()));
     54
    4755      AddVariableInfo(new VariableInfo("ValidationSamplesStart", "ValidationSamplesStart", typeof(IntData), VariableKind.New));
     56      GetVariableInfo("ValidationSamplesStart").Local = true;
    4857      AddVariable(new Variable("ValidationSamplesStart", new IntData()));
     58
    4959      AddVariableInfo(new VariableInfo("ValidationSamplesEnd", "ValidationSamplesEnd", typeof(IntData), VariableKind.New));
     60      GetVariableInfo("ValidationSamplesEnd").Local = true;
    5061      AddVariable(new Variable("ValidationSamplesEnd", new IntData()));
     62
    5163      AddVariableInfo(new VariableInfo("TestSamplesStart", "TestSamplesStart", typeof(IntData), VariableKind.New));
     64      GetVariableInfo("TestSamplesStart").Local = true;
    5265      AddVariable(new Variable("TestSamplesStart", new IntData()));
     66
    5367      AddVariableInfo(new VariableInfo("TestSamplesEnd", "TestSamplesEnd", typeof(IntData), VariableKind.New));
     68      GetVariableInfo("TestSamplesEnd").Local = true;
    5469      AddVariable(new Variable("TestSamplesEnd", new IntData()));
    5570    }
     
    6075
    6176    public override IOperation Apply(IScope scope) {
    62       scope.AddVariable(new Variable(scope.TranslateName("Dataset"), (IItem)GetVariable("Dataset").Value.Clone()));
    63       scope.AddVariable(new Variable(scope.TranslateName("TargetVariable"), (IItem)GetVariable("TargetVariable").Value.Clone()));
    64       scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesStart"), (IItem)GetVariable("TrainingSamplesStart").Value.Clone()));
    65       scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesEnd"), (IItem)GetVariable("TrainingSamplesEnd").Value.Clone()));
    66       scope.AddVariable(new Variable(scope.TranslateName("ValidationSamplesStart"), (IItem)GetVariable("ValidationSamplesStart").Value.Clone()));
    67       scope.AddVariable(new Variable(scope.TranslateName("ValidationSamplesEnd"), (IItem)GetVariable("ValidationSamplesEnd").Value.Clone()));
    68       scope.AddVariable(new Variable(scope.TranslateName("TestSamplesStart"), (IItem)GetVariable("TestSamplesStart").Value.Clone()));
    69       scope.AddVariable(new Variable(scope.TranslateName("TestSamplesEnd"), (IItem)GetVariable("TestSamplesEnd").Value.Clone()));
     77      foreach(VariableInfo info in VariableInfos) {
     78        if(info.Local) {
     79          scope.AddVariable(new Variable(info.ActualName, (IItem)GetVariable(info.FormalName).Value.Clone()));
     80        }
     81      }
    7082      return null;
    7183    }
Note: See TracChangeset for help on using the changeset viewer.