Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntInterpreter.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntInterpreter.cs	(revision 3237)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntInterpreter.cs	(revision 3238)
@@ -83,5 +83,5 @@
     internal void Run(SymbolicExpressionTree tree) {
       while (FoodEaten < N_FOOD_ITEMS && ElapsedTime < MaxTimeSteps) {
-        Step(tree.Root);
+        Step(tree.Root.SubTrees[0]);
       }
     }
@@ -117,5 +117,5 @@
         Step(currentNode.SubTrees[2]);
         return;
-      } else {
+      } else  {
         throw new InvalidOperationException(currentNode.Symbol.ToString());
       }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrail.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrail.cs	(revision 3238)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrail.cs	(revision 3238)
@@ -0,0 +1,87 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.ArtificialAnt {
+  /// <summary>
+  /// Represents a trail of an artificial ant which can be visualized in the GUI.
+  /// </summary>
+  [Item("AntTrail", "Represents a trail of an artificial ant which can be visualized in the GUI.")]
+  [StorableClass]
+  public sealed class AntTrail : Item {
+    private SymbolicExpressionTree expression;
+    [Storable]
+    public SymbolicExpressionTree SymbolicExpressionTree {
+      get { return expression; }
+      set {
+        if (expression != value) {
+          //if (expression != null) DeregisterSymbolicExpressionTreeEvents();
+          expression = value;
+          //if (expression != null) RegisterSymbolicExpressionTreeEvents();
+          OnSymbolicExpressionTreeChanged();
+        }
+      }
+    }
+
+    public AntTrail() : base() { }
+    public AntTrail(SymbolicExpressionTree expression)
+      : this() {
+      SymbolicExpressionTree = expression;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      AntTrail clone = new AntTrail();
+      cloner.RegisterClonedObject(this, clone);
+      clone.expression = (SymbolicExpressionTree)cloner.Clone(expression);
+      return clone;
+    }
+
+    //#region Events
+    public event EventHandler SymbolicExpressionTreeChanged;
+    private void OnSymbolicExpressionTreeChanged() {
+      if (SymbolicExpressionTreeChanged != null)
+        SymbolicExpressionTreeChanged(this, EventArgs.Empty);
+    }
+
+    //private void RegisterSymbolicExpressionTreeEvents() {
+    //  SymbolicExpressionTree.ItemChanged += new EventHandler<EventArgs<int>>(SymbolicExpressionTree_ItemChanged);
+    //  SymbolicExpressionTree.Reset += new EventHandler(SymbolicExpressionTree_Reset);
+    //}
+    //private void DeregisterSymbolicExpressionTreeEvents() {
+    //  SymbolicExpressionTree.ItemChanged -= new EventHandler<EventArgs<int>>(SymbolicExpressionTree_ItemChanged);
+    //  SymbolicExpressionTree.Reset -= new EventHandler(SymbolicExpressionTree_Reset);
+    //}
+
+    //private void SymbolicExpressionTree_ItemChanged(object sender, EventArgs<int> e) {
+    //  OnSymbolicExpressionTreeChanged();
+    //}
+    //private void SymbolicExpressionTree_Reset(object sender, EventArgs e) {
+    //  OnSymbolicExpressionTreeChanged();
+    //}
+    //#endregion
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.Designer.cs	(revision 3238)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.Designer.cs	(revision 3238)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Problems.ArtificialAnt {
+  partial class AntTrailView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.pictureBox = new System.Windows.Forms.PictureBox();
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // pictureBox
+      // 
+      this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.pictureBox.BackColor = System.Drawing.Color.White;
+      this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+      this.pictureBox.Location = new System.Drawing.Point(0, 0);
+      this.pictureBox.Name = "pictureBox";
+      this.pictureBox.Size = new System.Drawing.Size(392, 310);
+      this.pictureBox.TabIndex = 0;
+      this.pictureBox.TabStop = false;
+      this.pictureBox.SizeChanged += new System.EventHandler(this.pictureBox_SizeChanged);
+      // 
+      // PathTSPTourView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.pictureBox);
+      this.Name = "PathTSPTourView";
+      this.Size = new System.Drawing.Size(392, 310);
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.PictureBox pictureBox;
+
+
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.cs	(revision 3238)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/AntTrailView.cs	(revision 3238)
@@ -0,0 +1,233 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.ArtificialAnt {
+  [View("AntTrail View")]
+  [Content(typeof(AntTrail), true)]
+  public sealed partial class AntTrailView : ItemView {
+    private const int N_FOOD_ITEMS = 89;
+    private const int WORLD_WIDTH = 32;
+    private const int WORLD_HEIGHT = 32;
+    private const int FOOD = 1;
+    private const int EMPTY = 0;
+    private int[] SANTA_FE_TRAIL = new int[] {
+      0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 
+      0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 
+      0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 
+      0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 0, 0, 0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0, 0, 0, 0, 0, 
+      0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    };
+
+    private const int MAX_TIME_STEPS = 600;
+
+    private int[] trail;
+    private int currentLocation;
+    private int currentDirection;
+    Stack<SymbolicExpressionTreeNode> nodeStack;
+
+    public new AntTrail Content {
+      get { return (AntTrail)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public AntTrailView() {
+      InitializeComponent();
+      ResetTrailInterpreter();
+    }
+
+    public AntTrailView(AntTrail content)
+      : this() {
+      Content = content;
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.SymbolicExpressionTreeChanged -= new EventHandler(Content_SymbolicExpressionTreeChanged);
+      base.DeregisterContentEvents();
+    }
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.SymbolicExpressionTreeChanged += new EventHandler(Content_SymbolicExpressionTreeChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        pictureBox.Image = null;
+        pictureBox.Enabled = false;
+      } else {
+        pictureBox.Enabled = true;
+        GenerateImage();
+      }
+    }
+
+    private void ResetTrailInterpreter() {
+      nodeStack = new Stack<SymbolicExpressionTreeNode>();
+      currentLocation = 0;
+      currentDirection = 0;
+      trail = new int[WORLD_HEIGHT * WORLD_WIDTH];
+      Array.Copy(SANTA_FE_TRAIL, trail, SANTA_FE_TRAIL.Length);
+    }
+
+
+    private void GenerateImage() {
+      if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) {
+        if (Content == null) {
+          pictureBox.Image = null;
+        } else {
+          ResetTrailInterpreter();
+          SymbolicExpressionTree expression = Content.SymbolicExpressionTree;
+
+          Bitmap bitmap = new Bitmap(pictureBox.Width, pictureBox.Height);
+          using (Graphics graphics = Graphics.FromImage(bitmap)) {
+            int cellHeight = pictureBox.Height / WORLD_HEIGHT;
+            int cellWidth = pictureBox.Width / WORLD_WIDTH;
+            // draw world
+            for (int i = 0; i < WORLD_HEIGHT; i++) {
+              graphics.DrawLine(Pens.Black, 0, i * cellHeight, pictureBox.Width, i * cellHeight);
+            }
+            for (int j = 0; j < WORLD_WIDTH; j++) {
+              graphics.DrawLine(Pens.Black, j * cellWidth, 0, j * cellWidth, pictureBox.Height);
+            }
+            for (int i = 0; i < WORLD_HEIGHT; i++) {
+              for (int j = 0; j < WORLD_WIDTH; j++) {
+                if (trail[i * WORLD_HEIGHT + j] == FOOD) graphics.FillEllipse(Brushes.LightBlue, j * cellWidth, i * cellHeight, cellWidth, cellHeight);
+              }
+            }
+            // step ant and draw trail
+            nodeStack.Clear();
+            int step = 0;
+            while (step < MAX_TIME_STEPS) {
+              // expression evaluated completly => start at root again
+              if (nodeStack.Count == 0)
+                nodeStack.Push(expression.Root.SubTrees[0]);
+
+              var currentNode = nodeStack.Pop();
+              if (currentNode.Symbol is Left) {
+                currentDirection = (currentDirection + 3) % 4;
+                step++;
+              } else if (currentNode.Symbol is Right) {
+                currentDirection = (currentDirection + 1) % 4;
+                step++;
+              } else if (currentNode.Symbol is Move) {
+                currentLocation = NextField();
+                trail[currentLocation] = EMPTY;
+                float currentCellX = currentLocation % WORLD_WIDTH;
+                float currentCellY = currentLocation / WORLD_HEIGHT;
+                graphics.FillRectangle(Brushes.Brown,
+                  currentCellX * cellWidth + cellWidth * 0.25f, currentCellY * cellHeight + cellHeight * 0.25f,
+                  cellWidth * 0.5f, cellHeight * 0.5f);
+                step++;
+              } else if (currentNode.Symbol is IfFoodAhead) {
+                if (trail[NextField()] == FOOD) {
+                  nodeStack.Push(currentNode.SubTrees[0]);
+                } else {
+                  nodeStack.Push(currentNode.SubTrees[1]);
+                }
+              } else if (currentNode.Symbol is Prog2) {
+                nodeStack.Push(currentNode.SubTrees[1]);
+                nodeStack.Push(currentNode.SubTrees[0]);
+              } else if (currentNode.Symbol is Prog3) {
+                nodeStack.Push(currentNode.SubTrees[2]);
+                nodeStack.Push(currentNode.SubTrees[1]);
+                nodeStack.Push(currentNode.SubTrees[0]);
+              } else {
+                throw new InvalidOperationException(currentNode.Symbol.ToString());
+              }
+
+              
+            }
+          }
+          pictureBox.Image = bitmap;
+        }
+      }
+    }
+
+    private int NextField() {
+      int currentLocationX = currentLocation % WORLD_WIDTH;
+      int currentLocationY = currentLocation / WORLD_HEIGHT;
+
+      switch (currentDirection) {
+        case 0:
+          currentLocationX = (currentLocationX + 1) % WORLD_WIDTH; // EAST
+          break;
+        case 1:
+          currentLocationY = (currentLocationY + 1) % WORLD_HEIGHT; // SOUTH
+          break;
+        case 2:
+          currentLocationX = (currentLocationX + WORLD_WIDTH - 1) % WORLD_WIDTH; // WEST
+          break;
+        case 3:
+          currentLocationY = (currentLocationY + WORLD_HEIGHT - 1) % WORLD_HEIGHT; // NORTH
+          break;
+        default:
+          throw new InvalidOperationException();
+      }
+      return currentLocationY * WORLD_WIDTH + currentLocationX;
+    }
+
+    void Content_SymbolicExpressionTreeChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_SymbolicExpressionTreeChanged), sender, e);
+      else
+        GenerateImage();
+    }
+
+    private void pictureBox_SizeChanged(object sender, EventArgs e) {
+      GenerateImage();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntExpressionGrammar.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntExpressionGrammar.cs	(revision 3237)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntExpressionGrammar.cs	(revision 3238)
@@ -24,4 +24,5 @@
 using System.Collections.Generic;
 using System;
+using System.Linq;
 using HeuristicLab.Core;
 namespace HeuristicLab.Problems.ArtificialAnt {
@@ -142,4 +143,24 @@
 
     #endregion
+
+    #region ISymbolicExpressionGrammar Members
+
+
+    public bool IsValidExpression(SymbolicExpressionTree expression) {
+      if (expression.Root.Symbol != StartSymbol) return false;
+      return IsValidExpression(expression.Root);
+    }
+
+    #endregion
+
+    private bool IsValidExpression(SymbolicExpressionTreeNode root) {
+      if (root.SubTrees.Count < MinSubTrees(root.Symbol)) return false;
+      if (root.SubTrees.Count > MaxSubTrees(root.Symbol)) return false;
+      for (int i = 0; i < root.SubTrees.Count; i++) {
+        if (!AllowedSymbols(root.Symbol, i).Contains(root.SubTrees[i].Symbol)) return false;
+        if (!IsValidExpression(root.SubTrees[i])) return false;
+      }
+      return true;
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs	(revision 3237)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs	(revision 3238)
@@ -127,13 +127,14 @@
       Evaluator evaluator = new Evaluator();
       ArtificialAntExpressionGrammar grammar = new ArtificialAntExpressionGrammar();
+      BestAntTrailVisualizer visualizer = new BestAntTrailVisualizer();
 
       Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to true as the Artificial Ant Problem is a maximization problem.", new BoolValue(true)));
       Parameters.Add(new ValueParameter<SymbolicExpressionTreeCreator>("SolutionCreator", "The operator which should be used to create new artificial ant solutions.", creator));
       Parameters.Add(new ValueParameter<Evaluator>("Evaluator", "The operator which should be used to evaluate artificial ant solutions.", evaluator));
-      Parameters.Add(new ValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this OneMax instance.", new DoubleValue(200)));
+      Parameters.Add(new ValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this OneMax instance.", new DoubleValue(89)));
       Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>("ArtificialAntExpressionGrammar", "The grammar that should be used for artificial ant expressions.", grammar));
       Parameters.Add(new ValueParameter<IntValue>("MaxExpressionLength", "Maximal length of the expression to control the artificial ant.", new IntValue(100)));
       Parameters.Add(new ValueParameter<IntValue>("MaxExpressionDepth", "Maximal depth of the expression to control the artificial ant.", new IntValue(10)));
-      Parameters.Add(new ValueParameter<IAntTrailVisualizer>("Visualizer", "The operator which should be used to visualize artificial ant solutions.", null));
+      Parameters.Add(new ValueParameter<IAntTrailVisualizer>("Visualizer", "The operator which should be used to visualize artificial ant solutions.", visualizer));
 
       creator.SymbolicExpressionTreeParameter.ActualName = "AntTrailSolution";
@@ -141,4 +142,5 @@
       ParameterizeSolutionCreator();
       ParameterizeEvaluator();
+      ParameterizeVisualizer();
 
       Initialize();
@@ -212,4 +214,5 @@
       operators.Add(Evaluator);
       operators.Add(SolutionCreator);
+      operators.Add(new SubtreeCrossover());
       ParameterizeOperators();
     }
@@ -224,5 +227,20 @@
         op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
       }
-    }
+      foreach (SymbolicExpressionTreeCrossover op in Operators.OfType<SymbolicExpressionTreeCrossover>()) {
+        op.MaxTreeHeightParameter.ActualName = MaxExpressionDepthParameter.Name;
+        op.MaxTreeSizeParameter.ActualName = MaxExpressionLengthParameter.Name;
+        op.SymbolicExpressionGrammarParameter.ActualName = ArtificialAntExpressionGrammarParameter.Name;
+        op.ParentsParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.ChildParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+    }
+    private void ParameterizeVisualizer() {
+      if (Visualizer != null) {
+        Visualizer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        if (Visualizer is IAntTrailVisualizer)
+          ((IAntTrailVisualizer)Visualizer).SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      }
+    }
+
     #endregion
   }
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/BestAntTrailVisualizer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/BestAntTrailVisualizer.cs	(revision 3238)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/BestAntTrailVisualizer.cs	(revision 3238)
@@ -0,0 +1,73 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Linq;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.ArtificialAnt {
+  /// <summary>
+  /// An operator for visualizing the best ant trail of an artificial ant problem.
+  /// </summary>
+  [Item("BestAntTrailVisualizer", "An operator for visualizing the best ant trail of an artificial ant problem.")]
+  [StorableClass]
+  public sealed class BestAntTrailVisualizer : SingleSuccessorOperator, IAntTrailVisualizer {
+    public ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ItemArray<SymbolicExpressionTree>>)Parameters["SymbolicExpressionTree"]; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }
+    }
+    public ILookupParameter<AntTrail> AntTrailParameter {
+      get { return (ILookupParameter<AntTrail>)Parameters["AntTrail"]; }
+    }
+    ILookupParameter ISolutionsVisualizer.VisualizationParameter {
+      get { return AntTrailParameter; }
+    }
+
+    public BestAntTrailVisualizer()
+      : base() {
+      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new SubScopesLookupParameter<SymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solutions from which the best solution should be visualized."));
+      Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The qualities of the artificial ant solutions which should be visualized."));
+      Parameters.Add(new LookupParameter<AntTrail>("AntTrail", "The visual representation of the best ant trail."));
+    }
+
+    public override IOperation Apply() {
+      ItemArray<SymbolicExpressionTree> expressions = SymbolicExpressionTreeParameter.ActualValue;
+      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
+
+      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => -x.Value).First().index;
+
+      AntTrail antTrail = AntTrailParameter.ActualValue;
+      if (antTrail == null) AntTrailParameter.ActualValue = new AntTrail(expressions[i]);
+      else {
+        antTrail.SymbolicExpressionTree = expressions[i];
+      }
+      return base.Apply();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/HeuristicLab.Problems.ArtificialAnt-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/HeuristicLab.Problems.ArtificialAnt-3.3.csproj	(revision 3237)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/HeuristicLab.Problems.ArtificialAnt-3.3.csproj	(revision 3238)
@@ -86,4 +86,5 @@
   <ItemGroup>
     <Compile Include="AntInterpreter.cs" />
+    <Compile Include="BestAntTrailVisualizer.cs" />
     <Compile Include="HeuristicLabProblemsArtificialAntPlugin.cs" />
     <Compile Include="IAntTrailVisualizer.cs" />
@@ -96,4 +97,11 @@
     <Compile Include="ArtificialAntProblemView.Designer.cs">
       <DependentUpon>ArtificialAntProblemView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="AntTrail.cs" />
+    <Compile Include="AntTrailView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="AntTrailView.Designer.cs">
+      <DependentUpon>AntTrailView.cs</DependentUpon>
     </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -117,4 +125,8 @@
       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
       <Name>HeuristicLab.Common.Resources-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj">
+      <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project>
+      <Name>HeuristicLab.Common-3.2</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
Index: /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/IAntTrailVisualizer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/IAntTrailVisualizer.cs	(revision 3237)
+++ /trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/IAntTrailVisualizer.cs	(revision 3238)
@@ -23,7 +23,9 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Optimization;
+using HeuristicLab.Core;
 
 namespace HeuristicLab.Problems.ArtificialAnt {
-  public interface IAntTrailVisualizer : ISolutionsVisualizer {
+  public interface IAntTrailVisualizer : ISolutionsVisualizer, ISingleObjectiveSolutionsVisualizer {
+    ILookupParameter<ItemArray<SymbolicExpressionTree>> SymbolicExpressionTreeParameter { get; }
   }
 }
