Changeset 12895
- Timestamp:
- 08/25/15 10:38:20 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 13 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab 3.3.sln
r12846 r12895 434 434 EndProject 435 435 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.Orienteering-3.3", "HeuristicLab.Problems.Instances.Orienteering\3.3\HeuristicLab.Problems.Instances.Orienteering-3.3.csproj", "{B37BF2DD-752C-456A-9DEF-FF5B41FC3C77}" 436 EndProject 437 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.ArtificialAnt-3.5", "HeuristicLab.Problems.ArtificialAnt\3.5\HeuristicLab.Problems.ArtificialAnt-3.5.csproj", "{FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}" 438 EndProject 439 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.ArtificialAnt.Views-3.5", "HeuristicLab.Problems.ArtificialAnt.Views\3.5\HeuristicLab.Problems.ArtificialAnt.Views-3.5.csproj", "{0ABD192C-926A-47A9-878C-79B6AF5C07C9}" 436 440 EndProject 437 441 Global … … 2113 2117 {B37BF2DD-752C-456A-9DEF-FF5B41FC3C77}.Release|x86.ActiveCfg = Release|x86 2114 2118 {B37BF2DD-752C-456A-9DEF-FF5B41FC3C77}.Release|x86.Build.0 = Release|x86 2119 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2120 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|Any CPU.Build.0 = Debug|Any CPU 2121 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|x64.ActiveCfg = Debug|x64 2122 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|x64.Build.0 = Debug|x64 2123 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|x86.ActiveCfg = Debug|x86 2124 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Debug|x86.Build.0 = Debug|x86 2125 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|Any CPU.ActiveCfg = Release|Any CPU 2126 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|Any CPU.Build.0 = Release|Any CPU 2127 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|x64.ActiveCfg = Release|x64 2128 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|x64.Build.0 = Release|x64 2129 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|x86.ActiveCfg = Release|x86 2130 {FCB5E075-4B97-4CB9-BB36-848E4FF9EA18}.Release|x86.Build.0 = Release|x86 2131 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2132 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|Any CPU.Build.0 = Debug|Any CPU 2133 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|x64.ActiveCfg = Debug|x64 2134 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|x64.Build.0 = Debug|x64 2135 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|x86.ActiveCfg = Debug|x86 2136 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Debug|x86.Build.0 = Debug|x86 2137 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|Any CPU.ActiveCfg = Release|Any CPU 2138 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|Any CPU.Build.0 = Release|Any CPU 2139 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|x64.ActiveCfg = Release|x64 2140 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|x64.Build.0 = Release|x64 2141 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|x86.ActiveCfg = Release|x86 2142 {0ABD192C-926A-47A9-878C-79B6AF5C07C9}.Release|x86.Build.0 = Release|x86 2115 2143 EndGlobalSection 2116 2144 GlobalSection(SolutionProperties) = preSolution … … 2119 2147 GlobalSection(NestedProjects) = preSolution 2120 2148 {5E516C4F-9935-437F-8B15-ECEF4451744E} = {D1B1DE45-F9C7-4FBF-B73C-E759BC4223D5} 2149 {0C67A033-F6D9-4237-B3CA-C033A44706BE} = {D1B1DE45-F9C7-4FBF-B73C-E759BC4223D5} 2150 {3083C7AA-5AF4-4C75-BA19-B69B86E2F66A} = {D1B1DE45-F9C7-4FBF-B73C-E759BC4223D5} 2121 2151 EndGlobalSection 2122 2152 EndGlobal -
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.5/AntTrailSymbolicExpressionTreeView.Designer.cs
r12012 r12895 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 this.animationTimer = new System.Windows.Forms.Timer(this.components);49 48 this.symExpressionGroupBox = new System.Windows.Forms.GroupBox(); 50 49 this.SuspendLayout(); 51 // 52 // animationTimer 53 // 54 this.animationTimer.Interval = 15; 50 55 51 // 56 52 // symExpressionGroupBox … … 79 75 #endregion 80 76 81 private System.Windows.Forms.Timer animationTimer;82 77 private System.Windows.Forms.GroupBox symExpressionGroupBox; 83 78 -
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.5/AntTrailSymbolicExpressionTreeView.cs
r12012 r12895 30 30 [Content(typeof(AntTrail), false)] 31 31 public sealed partial class AntTrailSymbolicExpressionTreeView : ItemView { 32 private GraphicalSymbolicExpressionTreeView treeView;32 private readonly GraphicalSymbolicExpressionTreeView treeView; 33 33 34 34 public new AntTrail Content { … … 44 44 } 45 45 46 protected override void DeregisterContentEvents() {47 Content.SymbolicExpressionTreeChanged -= new EventHandler(Content_SymbolicExpressionTreeChanged);48 base.DeregisterContentEvents();49 }50 protected override void RegisterContentEvents() {51 base.RegisterContentEvents();52 Content.SymbolicExpressionTreeChanged += new EventHandler(Content_SymbolicExpressionTreeChanged);53 }54 55 46 protected override void OnContentChanged() { 56 47 base.OnContentChanged(); … … 61 52 } 62 53 } 63 64 void Content_SymbolicExpressionTreeChanged(object sender, EventArgs e) {65 if (InvokeRequired)66 Invoke(new EventHandler(Content_SymbolicExpressionTreeChanged), sender, e);67 else68 OnContentChanged();69 }70 54 } 71 55 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.5/AntTrailView.cs
r12012 r12895 41 41 } 42 42 43 protected override void DeregisterContentEvents() {44 Content.SymbolicExpressionTreeChanged -= new EventHandler(Content_SymbolicExpressionTreeChanged);45 base.DeregisterContentEvents();46 }47 protected override void RegisterContentEvents() {48 base.RegisterContentEvents();49 Content.SymbolicExpressionTreeChanged += new EventHandler(Content_SymbolicExpressionTreeChanged);50 }51 52 43 protected override void OnContentChanged() { 53 44 base.OnContentChanged(); … … 69 60 int rows = Content.World.Rows; 70 61 int columns = Content.World.Columns; 71 SymbolicExpressionTreeexpression = Content.SymbolicExpressionTree;62 var expression = Content.SymbolicExpressionTree; 72 63 73 64 DrawWorld(); … … 76 67 float cellWidth = pictureBox.Width / (float)columns; 77 68 78 AntInterpreter interpreter = new AntInterpreter(); 79 interpreter.MaxTimeSteps = Content.MaxTimeSteps.Value; 80 interpreter.Expression = Content.SymbolicExpressionTree; 81 interpreter.World = Content.World; 69 AntInterpreter interpreter = new AntInterpreter(Content.SymbolicExpressionTree, Content.World, Content.MaxTimeSteps); 82 70 int currentAntLocationColumn; 83 71 int currentAntLocationRow; … … 155 143 } 156 144 157 void Content_SymbolicExpressionTreeChanged(object sender, EventArgs e) {158 if (InvokeRequired)159 Invoke(new EventHandler(Content_SymbolicExpressionTreeChanged), sender, e);160 else161 GenerateImage();162 }163 164 145 private void pictureBox_SizeChanged(object sender, EventArgs e) { 165 146 GenerateImage(); … … 170 151 private void playButton_Click(object sender, EventArgs e) { 171 152 playButton.Enabled = false; 172 int rows = Content.World.Rows;173 int columns = Content.World.Columns;174 SymbolicExpressionTree expression = Content.SymbolicExpressionTree;175 var nodeStack = new Stack<SymbolicExpressionTreeNode>();176 153 177 animationInterpreter = new AntInterpreter(); 178 animationInterpreter.MaxTimeSteps = Content.MaxTimeSteps.Value; 179 animationInterpreter.Expression = Content.SymbolicExpressionTree; 180 animationInterpreter.World = Content.World; 154 animationInterpreter = new AntInterpreter(Content.SymbolicExpressionTree, Content.World, Content.MaxTimeSteps); 181 155 182 156 DrawWorld(); -
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.5/Plugin.cs.frame
r12753 r12895 26 26 27 27 namespace HeuristicLab.Problems.ArtificialAnt.Views { 28 [Plugin("HeuristicLab.Problems.ArtificialAnt.Views","Provides views for the artificial ant problem.", "3. 4.8.$WCREV$")]29 [PluginFile("HeuristicLab.Problems.ArtificialAnt.Views-3. 4.dll", PluginFileType.Assembly)]28 [Plugin("HeuristicLab.Problems.ArtificialAnt.Views","Provides views for the artificial ant problem.", "3.5.0.$WCREV$")] 29 [PluginFile("HeuristicLab.Problems.ArtificialAnt.Views-3.5.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Core", "3.3")] 31 31 [PluginDependency("HeuristicLab.Core.Views", "3.3")] … … 35 35 [PluginDependency("HeuristicLab.MainForm", "3.3")] 36 36 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 37 [PluginDependency("HeuristicLab.Problems.ArtificialAnt", "3. 4")]37 [PluginDependency("HeuristicLab.Problems.ArtificialAnt", "3.5")] 38 38 public class HeuristicLabProblemsArtificialAntViewsPlugin : PluginBase { 39 39 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt.Views/3.5/Properties/AssemblyInfo.cs.frame
r12753 r12895 52 52 // You can specify all the values or you can default the Revision and Build Numbers 53 53 // by using the '*' as shown below: 54 [assembly: AssemblyVersion("3. 4.0.0")]55 [assembly: AssemblyFileVersion("3. 4.8.$WCREV$")]54 [assembly: AssemblyVersion("3.5.0.0")] 55 [assembly: AssemblyFileVersion("3.5.0.$WCREV$")] -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/ArtificialAntProblem.cs
r12504 r12895 35 35 namespace HeuristicLab.Problems.ArtificialAnt { 36 36 [Item("Artificial Ant Problem", "Represents the Artificial Ant problem.")] 37 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 170)]38 37 [StorableClass] 39 38 public sealed class ArtificialAntProblem : SingleObjectiveHeuristicOptimizationProblem<Evaluator, ISymbolicExpressionTreeCreator>, IStorableContent { -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/Analyzers/BestAntTrailAnalyzer.cs
r12012 r12895 36 36 [Item("BestAntTrailAnalyzer", "An operator for analyzing the best ant trail of an artificial ant problem.")] 37 37 [StorableClass] 38 public sealed class BestAntTrailAnalyzer : SingleSuccessorOperator, I AntTrailAnalyzer, ISingleObjectiveOperator {38 public sealed class BestAntTrailAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer { 39 39 public bool EnabledByDefault { 40 40 get { return true; } 41 41 } 42 42 43 public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 44 get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; } 45 } 43 46 public ILookupParameter<BoolMatrix> WorldParameter { 44 47 get { return (ILookupParameter<BoolMatrix>)Parameters["World"]; } 45 48 } 46 public ScopeTreeLookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 47 get { return (ScopeTreeLookupParameter<SymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; } 48 } 49 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 50 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 49 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 50 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 51 51 } 52 52 public ILookupParameter<IntValue> MaxTimeStepsParameter { … … 56 56 get { return (ILookupParameter<AntTrail>)Parameters["BestSolution"]; } 57 57 } 58 public ValueLookupParameter<ResultCollection> ResultsParameter {59 get { return ( ValueLookupParameter<ResultCollection>)Parameters["Results"]; }58 public ILookupParameter<ResultCollection> ResultsParameter { 59 get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; } 60 60 } 61 61 … … 63 63 : base() { 64 64 Parameters.Add(new LookupParameter<BoolMatrix>("World", "The world with food items for the artificial ant.")); 65 Parameters.Add(new ScopeTreeLookupParameter< SymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solutions from which the best solution should be visualized."));65 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solutions from which the best solution should be visualized.")); 66 66 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the artificial ant solutions which should be visualized.")); 67 67 Parameters.Add(new LookupParameter<AntTrail>("BestSolution", "The visual representation of the best ant trail.")); 68 68 Parameters.Add(new LookupParameter<IntValue>("MaxTimeSteps", "The maximal time steps that the artificial ant has available to collect all food items.")); 69 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best artificial ant solution should be stored."));69 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The result collection where the best artificial ant solution should be stored.")); 70 70 } 71 71 … … 80 80 81 81 public override IOperation Apply() { 82 ItemArray<SymbolicExpressionTree>expressions = SymbolicExpressionTreeParameter.ActualValue;82 var expressions = SymbolicExpressionTreeParameter.ActualValue; 83 83 ItemArray<DoubleValue> qualities = QualityParameter.ActualValue; 84 84 BoolMatrix world = WorldParameter.ActualValue; 85 IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue;85 int maxTimeSteps = MaxTimeStepsParameter.ActualValue.Value; 86 86 ResultCollection results = ResultsParameter.ActualValue; 87 87 88 int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => -x.Value).First().index;88 int bestIdx = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index; // find index of maximum element 89 89 90 90 AntTrail antTrail = BestSolutionParameter.ActualValue; 91 91 if (antTrail == null) { 92 var bestAntTrail = new AntTrail(world, expressions[ i], maxTimeSteps);92 var bestAntTrail = new AntTrail(world, expressions[bestIdx], maxTimeSteps, qualities[bestIdx].Value); 93 93 BestSolutionParameter.ActualValue = bestAntTrail; 94 94 results.Add(new Result("Best Artificial Ant Solution", bestAntTrail)); 95 } else { 96 antTrail.World = world; 97 antTrail.SymbolicExpressionTree = expressions[i]; 98 antTrail.MaxTimeSteps = maxTimeSteps; 99 results["Best Artificial Ant Solution"].Value = antTrail; 95 } else if (antTrail.Quality < qualities[bestIdx].Value) { 96 results["Best Artificial Ant Solution"].Value = new AntTrail(world, expressions[bestIdx], maxTimeSteps, qualities[bestIdx].Value); 100 97 } 101 98 return base.Apply(); 102 99 } 100 103 101 } 104 102 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/AntInterpreter.cs
r12012 r12895 25 25 using HeuristicLab.Data; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Problems.ArtificialAnt.Symbols;28 27 29 28 namespace HeuristicLab.Problems.ArtificialAnt { 30 29 public class AntInterpreter { 31 30 32 public int MaxTimeSteps { get; set; } 33 public int FoodEaten { get; set; } 34 private BoolMatrix world; 35 public BoolMatrix World { 36 get { return world; } 37 set { 38 // create a clone of the world because the ant will remove the food items it can find. 39 world = (BoolMatrix)value.Clone(); 40 CountFoodItems(); 41 } 42 } 31 public int MaxTimeSteps { get; private set; } 32 public int FoodEaten { get; private set; } 33 public BoolMatrix World { get; private set; } 43 34 44 private SymbolicExpressionTree expression; 45 public SymbolicExpressionTree Expression { 46 get { return expression; } 47 set { 48 expression = value; 49 } 50 } 51 52 private SymbolicExpressionTreeNode FindMatchingFunction(string name) { 53 foreach (var defunBranch in expression.Root.Subtrees.OfType<DefunTreeNode>()) { 54 if (defunBranch.FunctionName == name) return defunBranch; 55 } 56 throw new ArgumentException("Function definition for " + name + " not found."); 57 } 58 35 public ISymbolicExpressionTree Expression { get; private set; } 59 36 60 37 … … 65 42 private int nFoodItems; 66 43 private Stack<ISymbolicExpressionTreeNode> nodeStack = new Stack<ISymbolicExpressionTreeNode>(); 44 45 public AntInterpreter(ISymbolicExpressionTree tree, BoolMatrix world, int maxTimeSteps) { 46 this.Expression = tree; 47 this.MaxTimeSteps = maxTimeSteps; 48 // create a clone of the world because the ant will remove the food items it can find. 49 World = (BoolMatrix)world.Clone(); 50 CountFoodItems(); 51 } 67 52 68 53 private void CountFoodItems() { … … 97 82 98 83 var currentNode = nodeStack.Pop(); 99 if (currentNode.Symbol is Left) {84 if (currentNode.Symbol.Name == "Left") { 100 85 currentDirection = (currentDirection + 3) % 4; 101 86 ElapsedTime++; 102 } else if (currentNode.Symbol is Right) {87 } else if (currentNode.Symbol.Name == "Right") { 103 88 currentDirection = (currentDirection + 1) % 4; 104 89 ElapsedTime++; 105 } else if (currentNode.Symbol is Move) {90 } else if (currentNode.Symbol.Name == "Move") { 106 91 MoveAntForward(); 107 if (World[currentAntLocationRow, currentAntLocationColumn]) 92 if (World[currentAntLocationRow, currentAntLocationColumn]) { 108 93 FoodEaten++; 109 World[currentAntLocationRow, currentAntLocationColumn] = false; 94 World[currentAntLocationRow, currentAntLocationColumn] = false; 95 } 110 96 ElapsedTime++; 111 } else if (currentNode.Symbol is IfFoodAhead) {97 } else if (currentNode.Symbol.Name == "IfFoodAhead") { 112 98 int nextAntLocationRow; 113 99 int nextAntLocationColumn; … … 118 104 nodeStack.Push(currentNode.GetSubtree(1)); 119 105 } 120 } else if (currentNode.Symbol is Prog2) {106 } else if (currentNode.Symbol.Name == "Prog2") { 121 107 nodeStack.Push(currentNode.GetSubtree(1)); 122 108 nodeStack.Push(currentNode.GetSubtree(0)); 123 return; 124 } else if (currentNode.Symbol is Prog3) { 109 } else if (currentNode.Symbol.Name == "Prog3") { 125 110 nodeStack.Push(currentNode.GetSubtree(2)); 126 111 nodeStack.Push(currentNode.GetSubtree(1)); 127 112 nodeStack.Push(currentNode.GetSubtree(0)); 128 return;129 113 } else if (currentNode.Symbol is InvokeFunction) { 130 114 var invokeNode = currentNode as InvokeFunctionTreeNode; … … 171 155 } 172 156 } 157 158 159 private SymbolicExpressionTreeNode FindMatchingFunction(string name) { 160 foreach (var defunBranch in Expression.Root.Subtrees.OfType<DefunTreeNode>()) { 161 if (defunBranch.FunctionName == name) return defunBranch; 162 } 163 throw new ArgumentException("Function definition for " + name + " not found."); 164 } 173 165 } 174 166 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/AntTrail.cs
r12012 r12895 39 39 } 40 40 [Storable] 41 private SymbolicExpressionTree expression; 42 public SymbolicExpressionTree SymbolicExpressionTree { 43 get { return expression; } 44 set { 45 if (expression != value) { 46 //if (expression != null) DeregisterSymbolicExpressionTreeEvents(); 47 expression = value; 48 //if (expression != null) RegisterSymbolicExpressionTreeEvents(); 49 OnSymbolicExpressionTreeChanged(); 50 } 51 } 52 } 41 public ISymbolicExpressionTree SymbolicExpressionTree { get; private set; } 42 [Storable] 43 public BoolMatrix World { get; private set; } 44 [Storable] 45 public int MaxTimeSteps { get; private set; } 46 [Storable] 47 public double Quality { get; private set; } 53 48 54 [Storable] 55 private BoolMatrix world; 56 public BoolMatrix World { 57 get { return world; } 58 set { 59 if (world != value) { 60 if (world != null) DeregisterWorldEvents(); 61 world = value; 62 if (world != null) RegisterWorldEvents(); 63 OnWorldChanged(); 64 } 65 } 66 } 67 [Storable] 68 private IntValue maxTimeSteps; 69 public IntValue MaxTimeSteps { 70 get { return maxTimeSteps; } 71 set { 72 if (maxTimeSteps != value) { 73 if (maxTimeSteps != value) { 74 if (maxTimeSteps != null) DeregisterMaxTimeStepsEvents(); 75 maxTimeSteps = value; 76 if (maxTimeSteps != null) RegisterMaxTimeStepsEvents(); 77 OnWorldChanged(); 78 } 79 } 80 } 81 } 82 83 public AntTrail() : base() { } 84 public AntTrail(BoolMatrix world, SymbolicExpressionTree expression, IntValue maxTimeSteps) 85 : this() { 86 this.world = world; 87 this.expression = expression; 88 this.maxTimeSteps = maxTimeSteps; 89 Initialize(); 49 public AntTrail(BoolMatrix world, ISymbolicExpressionTree expression, int maxTimeSteps, double quality) { 50 this.World = world; 51 this.SymbolicExpressionTree = expression; 52 this.MaxTimeSteps = maxTimeSteps; 53 this.Quality = quality; 90 54 } 91 55 … … 93 57 private AntTrail(bool deserializing) : base(deserializing) { } 94 58 [StorableHook(HookType.AfterDeserialization)] 95 private void AfterDeserialization() { 96 Initialize(); 97 } 59 private void AfterDeserialization() { } 60 98 61 private AntTrail(AntTrail original, Cloner cloner) 99 62 : base(original, cloner) { 100 expression = cloner.Clone(original.expression);101 world = cloner.Clone(original.world);102 maxTimeSteps = cloner.Clone(original.maxTimeSteps);103 Initialize();63 SymbolicExpressionTree = cloner.Clone(original.SymbolicExpressionTree); 64 World = cloner.Clone(original.World); 65 MaxTimeSteps = original.MaxTimeSteps; 66 Quality = original.Quality; 104 67 } 68 105 69 public override IDeepCloneable Clone(Cloner cloner) { 106 70 return new AntTrail(this, cloner); 107 71 } 108 109 private void Initialize() {110 //if (expression != null) RegisterSymbolicExpressionTreeEvents();111 if (world != null) RegisterWorldEvents();112 if (maxTimeSteps != null) RegisterMaxTimeStepsEvents();113 }114 115 #region Events116 public event EventHandler SymbolicExpressionTreeChanged;117 private void OnSymbolicExpressionTreeChanged() {118 var changed = SymbolicExpressionTreeChanged;119 if (changed != null) changed(this, EventArgs.Empty);120 }121 public event EventHandler WorldChanged;122 private void OnWorldChanged() {123 var changed = WorldChanged;124 if (changed != null) changed(this, EventArgs.Empty);125 }126 public event EventHandler MaxTimeStepsChanged;127 private void OnMaxTimeStepsChanged() {128 var changed = MaxTimeStepsChanged;129 if (changed != null) changed(this, EventArgs.Empty);130 }131 132 //private void RegisterSymbolicExpressionTreeEvents() {133 // SymbolicExpressionTree.ItemChanged += new EventHandler<EventArgs<int>>(SymbolicExpressionTree_ItemChanged);134 // SymbolicExpressionTree.Reset += new EventHandler(SymbolicExpressionTree_Reset);135 //}136 //private void DeregisterSymbolicExpressionTreeEvents() {137 // SymbolicExpressionTree.ItemChanged -= new EventHandler<EventArgs<int>>(SymbolicExpressionTree_ItemChanged);138 // SymbolicExpressionTree.Reset -= new EventHandler(SymbolicExpressionTree_Reset);139 //}140 141 private void RegisterWorldEvents() {142 World.ItemChanged += new EventHandler<EventArgs<int, int>>(World_ItemChanged);143 World.Reset += new EventHandler(World_Reset);144 }145 private void DeregisterWorldEvents() {146 World.ItemChanged -= new EventHandler<EventArgs<int, int>>(World_ItemChanged);147 World.Reset -= new EventHandler(World_Reset);148 }149 private void RegisterMaxTimeStepsEvents() {150 MaxTimeSteps.ValueChanged += new EventHandler(MaxTimeSteps_ValueChanged);151 }152 private void DeregisterMaxTimeStepsEvents() {153 MaxTimeSteps.ValueChanged -= new EventHandler(MaxTimeSteps_ValueChanged);154 }155 156 void MaxTimeSteps_ValueChanged(object sender, EventArgs e) {157 OnMaxTimeStepsChanged();158 }159 private void World_ItemChanged(object sender, EventArgs<int, int> e) {160 OnWorldChanged();161 }162 private void World_Reset(object sender, EventArgs e) {163 OnWorldChanged();164 }165 #endregion166 72 } 167 73 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/ArtificialAntProblem.cs
r12504 r12895 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Diagnostics.Contracts; 24 25 using System.Linq; 25 26 using HeuristicLab.Common; … … 37 38 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 170)] 38 39 [StorableClass] 39 public sealed class ArtificialAntProblem : SingleObjective HeuristicOptimizationProblem<Evaluator, ISymbolicExpressionTreeCreator>, IStorableContent {40 public sealed class ArtificialAntProblem : SingleObjectiveBasicProblem<SymbolicExpressionTreeEncoding>, IStorableContent { 40 41 public string Filename { get; set; } 41 42 42 43 #region constant for default world (Santa Fe) 43 private readonly bool[,] santaFeAntTrail = new bool[,] { 44 {false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 45 {false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 46 {false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, false, false, false, false}, 47 {false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, false, false}, 48 {false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, false, false}, 49 {false, false, false, true, true, true, true, false, true, true, true, true, true, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false}, 50 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false}, 51 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false}, 52 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false}, 53 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false}, 54 {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false}, 55 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 56 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false}, 57 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false}, 58 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, true, true, true, false, false, false}, 59 {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false, false}, 60 {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 61 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 62 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false}, 63 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false}, 64 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 65 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 66 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false}, 67 {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false}, 68 {false, false, false, true, true, false, false, true, true, true, true, true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 69 {false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 70 {false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 71 {false, true, false, false, false, false, false, false, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 72 {false, true, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 73 {false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}, 74 {false, false, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }, 75 {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false } 44 45 private static readonly char[][] santaFeAntTrail = new[] { 46 " ### ".ToCharArray(), 47 " # ".ToCharArray(), 48 " # .###.. ".ToCharArray(), 49 " # # # ".ToCharArray(), 50 " # # # ".ToCharArray(), 51 " ####.##### .##.. . ".ToCharArray(), 52 " # . # ".ToCharArray(), 53 " # # . ".ToCharArray(), 54 " # # . ".ToCharArray(), 55 " # # # ".ToCharArray(), 56 " . # . ".ToCharArray(), 57 " # . . ".ToCharArray(), 58 " # . # ".ToCharArray(), 59 " # # . ".ToCharArray(), 60 " # # ...###. ".ToCharArray(), 61 " . .#... # ".ToCharArray(), 62 " . . . ".ToCharArray(), 63 " # . . ".ToCharArray(), 64 " # # .#... ".ToCharArray(), 65 " # # # ".ToCharArray(), 66 " # # . ".ToCharArray(), 67 " # # . ".ToCharArray(), 68 " # . ...#. ".ToCharArray(), 69 " # . # ".ToCharArray(), 70 " ..##..#####. # ".ToCharArray(), 71 " # # ".ToCharArray(), 72 " # # ".ToCharArray(), 73 " # .#######.. ".ToCharArray(), 74 " # # ".ToCharArray(), 75 " . # ".ToCharArray(), 76 " .####.. ".ToCharArray(), 77 " ".ToCharArray() 76 78 }; 79 80 77 81 #endregion 78 82 79 83 #region Parameter Properties 80 public IValueParameter<ISymbolicExpressionGrammar> ArtificialAntExpressionGrammarParameter {81 get { return (IValueParameter<ISymbolicExpressionGrammar>)Parameters["ArtificialAntExpressionGrammar"]; }82 }83 public IValueParameter<IntValue> MaxExpressionLengthParameter {84 get { return (IValueParameter<IntValue>)Parameters["MaximumExpressionLength"]; }85 }86 public IValueParameter<IntValue> MaxExpressionDepthParameter {87 get { return (IValueParameter<IntValue>)Parameters["MaximumExpressionDepth"]; }88 }89 public IValueParameter<IntValue> MaxFunctionDefinitionsParameter {90 get { return (IValueParameter<IntValue>)Parameters["MaximumFunctionDefinitions"]; }91 }92 public IValueParameter<IntValue> MaxFunctionArgumentsParameter {93 get { return (ValueParameter<IntValue>)Parameters["MaximumFunctionArguments"]; }94 }95 84 public IValueParameter<BoolMatrix> WorldParameter { 96 85 get { return (IValueParameter<BoolMatrix>)Parameters["World"]; } … … 110 99 set { MaxTimeStepsParameter.Value = value; } 111 100 } 112 public IntValue MaxExpressionLength { 113 get { return MaxExpressionLengthParameter.Value; } 114 set { MaxExpressionLengthParameter.Value = value; } 115 } 116 public IntValue MaxExpressionDepth { 117 get { return MaxExpressionDepthParameter.Value; } 118 set { MaxExpressionDepthParameter.Value = value; } 119 } 120 public IntValue MaxFunctionDefinitions { 121 get { return MaxFunctionDefinitionsParameter.Value; } 122 set { MaxFunctionDefinitionsParameter.Value = value; } 123 } 124 public IntValue MaxFunctionArguments { 125 get { return MaxFunctionArgumentsParameter.Value; } 126 set { MaxFunctionArgumentsParameter.Value = value; } 127 } 128 public ArtificialAntExpressionGrammar ArtificialAntExpressionGrammar { 129 get { return (ArtificialAntExpressionGrammar)ArtificialAntExpressionGrammarParameter.Value; } 130 } 131 public IEnumerable<IAntTrailAnalyzer> AntTrailAnalyzers { 132 get { return Operators.OfType<IAntTrailAnalyzer>(); } 133 } 134 #endregion 135 136 // BackwardsCompatibility3.3 137 #region Backwards compatible code, remove with 3.4 138 [Obsolete] 139 [Storable(Name = "operators")] 140 private IEnumerable<IOperator> oldOperators { 141 get { return null; } 142 set { 143 if (value != null && value.Any()) 144 Operators.AddRange(value); 145 } 146 } 147 #endregion 148 101 #endregion 102 103 public override bool Maximization { 104 get { return true; } 105 } 106 107 public ArtificialAntProblem() 108 : base() { 109 BoolMatrix world = new BoolMatrix(ToBoolMatrix(santaFeAntTrail)); 110 Parameters.Add(new ValueParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.", world)); 111 Parameters.Add(new ValueParameter<IntValue>("MaximumTimeSteps", "The number of time steps the artificial ant has available to collect all food items.", new IntValue(600))); 112 113 base.BestKnownQuality = 89; 114 var g = new SimpleSymbolicExpressionGrammar(); 115 g.AddSymbols(new string[] { "IfFoodAhead", "Prog2" }, 2, 2); 116 g.AddSymbols(new string[] { "Prog3" }, 3, 3); 117 g.AddTerminalSymbols(new string[] { "Left", "Right", "Move" }); 118 base.Encoding = new SymbolicExpressionTreeEncoding(g, 20, 10); 119 120 InitializeOperators(); 121 RegisterEventHandlers(); 122 } 123 124 125 public override double Evaluate(Individual individual, IRandom random) { 126 var interpreter = new AntInterpreter(individual.SymbolicExpressionTree(), World, MaxTimeSteps.Value); 127 interpreter.Run(); 128 return interpreter.FoodEaten; 129 } 130 131 // persistence 149 132 [StorableConstructor] 150 133 private ArtificialAntProblem(bool deserializing) : base(deserializing) { } … … 154 137 } 155 138 139 // cloning 156 140 private ArtificialAntProblem(ArtificialAntProblem original, Cloner cloner) 157 141 : base(original, cloner) { … … 161 145 return new ArtificialAntProblem(this, cloner); 162 146 } 163 public ArtificialAntProblem()164 : base(new Evaluator(), new ProbabilisticTreeCreator()) {165 BoolMatrix world = new BoolMatrix(santaFeAntTrail);166 Parameters.Add(new ValueParameter<IntValue>("MaximumExpressionLength", "Maximal length of the expression to control the artificial ant.", new IntValue(100)));167 Parameters.Add(new ValueParameter<IntValue>("MaximumExpressionDepth", "Maximal depth of the expression to control the artificial ant.", new IntValue(10)));168 Parameters.Add(new ValueParameter<IntValue>("MaximumFunctionDefinitions", "Maximal number of automatically defined functions in the expression to control the artificial ant.", new IntValue(3)));169 Parameters.Add(new ValueParameter<IntValue>("MaximumFunctionArguments", "Maximal number of arguments of automatically defined functions in the expression to control the artificial ant.", new IntValue(3)));170 Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>("ArtificialAntExpressionGrammar", "The grammar that should be used for artificial ant expressions.", new ArtificialAntExpressionGrammar()));171 Parameters.Add(new ValueParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.", world));172 Parameters.Add(new ValueParameter<IntValue>("MaximumTimeSteps", "The number of time steps the artificial ant has available to collect all food items.", new IntValue(600)));173 174 Maximization.Value = true;175 MaximizationParameter.Hidden = true;176 BestKnownQuality = new DoubleValue(89);177 SolutionCreator.SymbolicExpressionTreeParameter.ActualName = "AntTrailSolution";178 ((ProbabilisticTreeCreator)SolutionCreator).SymbolicExpressionTreeGrammarParameter.ActualName = "ArtificialAntExpressionGrammar";179 Evaluator.QualityParameter.ActualName = "FoodEaten";180 InitializeOperators();181 RegisterEventHandlers();182 183 ArtificialAntExpressionGrammar.MaximumFunctionDefinitions = MaxFunctionDefinitions.Value;184 ArtificialAntExpressionGrammar.MaximumFunctionArguments = MaxFunctionArguments.Value;185 }186 147 187 148 #region Events 188 149 protected override void OnSolutionCreatorChanged() { 189 150 base.OnSolutionCreatorChanged(); 190 SolutionCreator.SymbolicExpressionTreeParameter.ActualName = "AntTrailSolution";191 var grammarBased = SolutionCreator as ISymbolicExpressionTreeGrammarBasedOperator;192 if (grammarBased != null)193 grammarBased.SymbolicExpressionTreeGrammarParameter.ActualName = "ArtificialAntExpressionGrammar";194 195 SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);196 151 ParameterizeAnalyzers(); 197 152 ParameterizeOperators(); … … 199 154 protected override void OnEvaluatorChanged() { 200 155 base.OnEvaluatorChanged(); 201 Evaluator.QualityParameter.ActualName = "FoodEaten";202 Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);203 156 ParameterizeAnalyzers(); 204 157 ParameterizeOperators(); … … 216 169 #region Helpers 217 170 private void RegisterEventHandlers() { 218 SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);171 Encoding.SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged); 219 172 Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 220 MaxFunctionArgumentsParameter.ValueChanged += new EventHandler(MaxFunctionArgumentsParameter_ValueChanged);221 MaxFunctionArguments.ValueChanged += new EventHandler(MaxFunctionArgumentsParameter_ValueChanged);222 MaxFunctionDefinitionsParameter.ValueChanged += new EventHandler(MaxFunctionDefinitionsParameter_ValueChanged);223 MaxFunctionDefinitions.ValueChanged += new EventHandler(MaxFunctionDefinitionsParameter_ValueChanged);224 }225 226 private void MaxFunctionDefinitionsParameter_ValueChanged(object sender, EventArgs e) {227 ArtificialAntExpressionGrammar.MaximumFunctionDefinitions = MaxFunctionDefinitions.Value;228 ParameterizeOperators();229 ParameterizeAnalyzers();230 }231 private void MaxFunctionArgumentsParameter_ValueChanged(object sender, EventArgs e) {232 ArtificialAntExpressionGrammar.MaximumFunctionArguments = MaxFunctionArguments.Value;233 ParameterizeOperators();234 ParameterizeAnalyzers();235 173 } 236 174 237 175 private void InitializeOperators() { 238 Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>());239 176 Operators.Add(new BestAntTrailAnalyzer()); 240 Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());241 Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());242 177 ParameterizeAnalyzers(); 243 178 ParameterizeOperators(); … … 245 180 246 181 private void ParameterizeAnalyzers() { 247 foreach ( IAntTrailAnalyzer analyzer in AntTrailAnalyzers) {182 foreach (var analyzer in Operators.OfType<BestAntTrailAnalyzer>()) { 248 183 analyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 249 analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;184 analyzer.SymbolicExpressionTreeParameter.ActualName = Encoding.SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 250 185 analyzer.WorldParameter.ActualName = WorldParameter.Name; 251 186 analyzer.MaxTimeStepsParameter.ActualName = MaxTimeStepsParameter.Name; 252 187 } 253 foreach (ISymbolicExpressionTreeAnalyzer analyzer in Operators.OfType<ISymbolicExpressionTreeAnalyzer>()) { 254 analyzer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 188 } 189 190 private void ParameterizeOperators() { 191 // no problem-specific operators to parameterize 192 } 193 194 private bool[,] ToBoolMatrix(char[][] ch) { 195 var rows = ch.Length; 196 var cols = ch[0].Length; 197 var b = new bool[rows, cols]; 198 for (int r = 0; r < rows; r++) { 199 Contract.Assert(ch[r].Length == cols); // all rows must have the same number of columns 200 for (int c = 0; c < cols; c++) { 201 b[r, c] = ch[r][c] == '#'; 202 } 255 203 } 256 } 257 258 private void ParameterizeOperators() { 259 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 260 261 foreach (ISymbolicExpressionTreeGrammarBasedOperator op in operators.OfType<ISymbolicExpressionTreeGrammarBasedOperator>()) { 262 op.SymbolicExpressionTreeGrammarParameter.ActualName = ArtificialAntExpressionGrammarParameter.Name; 263 } 264 foreach (ISymbolicExpressionTreeSizeConstraintOperator op in operators.OfType<ISymbolicExpressionTreeSizeConstraintOperator>()) { 265 op.MaximumSymbolicExpressionTreeDepthParameter.ActualName = MaxExpressionDepthParameter.Name; 266 op.MaximumSymbolicExpressionTreeLengthParameter.ActualName = MaxExpressionLengthParameter.Name; 267 268 } 269 foreach (Evaluator op in operators.OfType<Evaluator>()) { 270 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 271 op.MaxTimeStepsParameter.ActualName = MaxTimeStepsParameter.Name; 272 op.WorldParameter.ActualName = WorldParameter.Name; 273 } 274 foreach (ISymbolicExpressionTreeCrossover op in operators.OfType<ISymbolicExpressionTreeCrossover>()) { 275 op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 276 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 277 } 278 foreach (ISymbolicExpressionTreeManipulator op in operators.OfType<ISymbolicExpressionTreeManipulator>()) { 279 op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 280 } 281 foreach (ISymbolicExpressionTreeArchitectureAlteringOperator op in operators.OfType<ISymbolicExpressionTreeArchitectureAlteringOperator>()) { 282 op.MaximumFunctionDefinitionsParameter.ActualName = MaxFunctionDefinitionsParameter.Name; 283 op.MaximumFunctionArgumentsParameter.ActualName = MaxFunctionArgumentsParameter.Name; 284 } 204 return b; 285 205 } 286 206 #endregion -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/Plugin.cs.frame
r12753 r12895 26 26 27 27 namespace HeuristicLab.Problems.ArtificialAnt { 28 [Plugin("HeuristicLab.Problems.ArtificialAnt","Provides all necessary classes to solve the artificial ant problem.", "3. 4.8.$WCREV$")]29 [PluginFile("HeuristicLab.Problems.ArtificialAnt-3. 4.dll", PluginFileType.Assembly)]28 [Plugin("HeuristicLab.Problems.ArtificialAnt","Provides all necessary classes to solve the artificial ant problem.", "3.5.0.$WCREV$")] 29 [PluginFile("HeuristicLab.Problems.ArtificialAnt-3.5.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 31 [PluginDependency("HeuristicLab.Common", "3.3")] -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.5/Properties/AssemblyInfo.cs.frame
r12753 r12895 52 52 // You can specify all the values or you can default the Revision and Build Numbers 53 53 // by using the '*' as shown below: 54 [assembly: AssemblyVersion("3. 4.0.0")]55 [assembly: AssemblyFileVersion("3. 4.8.$WCREV$")]54 [assembly: AssemblyVersion("3.5.0.0")] 55 [assembly: AssemblyFileVersion("3.5.0.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.