- Timestamp:
- 03/25/10 19:19:37 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3
- Files:
-
- 5 added
- 19 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3
-
Property
svn:ignore
set to
bin
*.user
obj
-
Property
svn:ignore
set to
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Creators/ProbabilisticTreeCreator.cs
r3218 r3219 23 23 using HeuristicLab.Data; 24 24 using HeuristicLab.Random; 25 using HeuristicLab.GP.Interfaces;26 25 using System; 27 26 28 namespace HeuristicLab. GP.Operators{27 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 28 public class ProbabilisticTreeCreator : OperatorBase { 30 29 private static int MAX_TRIES { get { return 100; } } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Creators/RampedTreeCreator.cs
r3218 r3219 25 25 using HeuristicLab.Random; 26 26 using System.Diagnostics; 27 using HeuristicLab.GP.Interfaces;28 27 29 namespace HeuristicLab. GP.Operators{28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 30 29 public class RampedTreeCreator : OperatorBase { 31 30 public override string Description { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/GPCrossoverBase.cs
r3218 r3219 23 23 using HeuristicLab.Core; 24 24 using System.Diagnostics; 25 using HeuristicLab.Evolutionary;26 using HeuristicLab.GP.Interfaces;27 25 28 namespace HeuristicLab. GP.Operators{26 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 27 public abstract class GPCrossoverBase : CrossoverBase { 30 28 public GPCrossoverBase() -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/LangdonHomologousCrossOver.cs
r3218 r3219 25 25 using HeuristicLab.GP.Interfaces; 26 26 27 namespace HeuristicLab. GP.Operators{27 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 28 28 /// <summary> 29 29 /// Implementation of a homologous crossover operator as described in: -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/OnePointCrossOver.cs
r3218 r3219 24 24 using HeuristicLab.GP.Interfaces; 25 25 26 namespace HeuristicLab. GP.Operators{26 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 27 27 /// <summary> 28 28 /// Implementation of a homologous one point crossover operator as described in: -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/SizeConstrictedGPCrossoverBase.cs
r3218 r3219 24 24 using HeuristicLab.GP.Interfaces; 25 25 26 namespace HeuristicLab. GP.Operators{26 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 27 27 public abstract class SizeConstrictedGPCrossoverBase : GPCrossoverBase { 28 28 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/SizeFairCrossOver.cs
r3218 r3219 26 26 using HeuristicLab.Random; 27 27 28 namespace HeuristicLab. GP.Operators{28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 29 /// <summary> 30 30 /// Implementation of a size fair crossover operator as described in: -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/StandardCrossOver.cs
r3218 r3219 24 24 using HeuristicLab.GP.Interfaces; 25 25 26 namespace HeuristicLab. GP.Operators{26 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 27 27 public class StandardCrossOver : SizeConstrictedGPCrossoverBase { 28 28 private int MaxRecombinationTries { get { return 20; } } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Crossovers/UniformCrossover.cs
r3218 r3219 22 22 using System.Collections.Generic; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.GP.Interfaces;25 24 26 namespace HeuristicLab. GP.Operators{25 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 27 26 /// <summary> 28 27 /// Implementation of a homologous uniform crossover operator as described in: -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/HeuristicLabEncodingsSymbolicExpressionTreePlugin.cs.frame
r3218 r3219 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-20 08Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using HeuristicLab.PluginInfrastructure; 26 26 27 namespace HeuristicLab.GP.Operators { 28 [Plugin("HeuristicLab.GP.Operators", "3.3.0.$WCREV$")] 29 [PluginFile("HeuristicLab.GP.Operators-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Core-3.2")] 31 [PluginDependency("HeuristicLab.Data-3.2")] 32 [PluginDependency("HeuristicLab.Evolutionary-3.2")] 33 [PluginDependency("HeuristicLab.GP", "3.3")] 34 [PluginDependency("HeuristicLab.GP.Interfaces", "3.3")] 35 [PluginDependency("HeuristicLab.Operators-3.2")] 36 [PluginDependency("HeuristicLab.Random-3.2")] 37 [PluginDependency("HeuristicLab.Selection-3.2")] 38 public class HeuristicLabGPOperatorsPlugin : PluginBase { 27 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 28 [Plugin("HeuristicLab.Encodings.SymbolicExpressionTree", "3.3.0.$WCREV$")] 29 [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTree-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Core", "3.3.0.0")] 31 [PluginDependency("HeuristicLab.Data", "3.3.0.0")] 32 [PluginDependency("HeuristicLab.Optimization", "3.3.0.0")] 33 [PluginDependency("HeuristicLab.Parameters", "3.3.0.0")] 34 [PluginDependency("HeuristicLab.Persistence", "3.3.0.0")] 35 [PluginDependency("HeuristicLab.Random", "3.3.0.0")] 36 public class HeuristicLabEncodingsSymbolicExpressionTreePlugin : PluginBase { 39 37 } 40 38 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Interfaces/IFunction.cs
r3218 r3219 25 25 using HeuristicLab.Core; 26 26 27 namespace HeuristicLab. GP.Interfaces{27 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 28 28 public interface IFunction : IItem { 29 29 string Name { get; } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Interfaces/IFunctionTree.cs
r3218 r3219 25 25 using HeuristicLab.Core; 26 26 27 namespace HeuristicLab. GP.Interfaces{28 public interface IFunctionTree : IStorable{27 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 28 public interface IFunctionTree { 29 29 bool HasLocalParameters { get; } 30 30 IList<IFunctionTree> SubTrees { get; } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/ChangeNodeTypeManipulation.cs
r3218 r3219 27 27 using HeuristicLab.GP.Interfaces; 28 28 29 namespace HeuristicLab. GP.Operators{29 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 30 30 public class ChangeNodeTypeManipulation : GPManipulatorBase { 31 31 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/CutOutNodeManipulation.cs
r3218 r3219 27 27 using HeuristicLab.GP.Interfaces; 28 28 29 namespace HeuristicLab. GP.Operators{29 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 30 30 public class CutOutNodeManipulation : GPManipulatorBase { 31 31 public override string Description { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/DeleteSubTreeManipulation.cs
r3218 r3219 26 26 using HeuristicLab.GP.Interfaces; 27 27 28 namespace HeuristicLab. GP.Operators{28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 29 public class DeleteSubTreeManipulation : GPManipulatorBase { 30 30 public override string Description { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/FullTreeShaker.cs
r3218 r3219 25 25 using HeuristicLab.Random; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.GP.Interfaces;28 using HeuristicLab.Selection;29 27 30 namespace HeuristicLab. GP.Operators{28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 31 29 public class FullTreeShaker : DelegatingOperator { 32 30 public override string Description { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/GPManipulatorBase.cs
r3218 r3219 23 23 using HeuristicLab.Random; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.GP.Interfaces;26 25 27 namespace HeuristicLab. GP.Operators{26 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 28 27 public abstract class GPManipulatorBase : OperatorBase { 29 28 public GPManipulatorBase() -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/OnePointShaker.cs
r3218 r3219 25 25 using HeuristicLab.Random; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Selection;28 using HeuristicLab.GP.Interfaces;29 27 30 namespace HeuristicLab. GP.Operators{28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 31 29 public class OnePointShaker : DelegatingOperator { 32 30 public override string Description { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Manipulators/SubstituteSubTreeManipulation.cs
r3218 r3219 27 27 using HeuristicLab.GP.Interfaces; 28 28 29 namespace HeuristicLab. GP.Operators{29 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 30 30 public class SubstituteSubTreeManipulation : GPManipulatorBase { 31 31 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/Symbol.cs
r3218 r3219 24 24 using System.Text; 25 25 using HeuristicLab.Core; 26 using System.Xml;27 using System.Diagnostics;28 using HeuristicLab.GP.Interfaces;29 26 using System.Linq; 30 27 31 namespace HeuristicLab. GP{32 public abstract class Function : ItemBase, IFunction{33 private List<List< IFunction>> allowedSubFunctions = new List<List<IFunction>>();28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 public abstract class Symbol { 30 private List<List<Symbol>> allowedSubFunctions = new List<List<Symbol>>(); 34 31 private int minArity = -1; 35 32 private int maxArity = -1; … … 88 85 if (allowedSubFunctions.Count > 0) { 89 86 // copy the list of allowed sub-functions from the previous slot 90 allowedSubFunctions.Add(new List< IFunction>(allowedSubFunctions[allowedSubFunctions.Count - 1]));87 allowedSubFunctions.Add(new List<Symbol>(allowedSubFunctions[allowedSubFunctions.Count - 1])); 91 88 } else { 92 89 // add empty list 93 allowedSubFunctions.Add(new List< IFunction>());90 allowedSubFunctions.Add(new List<Symbol>()); 94 91 } 95 92 } … … 107 104 FireChanged(); 108 105 } 109 Debug.Assert(minTreeSize > 0);106 // Debug.Assert(minTreeSize > 0); 110 107 return minTreeSize; 111 108 } … … 118 115 FireChanged(); 119 116 } 120 Debug.Assert(minTreeHeight > 0);117 // Debug.Assert(minTreeHeight > 0); 121 118 return minTreeHeight; 122 119 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTree/3.3/SymbolicExpressionTree.cs
r3218 r3219 24 24 using System.Text; 25 25 using HeuristicLab.Core; 26 using HeuristicLab.GP.Interfaces;27 26 using System.Xml; 28 27 29 namespace HeuristicLab. GP{30 public class FunctionTree : IFunctionTree{31 private List< IFunctionTree> subTrees;28 namespace HeuristicLab.Encodings.SymbolicExpressionTree { 29 public class SymbolicExpressionTree { 30 private List<SymbolicExpressionTree> subTrees; 32 31 private IFunction function; 33 32 34 public FunctionTree() {33 public SymbolicExpressionTree() { 35 34 } 36 35 37 public FunctionTree(IFunction function) {38 subTrees = new List< IFunctionTree>();36 public SymbolicExpressionTree(Symbol symbol) { 37 subTrees = new List<SymbolicExpressionTree>(); 39 38 this.function = function; 40 39 } 41 40 42 protected FunctionTree(FunctionTree original) {41 protected SymbolicExpressionTree(SymbolicExpressionTree original) { 43 42 this.function = original.Function; 44 this.subTrees = new List< IFunctionTree>(original.SubTrees.Count);45 foreach ( IFunctionTree originalSubTree in original.SubTrees) {46 this.SubTrees.Add(( IFunctionTree)originalSubTree.Clone());43 this.subTrees = new List<SymbolicExpressionTree>(original.SubTrees.Count); 44 foreach (SymbolicExpressionTree originalSubTree in original.SubTrees) { 45 this.SubTrees.Add((SymbolicExpressionTree)originalSubTree.Clone()); 47 46 } 48 47 } 49 48 50 #region IFunctionTree Members51 49 public virtual bool HasLocalParameters { 52 50 get { return false; } 53 51 } 54 52 55 public virtual IList< IFunctionTree> SubTrees {53 public virtual IList<SymbolicExpressionTree> SubTrees { 56 54 get { return subTrees; } 57 55 } 58 56 59 public IFunctionFunction {57 public Symbol Function { 60 58 get { return function; } 61 59 protected set { function = value; } … … 64 62 public int GetSize() { 65 63 int size = 1; 66 foreach ( IFunctionTree tree in SubTrees) size += tree.GetSize();64 foreach (SymbolicExpressionTree tree in SubTrees) size += tree.GetSize(); 67 65 return size; 68 66 } … … 70 68 public int GetHeight() { 71 69 int maxHeight = 0; 72 foreach ( IFunctionTree tree in SubTrees) maxHeight = Math.Max(maxHeight, tree.GetHeight());70 foreach (SymbolicExpressionTree tree in SubTrees) maxHeight = Math.Max(maxHeight, tree.GetHeight()); 73 71 return maxHeight + 1; 74 72 } … … 82 80 } 83 81 84 public void AddSubTree( IFunctionTree tree) {82 public void AddSubTree(SymbolicExpressionTree tree) { 85 83 SubTrees.Add(tree); 86 84 } 87 85 88 public virtual void InsertSubTree(int index, IFunctionTree tree) {86 public virtual void InsertSubTree(int index, SymbolicExpressionTree tree) { 89 87 SubTrees.Insert(index, tree); 90 88 } … … 98 96 } 99 97 100 #endregion101 98 102 99 #region IStorable Members … … 107 104 108 105 public virtual object Clone() { 109 return new FunctionTree(this);106 return new SymbolicExpressionTree(this); 110 107 } 111 108
Note: See TracChangeset
for help on using the changeset viewer.