Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/14 10:31:41 (9 years ago)
Author:
pfleck
Message:

#2269 Merged trunk. Updated .net version of ALPS plugin.

Location:
branches/ALPS
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS

  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationAnalyzer.cs

    r11171 r11677  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Optimization;
    2829using HeuristicLab.Parameters;
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3637  [StorableClass]
    3738  public abstract class SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U> : SymbolicDataAnalysisSingleObjectiveAnalyzer,
    38     ISymbolicDataAnalysisValidationAnalyzer<T, U>
     39    ISymbolicDataAnalysisValidationAnalyzer<T, U>, IStochasticOperator
    3940    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
    4041    where U : class, IDataAnalysisProblemData {
  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs

    r11171 r11677  
    203203        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
    204204        stringBuilder.Append(",0))");
     205      } else if (symbol is IfThenElse) {
     206        stringBuilder.Append("IF(");
     207        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + " ) > 0");
     208        stringBuilder.Append(",");
     209        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
     210        stringBuilder.Append(",");
     211        stringBuilder.Append(FormatRecursively(node.GetSubtree(2)));
     212        stringBuilder.Append(")");
     213      } else if (symbol is VariableCondition) {
     214        VariableConditionTreeNode variableConditionTreeNode = node as VariableConditionTreeNode;
     215        double threshold = variableConditionTreeNode.Threshold;
     216        double slope = variableConditionTreeNode.Slope;
     217        string p = "(1 / (1 + EXP(-" + slope.ToString(CultureInfo.InvariantCulture) + "* (" + GetColumnToVariableName(variableConditionTreeNode.VariableName) + "-" + threshold.ToString(CultureInfo.InvariantCulture) + "))))";
     218        stringBuilder.Append("INT((");
     219        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     220        stringBuilder.Append("*");
     221        stringBuilder.Append(p);
     222        stringBuilder.Append(") + (");
     223        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
     224        stringBuilder.Append("*(");
     225        stringBuilder.Append("1 - " + p + ")");
     226        stringBuilder.Append("))");
     227      } else if (symbol is Xor) {
     228        stringBuilder.Append("IF(");
     229        stringBuilder.Append("XOR(");
     230        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
     231        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
     232        stringBuilder.Append("), 1.0, -1.0)");
     233      } else if (symbol is Or) {
     234        stringBuilder.Append("IF(");
     235        stringBuilder.Append("OR(");
     236        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
     237        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
     238        stringBuilder.Append("), 1.0, -1.0)");
     239      } else if (symbol is And) {
     240        stringBuilder.Append("IF(");
     241        stringBuilder.Append("AND(");
     242        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,");
     243        stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0");
     244        stringBuilder.Append("), 1.0, -1.0)");
     245      } else if (symbol is Not) {
     246        stringBuilder.Append("IF(");
     247        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     248        stringBuilder.Append(" > 0, -1.0, 1.0)");
     249      } else if (symbol is GreaterThan) {
     250        stringBuilder.Append("IF((");
     251        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     252        stringBuilder.Append(") > (");
     253        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
     254        stringBuilder.Append("), 1.0, -1.0)");
     255      } else if (symbol is LessThan) {
     256        stringBuilder.Append("IF((");
     257        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     258        stringBuilder.Append(") < (");
     259        stringBuilder.Append(FormatRecursively(node.GetSubtree(1)));
     260        stringBuilder.Append("), 1.0, -1.0)");
    205261      } else {
    206262        throw new NotImplementedException("Excel export of " + node.Symbol + " is not implemented.");
  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r11457 r11677  
    1111    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <TargetFrameworkProfile>
    1515    </TargetFrameworkProfile>
     
    4646    <WarningLevel>4</WarningLevel>
    4747    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     48    <Prefer32Bit>false</Prefer32Bit>
    4849  </PropertyGroup>
    4950  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    5556    <WarningLevel>4</WarningLevel>
    5657    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     58    <Prefer32Bit>false</Prefer32Bit>
    5759  </PropertyGroup>
    5860  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    6466    <ErrorReport>prompt</ErrorReport>
    6567    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     68    <Prefer32Bit>false</Prefer32Bit>
    6669  </PropertyGroup>
    6770  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    7376    <ErrorReport>prompt</ErrorReport>
    7477    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     78    <Prefer32Bit>false</Prefer32Bit>
    7579  </PropertyGroup>
    7680  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    8286    <ErrorReport>prompt</ErrorReport>
    8387    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     88    <Prefer32Bit>false</Prefer32Bit>
    8489  </PropertyGroup>
    8590  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    9196    <ErrorReport>prompt</ErrorReport>
    9297    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     98    <Prefer32Bit>false</Prefer32Bit>
    9399  </PropertyGroup>
    94100  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.