Changeset 2471


Ignore:
Timestamp:
11/06/09 15:28:05 (12 years ago)
Author:
gkronber
Message:

Fixed #786 (Allowed algorithms are not set correctly for all target variables)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs

    r2378 r2471  
    128128    }
    129129
    130    
     130
    131131    private void setAlgorithmDefault_Click(object sender, EventArgs e) {
     132      var newAllowedAlgos = dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable).ToList();
    132133      foreach (string targetVar in dispatcher.TargetVariables) {
    133         ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
    134         spec.LearningTask = selectedSpec.LearningTask;
    135         spec.MinTimeOffset = selectedSpec.MinTimeOffset;
    136         spec.MaxTimeOffset = selectedSpec.MaxTimeOffset;
    137         spec.AutoRegressive = selectedSpec.AutoRegressive;
    138         var allowedAlgos = dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable);
    139         foreach(var algo in allowedAlgos)
    140           dispatcher.EnableAlgorithm(spec.TargetVariable, algo);
     134        if (targetVar != selectedSpec.TargetVariable) {
     135          ProblemSpecification spec = dispatcher.GetProblemSpecification(targetVar);
     136          spec.LearningTask = selectedSpec.LearningTask;
     137          spec.MinTimeOffset = selectedSpec.MinTimeOffset;
     138          spec.MaxTimeOffset = selectedSpec.MaxTimeOffset;
     139          spec.AutoRegressive = selectedSpec.AutoRegressive;
     140          var curAllowedAlgos = dispatcher.GetAllowedAlgorithms(targetVar).ToList();
     141          foreach (var algo in curAllowedAlgos)
     142            dispatcher.DisableAlgorithm(targetVar, algo);
     143          foreach (var algo in newAllowedAlgos)
     144            dispatcher.EnableAlgorithm(targetVar, algo);
     145        }
    141146      }
    142147    }
Note: See TracChangeset for help on using the changeset viewer.