Changeset 15799


Ignore:
Timestamp:
02/21/18 14:08:26 (14 months ago)
Author:
fholzing
Message:

#2871: Added textual status update

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs

    r15797 r15799  
    154154      try {
    155155        var impacts = await Task.Run(() => RegressionSolutionVariableImpactsCalculator.CalculateImpacts(Content, dataPartition, replMethod, factorReplMethod,
    156           (i) => {
     156          (i, s) => {
    157157            progress.ProgressValue = i;
     158            progress.Status = s;
    158159            return cancellationToken.Token.IsCancellationRequested;
    159160          }), cancellationToken.Token);
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs

    r15798 r15799  
    9797      ReplacementMethodEnum replacementMethod = ReplacementMethodEnum.Median,
    9898      FactorReplacementMethodEnum factorReplacementMethod = FactorReplacementMethodEnum.Best,
    99       Func<double, bool> progressCallback = null) {
     99      Func<double, string, bool> progressCallback = null) {
    100100
    101101      var problemData = solution.ProblemData;
     
    135135      var allowedInputVariables = dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList();
    136136
    137       int curIdx = 1;
     137      int curIdx = 0;
    138138      int count = allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>).Count();
    139139      // calculate impacts for double variables
     
    141141        //Report the current progress in percent. If the callback returns true, it means the execution shall be stopped
    142142        if (progressCallback != null) {
    143           if (progressCallback((double)curIdx++ / count)) { return null; }
     143          curIdx++;
     144          if (progressCallback((double)curIdx / count, $"Calculating impact for variable {inputVariable} ({curIdx} of {count})")) { return null; }
    144145        }
    145146        var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacementMethod);
Note: See TracChangeset for help on using the changeset viewer.