- Timestamp:
- 07/08/19 00:23:12 (5 years ago)
- Location:
- stable
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 16585,16625,16658,17020
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SymbolicExpressionGrammarBase.cs
r17097 r17105 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 using HEAL.Attic;28 28 29 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 38 38 39 39 #region properties for separation between implementation and persistence 40 private IEnumerable<ISymbol> storableSymbols; 40 41 [Storable(Name = "Symbols")] 41 42 private IEnumerable<ISymbol> StorableSymbols { 42 43 get { return symbols.Values.ToArray(); } 43 set { foreach (var s in value) symbols.Add(s.Name, s); } 44 } 45 44 set { storableSymbols = value; } 45 } 46 47 private IEnumerable<KeyValuePair<ISymbol, Tuple<int, int>>> storableSymbolSubtreeCount; 46 48 [Storable(Name = "SymbolSubtreeCount")] 47 49 private IEnumerable<KeyValuePair<ISymbol, Tuple<int, int>>> StorableSymbolSubtreeCount { 48 50 get { return symbolSubtreeCount.Select(x => new KeyValuePair<ISymbol, Tuple<int, int>>(GetSymbol(x.Key), x.Value)).ToArray(); } 49 set { foreach (var pair in value) symbolSubtreeCount.Add(pair.Key.Name, pair.Value); } 50 } 51 51 set { storableSymbolSubtreeCount = value; } 52 } 53 54 private IEnumerable<KeyValuePair<ISymbol, IEnumerable<ISymbol>>> storableAllowedChildSymbols; 52 55 [Storable(Name = "AllowedChildSymbols")] 53 56 private IEnumerable<KeyValuePair<ISymbol, IEnumerable<ISymbol>>> StorableAllowedChildSymbols { 54 57 get { return allowedChildSymbols.Select(x => new KeyValuePair<ISymbol, IEnumerable<ISymbol>>(GetSymbol(x.Key), x.Value.Select(GetSymbol).ToArray())).ToArray(); } 55 set { foreach (var pair in value) allowedChildSymbols.Add(pair.Key.Name, pair.Value.Select(y => y.Name).ToList()); } 56 } 57 58 set { storableAllowedChildSymbols = value; } 59 } 60 61 private IEnumerable<KeyValuePair<Tuple<ISymbol, int>, IEnumerable<ISymbol>>> storableAllowedChildSymbolsPerIndex; 58 62 [Storable(Name = "AllowedChildSymbolsPerIndex")] 59 63 private IEnumerable<KeyValuePair<Tuple<ISymbol, int>, IEnumerable<ISymbol>>> StorableAllowedChildSymbolsPerIndex { 60 64 get { return allowedChildSymbolsPerIndex.Select(x => new KeyValuePair<Tuple<ISymbol, int>, IEnumerable<ISymbol>>(Tuple.Create(GetSymbol(x.Key.Item1), x.Key.Item2), x.Value.Select(GetSymbol).ToArray())).ToArray(); } 61 set { 62 foreach (var pair in value) 63 allowedChildSymbolsPerIndex.Add(Tuple.Create(pair.Key.Item1.Name, pair.Key.Item2), pair.Value.Select(y => y.Name).ToList()); 64 } 65 set { storableAllowedChildSymbolsPerIndex = value; } 65 66 } 66 67 #endregion … … 88 89 89 90 suppressEvents = false; 91 } 92 93 [StorableHook(HookType.AfterDeserialization)] 94 private void AfterDeserialization() { 95 foreach (var s in storableSymbols) symbols.Add(s.Name, s); 96 foreach (var pair in storableSymbolSubtreeCount) symbolSubtreeCount.Add(pair.Key.Name, pair.Value); 97 foreach (var pair in storableAllowedChildSymbols) allowedChildSymbols.Add(pair.Key.Name, pair.Value.Select(y => y.Name).ToList()); 98 foreach (var pair in storableAllowedChildSymbolsPerIndex) 99 allowedChildSymbolsPerIndex.Add(Tuple.Create(pair.Key.Item1.Name, pair.Key.Item2), pair.Value.Select(y => y.Name).ToList()); 100 101 storableSymbols = null; 102 storableSymbolSubtreeCount = null; 103 storableAllowedChildSymbols = null; 104 storableAllowedChildSymbolsPerIndex = null; 90 105 } 91 106 -
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r17097 r17105 100 100 </PropertyGroup> 101 101 <ItemGroup> 102 <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">103 <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>104 </Reference>105 <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">106 <HintPath>..\..\packages\HEAL.Attic.1.0.0-pre02\lib\net461\HEAL.Attic.dll</HintPath>107 </Reference>108 102 <Reference Include="System" /> 109 103 <Reference Include="System.Core"> … … 111 105 </Reference> 112 106 <Reference Include="System.Drawing" /> 113 <Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">114 <HintPath>..\..\packages\System.Drawing.Common.4.5.1\lib\net461\System.Drawing.Common.dll</HintPath>115 </Reference>116 107 <Reference Include="System.Xml.Linq"> 117 108 <RequiredTargetFramework>3.5</RequiredTargetFramework> … … 215 206 <ItemGroup> 216 207 <None Include="HeuristicLab.snk" /> 217 <None Include="packages.config" />218 208 <None Include="Plugin.cs.frame" /> 219 209 <None Include="Properties\AssemblyInfo.cs.frame" /> … … 302 292 <Install>true</Install> 303 293 </BootstrapperPackage> 294 </ItemGroup> 295 <ItemGroup> 296 <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 297 <SpecificVersion>False</SpecificVersion> 298 <HintPath>..\..\bin\HEAL.Attic.dll</HintPath> 299 <Private>False</Private> 300 </Reference> 304 301 </ItemGroup> 305 302 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame
r17097 r17105 37 37 [PluginDependency("HeuristicLab.Optimization", "3.3")] 38 38 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 [PluginDependency("HeuristicLab. Persistence", "3.3")]39 [PluginDependency("HeuristicLab.Attic", "1.0")] 40 40 [PluginDependency("HeuristicLab.Random", "3.3")] 41 41 public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
Note: See TracChangeset
for help on using the changeset viewer.