Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3824 for trunk


Ignore:
Timestamp:
05/17/10 15:55:45 (14 years ago)
Author:
gkronber
Message:

Implemented view for symbolic expression grammars and symbols. #1014

Location:
trunk/sources
Files:
10 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.csproj

    r3797 r3824  
    8282  </ItemGroup>
    8383  <ItemGroup>
     84    <Compile Include="DefaultSymbolicExpressionGrammarView.cs">
     85      <SubType>UserControl</SubType>
     86    </Compile>
     87    <Compile Include="DefaultSymbolicExpressionGrammarView.Designer.cs">
     88      <DependentUpon>DefaultSymbolicExpressionGrammarView.cs</DependentUpon>
     89    </Compile>
     90    <Compile Include="SymbolView.cs">
     91      <SubType>UserControl</SubType>
     92    </Compile>
     93    <Compile Include="SymbolView.Designer.cs">
     94      <DependentUpon>SymbolView.cs</DependentUpon>
     95    </Compile>
    8496    <Compile Include="GraphicalSymbolicExpressionTreeView.cs">
    8597      <SubType>UserControl</SubType>
     
    105117  </ItemGroup>
    106118  <ItemGroup>
     119    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
     120      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
     121      <Name>HeuristicLab.Collections-3.3</Name>
     122    </ProjectReference>
    107123    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    108124      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
     
    139155    <None Include="Properties\AssemblyInfo.frame" />
    140156  </ItemGroup>
     157  <ItemGroup>
     158    <EmbeddedResource Include="DefaultSymbolicExpressionGrammarView.resx">
     159      <DependentUpon>DefaultSymbolicExpressionGrammarView.cs</DependentUpon>
     160    </EmbeddedResource>
     161    <EmbeddedResource Include="SymbolView.resx">
     162      <DependentUpon>SymbolView.cs</DependentUpon>
     163    </EmbeddedResource>
     164  </ItemGroup>
    141165  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    142166  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs.frame

    r3437 r3824  
    2828  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.3.0.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Collections", "3.3.0.0")]
    3031  [PluginDependency("HeuristicLab.Common", "3.3.0.0")]
    3132  [PluginDependency("HeuristicLab.Core", "3.3.0.0")]
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.csproj

    r3817 r3824  
    128128    <Compile Include="Symbols\Argument.cs" />
    129129    <Compile Include="Symbols\ArgumentTreeNode.cs" />
     130    <Compile Include="Symbols\ReadOnlySymbol.cs" />
    130131    <Compile Include="Symbols\StartSymbol.cs" />
    131132    <Compile Include="Symbols\InvokeFunction.cs" />
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Argument.cs

    r3484 r3824  
    2929  [StorableClass]
    3030  [Item("Argument", "Symbol that represents a function argument.")]
    31   public sealed class Argument : Symbol {
    32     public override bool CanChangeName {
    33       get {
    34         return false;
    35       }
    36     }
     31  public sealed class Argument : ReadOnlySymbol {
    3732    [Storable]
    3833    private int argumentIndex;
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Defun.cs

    r3462 r3824  
    2929  [StorableClass]
    3030  [Item("Defun", "Symbol that represents a function defining node.")]
    31   public sealed class Defun : Symbol {
    32     public override bool CanChangeName {
    33       get {
    34         return false;
    35       }
    36     }
    37 
     31  public sealed class Defun : ReadOnlySymbol {
    3832    public override SymbolicExpressionTreeNode CreateTreeNode() {
    3933      return new DefunTreeNode(this);
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/InvokeFunction.cs

    r3484 r3824  
    3030  [StorableClass]
    3131  [Item("InvokeFunction", "Symbol that the invokation of another function.")]
    32   public sealed class InvokeFunction : Symbol {
     32  public sealed class InvokeFunction : ReadOnlySymbol {
    3333    public override bool CanChangeName {
    3434      get {
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/ProgramRootSymbol.cs

    r3462 r3824  
    2626  [StorableClass]
    2727  [Item("ProgramRootSymbol", "Special symbol that represents the program root node of a symbolic expression tree.")]
    28   public sealed class ProgramRootSymbol : Symbol {
    29     public override bool CanChangeName {
    30       get {
    31         return false;
    32       }
    33     }
    34 
     28  public sealed class ProgramRootSymbol : ReadOnlySymbol {
    3529    public override SymbolicExpressionTreeNode CreateTreeNode() {
    3630      return new SymbolicExpressionTreeTopLevelNode(this);
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/StartSymbol.cs

    r3462 r3824  
    2626  [StorableClass]
    2727  [Item("StartSymbol", "Special symbol that represents the starting node of the result producing branch of a symbolic expression tree.")]
    28   public sealed class StartSymbol : Symbol {
    29     public override bool CanChangeName {
    30       get {
    31         return false;
    32       }
    33     }
     28  public sealed class StartSymbol : ReadOnlySymbol {
    3429
    3530    public override SymbolicExpressionTreeNode CreateTreeNode() {
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs

    r3742 r3824  
    4141      set {
    4242        if (value < 0.0) throw new ArgumentException("InitialFrequency must be positive");
    43         initialFrequency = value;
     43        if (value != initialFrequency) {
     44          initialFrequency = value;
     45          OnChanged(EventArgs.Empty);
     46        }
    4447      }
     48    }
     49    public override bool CanChangeName {
     50      get { return false; }
    4551    }
    4652    #endregion
     
    5864
    5965    public override IDeepCloneable Clone(Cloner cloner) {
    60       Symbol clone = (Symbol) base.Clone(cloner);
     66      Symbol clone = (Symbol)base.Clone(cloner);
    6167      clone.initialFrequency = initialFrequency;
    6268      return clone;
    6369    }
     70
     71    #region events
     72    public event EventHandler Changed;
     73    protected void OnChanged(EventArgs e) {
     74      EventHandler handlers = Changed;
     75      if (handlers != null)
     76        handlers(this, e);
     77    }
     78    #endregion
    6479  }
    6580}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj

    r3755 r3824  
    124124      <DependentUpon>SymbolicExpressionModelView.cs</DependentUpon>
    125125    </Compile>
     126    <Compile Include="Symbolic\Symbols\ConstantView.cs">
     127      <SubType>UserControl</SubType>
     128    </Compile>
     129    <Compile Include="Symbolic\Symbols\ConstantView.Designer.cs">
     130      <DependentUpon>ConstantView.cs</DependentUpon>
     131    </Compile>
     132    <Compile Include="Symbolic\Symbols\VariableView.cs">
     133      <SubType>UserControl</SubType>
     134    </Compile>
     135    <Compile Include="Symbolic\Symbols\VariableView.Designer.cs">
     136      <DependentUpon>VariableView.cs</DependentUpon>
     137    </Compile>
    126138  </ItemGroup>
    127139  <ItemGroup>
     
    206218    <EmbeddedResource Include="Symbolic\SymbolicExpressionModelView.resx">
    207219      <DependentUpon>SymbolicExpressionModelView.cs</DependentUpon>
     220    </EmbeddedResource>
     221    <EmbeddedResource Include="Symbolic\Symbols\ConstantView.resx">
     222      <DependentUpon>ConstantView.cs</DependentUpon>
     223    </EmbeddedResource>
     224    <EmbeddedResource Include="Symbolic\Symbols\VariableView.resx">
     225      <DependentUpon>VariableView.cs</DependentUpon>
    208226    </EmbeddedResource>
    209227  </ItemGroup>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Constant.cs

    r3512 r3824  
    3838    public double MinValue {
    3939      get { return minValue; }
    40       set { minValue = value; }
     40      set {
     41        if (value != minValue) {
     42          minValue = value;
     43          OnChanged(EventArgs.Empty);
     44        }
     45      }
    4146    }
    4247    [Storable]
     
    4449    public double MaxValue {
    4550      get { return maxValue; }
    46       set { maxValue = value; }
     51      set {
     52        if (value != maxValue) {
     53          maxValue = value;
     54          OnChanged(EventArgs.Empty);
     55        }
     56      }
    4757    }
    4858    [Storable]
     
    5060    public double ManipulatorNu {
    5161      get { return manipulatorNu; }
    52       set { manipulatorNu = value; }
     62      set {
     63        if (value != manipulatorNu) {
     64          manipulatorNu = value;
     65          OnChanged(EventArgs.Empty);
     66        }
     67      }
    5368    }
    5469    [Storable]
     
    5873      set {
    5974        if (value < 0) throw new ArgumentException();
    60         manipulatorSigma = value;
     75        if (value != manipulatorSigma) {
     76          manipulatorSigma = value;
     77          OnChanged(EventArgs.Empty);
     78        }
    6179      }
    6280    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Variable.cs

    r3541 r3824  
    4040    public double WeightNu {
    4141      get { return weightNu; }
    42       set { weightNu = value; }
     42      set {
     43        if (value != weightNu) {
     44          weightNu = value;
     45          OnChanged(EventArgs.Empty);
     46        }
     47      }
    4348    }
    4449    [Storable]
     
    4853      set {
    4954        if (weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
    50         weightSigma = value;
     55        if (value != weightSigma) {
     56          weightSigma = value;
     57          OnChanged(EventArgs.Empty);
     58        }
    5159      }
    5260    }
     
    5563    public double WeightManipulatorNu {
    5664      get { return weightManipulatorNu; }
    57       set { weightManipulatorNu = value; }
     65      set {
     66        if (value != weightManipulatorNu) {
     67          weightManipulatorNu = value;
     68          OnChanged(EventArgs.Empty);
     69        }
     70      }
    5871    }
    5972    [Storable]
     
    6376      set {
    6477        if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");
    65         weightManipulatorSigma = value;
     78        if (value != weightManipulatorSigma) {
     79          weightManipulatorSigma = value;
     80          OnChanged(EventArgs.Empty);
     81        }
    6682      }
    6783    }
     
    7490        variableNames.Clear();
    7591        variableNames.AddRange(value);
     92        OnChanged(EventArgs.Empty);
    7693      }
    7794    }
Note: See TracChangeset for help on using the changeset viewer.