- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 11 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r7702 r9363 88 88 89 89 [StorableConstructor] 90 private SymbolicExpressionTreeLengthAnalyzer(bool deserializing) : base( ) { }90 private SymbolicExpressionTreeLengthAnalyzer(bool deserializing) : base(deserializing) { } 91 91 private SymbolicExpressionTreeLengthAnalyzer(SymbolicExpressionTreeLengthAnalyzer original, Cloner cloner) 92 92 : base(original, cloner) { -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs
r7259 r9363 25 25 26 26 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 27 public class SymbolicExpressionTreeCompiler { 28 private Dictionary<string, ushort> entryPoint = new Dictionary<string, ushort>(); 29 private List<Func<Instruction, Instruction>> postInstructionCompiledHooks = new List<Func<Instruction, Instruction>>(); 27 public static class SymbolicExpressionTreeCompiler { 30 28 31 public Instruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) { 29 public static Instruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) { 30 return Compile(tree, opCodeMapper, Enumerable.Empty<Func<Instruction, Instruction>>()); 31 } 32 public static Instruction[] Compile(ISymbolicExpressionTree tree, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, IEnumerable<Func<Instruction, Instruction>> postInstructionCompiledHooks) { 33 Dictionary<string, ushort> entryPoint = new Dictionary<string, ushort>(); 32 34 List<Instruction> code = new List<Instruction>(); 33 entryPoint.Clear();34 35 // compile main body branches 35 36 foreach (var branch in tree.Root.GetSubtree(0).Subtrees) { 36 code.AddRange(Compile(branch, opCodeMapper ));37 code.AddRange(Compile(branch, opCodeMapper, postInstructionCompiledHooks)); 37 38 } 38 39 // compile function branches … … 43 44 if (code.Count > ushort.MaxValue) throw new ArgumentException("Code for the tree is too long (> ushort.MaxValue)."); 44 45 entryPoint[branch.FunctionName] = (ushort)code.Count; 45 code.AddRange(Compile(branch.GetSubtree(0), opCodeMapper ));46 code.AddRange(Compile(branch.GetSubtree(0), opCodeMapper, postInstructionCompiledHooks)); 46 47 } 47 48 // address of all functions is fixed now … … 52 53 var invokeNode = (InvokeFunctionTreeNode)instr.dynamicNode; 53 54 instr.iArg0 = entryPoint[invokeNode.Symbol.FunctionName]; 54 code[i] = instr;55 55 } 56 56 } … … 59 59 } 60 60 61 private IEnumerable<Instruction> Compile(ISymbolicExpressionTreeNode branch, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) {61 private static IEnumerable<Instruction> Compile(ISymbolicExpressionTreeNode branch, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, IEnumerable<Func<Instruction, Instruction>> postInstructionCompiledHooks) { 62 62 foreach (var node in branch.IterateNodesPrefix()) { 63 63 Instruction instr = new Instruction(); … … 77 77 } 78 78 } 79 80 /// <summary>81 /// Adds a function that will be called every time an instruction is compiled.82 /// The compiled will insert the instruction returned by the hook into the code.83 /// </summary>84 /// <param name="hook">The hook that should be called for each compiled instruction.</param>85 public void AddInstructionPostProcessingHook(Func<Instruction, Instruction> hook) {86 postInstructionCompiledHooks.Add(hook);87 }88 79 } 89 80 } -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
r7259 r9363 176 176 extensionPoints.Add(x); 177 177 } 178 long minExtensionPointsLength = extensionPoints.Select(x => x.MinimumExtensionLength).Sum(); 179 long maxExtensionPointsLength = extensionPoints.Select(x => x.MaximumExtensionLength).Sum(); 178 //necessary to use long data type as the extension point length could be int.MaxValue 179 long minExtensionPointsLength = extensionPoints.Select(x => (long)x.MinimumExtensionLength).Sum(); 180 long maxExtensionPointsLength = extensionPoints.Select(x => (long)x.MaximumExtensionLength).Sum(); 180 181 181 182 // while there are pending extension points and we have not reached the limit of adding new extension points -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
r7506 r9363 59 59 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed.")); 60 60 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover.")); 61 ParentsParameter.ActualName = "SymbolicExpressionTree"; 62 ChildParameter.ActualName = "SymbolicExpressionTree"; 61 63 } 62 64 -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r6978 r9363 152 152 <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" /> 153 153 <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeManipulator.cs" /> 154 <Compile Include="Manipulators\RemoveBranchManipulation.cs" /> 154 155 <Compile Include="Manipulators\ReplaceBranchManipulation.cs" /> 155 156 <Compile Include="Manipulators\FullTreeShaker.cs" /> … … 282 283 --> 283 284 <PropertyGroup> 284 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)285 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 285 286 set ProjectDir=$(ProjectDir) 286 287 set SolutionDir=$(SolutionDir) … … 289 290 call PreBuildEvent.cmd 290 291 </PreBuildEvent> 292 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 293 export ProjectDir=$(ProjectDir) 294 export SolutionDir=$(SolutionDir) 295 296 $SolutionDir/PreBuildEvent.sh 297 </PreBuildEvent> 291 298 </PropertyGroup> 292 299 </Project> -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame
r7259 r9363 26 26 27 27 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 28 [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4. 2.$WCREV$")]28 [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.3.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Properties/AssemblyInfo.cs.frame
r7259 r9363 45 45 46 46 [assembly: AssemblyVersion("3.4.0.0")] 47 [assembly: AssemblyFileVersion("3.4. 2.$WCREV$")]47 [assembly: AssemblyFileVersion("3.4.3.$WCREV$")] -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionGrammar.cs
r7733 r9363 181 181 182 182 #region IStatefulItem methods 183 void IStatefulItem.InitializeState() 184 { 183 void IStatefulItem.InitializeState() { 185 184 ReadOnly = false; 186 185 } … … 245 244 var groupSymbol = s as GroupSymbol; 246 245 if (groupSymbol != null) RegisterGroupSymbolEvents(groupSymbol); 247 else s ymbol.Changed += new EventHandler(Symbol_Changed);246 else s.Changed += new EventHandler(Symbol_Changed); 248 247 } 249 248 } … … 255 254 var groupSymbol = s as GroupSymbol; 256 255 if (groupSymbol != null) DeregisterGroupSymbolEvents(groupSymbol); 257 else s ymbol.Changed -= new EventHandler(Symbol_Changed);256 else s.Changed -= new EventHandler(Symbol_Changed); 258 257 } 259 258 } -
branches/OaaS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeTerminalNode.cs
r7259 r9363 30 30 public abstract class SymbolicExpressionTreeTerminalNode : SymbolicExpressionTreeNode { 31 31 public override IEnumerable<ISymbolicExpressionTreeNode> Subtrees { 32 get { 33 return Enumerable.Empty<ISymbolicExpressionTreeNode>(); 34 } 32 get { return Enumerable.Empty<ISymbolicExpressionTreeNode>(); } 35 33 } 36 34
Note: See TracChangeset
for help on using the changeset viewer.