Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/09/20 13:10:50 (4 years ago)
Author:
mkommend
Message:

#2971: Merged trunk changes into branch, corrected project files (output path for all configurations, reference paths), resolved merge conflicts in InteractiveSymbolicDataAnalysisSolutionSimplifierView.

Location:
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views

  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs

    r17304 r17501  
    2525using System.Threading;
    2626using System.Threading.Tasks;
     27using System.Windows.Forms;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Data;
     
    4041    private CancellationTokenSource cancellationToken = new CancellationTokenSource();
    4142    private List<Tuple<string, double>> rawVariableImpacts = new List<Tuple<string, double>>();
    42     private bool attachedToProgress = false;
    4343
    4444    public new IClassificationSolution Content {
     
    8787      }
    8888    }
    89     protected override void OnHidden(EventArgs e) {
    90       base.OnHidden(e);
     89    protected override void OnVisibleChanged(EventArgs e) {
     90      base.OnVisibleChanged(e);
     91      if (!this.Visible) {
     92        cancellationToken.Cancel();
     93      }
     94    }
     95
     96    protected override void OnClosed(FormClosedEventArgs e) {
     97      base.OnClosed(e);
    9198      cancellationToken.Cancel();
    92 
    93       if (attachedToProgress) {
    94         Progress.Hide(this);
    95         attachedToProgress = false;
    96       }
    9799    }
    98100
     
    133135      variableImpactsArrayView.Caption = Content.Name + " Variable Impacts";
    134136      progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name);
    135       attachedToProgress = true;
    136137      cancellationToken = new CancellationTokenSource();
    137138
     
    145146          .ToList();
    146147
    147         List<Tuple<string, double>> impacts = null;
    148         await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); });
    149         if (impacts == null) { return; }
     148        var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress));
    150149
    151150        rawVariableImpacts.AddRange(impacts);
    152151        UpdateOrdering();
     152      } catch (OperationCanceledException) {
    153153      } finally {
    154         if (attachedToProgress) {
    155           Progress.Hide(this);
    156           attachedToProgress = false;
    157         }
     154        Progress.Hide(this);
    158155      }
    159156    }
     
    180177      var clonedModel = (IClassificationModel)model.Clone();
    181178      foreach (var variableName in originalVariableOrdering) {
    182         if (cancellationToken.Token.IsCancellationRequested) { return null; }
     179        token.ThrowIfCancellationRequested();
    183180        progress.ProgressValue = (double)++i / count;
    184181        progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r17146 r17501  
    5151    <DebugType>pdbonly</DebugType>
    5252    <Optimize>true</Optimize>
    53     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     53    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    5454    <DefineConstants>TRACE</DefineConstants>
    5555    <ErrorReport>prompt</ErrorReport>
     
    6060  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    6161    <DebugSymbols>true</DebugSymbols>
    62     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     62    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    6363    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6464    <DebugType>full</DebugType>
     
    6969  </PropertyGroup>
    7070  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    71     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     71    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    7272    <DefineConstants>TRACE</DefineConstants>
    7373    <Optimize>true</Optimize>
     
    8080  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    8181    <DebugSymbols>true</DebugSymbols>
    82     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     82    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    8383    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8484    <DebugType>full</DebugType>
     
    8989  </PropertyGroup>
    9090  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    91     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     91    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    9292    <DefineConstants>TRACE</DefineConstants>
    9393    <Optimize>true</Optimize>
     
    100100  <ItemGroup>
    101101    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    102       <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
     102      <HintPath>..\..\..\..\trunk\bin\ALGLIB-3.7.0.dll</HintPath>
    103103      <Private>False</Private>
    104104    </Reference>
     
    106106      <SpecificVersion>False</SpecificVersion>
    107107      <HintPath>..\..\..\..\trunk\bin\HEAL.Attic.dll</HintPath>
     108      <Private>False</Private>
    108109    </Reference>
    109110    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4">
     
    153154      <SpecificVersion>False</SpecificVersion>
    154155      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
     156      <Private>False</Private>
    155157    </Reference>
    156158    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs

    r17304 r17501  
    2525using System.Threading;
    2626using System.Threading.Tasks;
     27using System.Windows.Forms;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Data;
     
    4041    private CancellationTokenSource cancellationToken = new CancellationTokenSource();
    4142    private List<Tuple<string, double>> rawVariableImpacts = new List<Tuple<string, double>>();
    42     private bool attachedToProgress = false;
    4343
    4444    public new IRegressionSolution Content {
     
    8888    }
    8989
    90     protected override void OnHidden(EventArgs e) {
    91       base.OnHidden(e);
     90    protected override void OnVisibleChanged(EventArgs e) {
     91      base.OnVisibleChanged(e);
     92      if (!this.Visible) {
     93        cancellationToken.Cancel();
     94      }
     95    }
     96
     97    protected override void OnClosed(FormClosedEventArgs e) {
     98      base.OnClosed(e);
    9299      cancellationToken.Cancel();
    93 
    94       if (attachedToProgress) {
    95         Progress.Hide(this);
    96         attachedToProgress = false;
    97       }
    98100    }
    99101
     
    132134      variableImpactsArrayView.Caption = Content.Name + " Variable Impacts";
    133135      var progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name);
    134       attachedToProgress = true;
    135136      cancellationToken = new CancellationTokenSource();
    136137
     
    144145          .ToList();
    145146
    146         List<Tuple<string, double>> impacts = null;
    147         await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); });
    148         if (impacts == null) { return; }
     147        var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress));
    149148
    150149        rawVariableImpacts.AddRange(impacts);
    151150        UpdateOrdering();
     151      } catch (OperationCanceledException) {
    152152      } finally {
    153         if (attachedToProgress) {
    154           Progress.Hide(this);
    155           attachedToProgress = false;
    156         }
     153        Progress.Hide(this);
    157154      }
    158155    }
     
    179176
    180177      foreach (var variableName in originalVariableOrdering) {
    181         if (cancellationToken.Token.IsCancellationRequested) { return null; }
     178        token.ThrowIfCancellationRequested();
    182179        progress.ProgressValue = (double)++i / count;
    183180        progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
Note: See TracChangeset for help on using the changeset viewer.