Index: /trunk/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs	(revision 2628)
+++ /trunk/sources/HeuristicLab.GP.Boolean/3.3/BooleanTreeInterpreter.cs	(revision 2629)
@@ -72,5 +72,5 @@
         case SymbolTable.UNKNOWN:
         default:
-          throw new UnknownFunctionException(t.Function.Name);
+          throw new NotImplementedException(t.Function.Name);
       }
     }
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs	(revision 2628)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/ModelAnalyzerExporter.cs	(revision 2629)
@@ -22,4 +22,5 @@
 using HeuristicLab.GP.Interfaces;
 using System;
+using System.Collections.Generic;
 
 namespace HeuristicLab.GP.StructureIdentification {
@@ -34,81 +35,63 @@
 
     public bool TryExport(IFunctionTree tree, out string exported) {
-      try {
-        exported = Export(tree);
-        return true;
-      } catch(UnknownFunctionException) {
-        exported = "";
-        return false;
-      }
+      foreach (IFunctionTree t in FunctionTreeIterator.IteratePrefix(tree))
+        if (!functionExporter.ContainsKey(t.Function.GetType())) {
+          exported = null;
+          return false;
+        }
+      exported = Export(tree);
+      return true;
     }
 
     public string Export(IFunctionTree tree) {
       string result = ExportFunction(tree.Function, tree);
-      if(tree.SubTrees.Count>0) 
+      if (tree.SubTrees.Count > 0)
         result += "(\n";
-      foreach(IFunctionTree subTree in tree.SubTrees) {
+      foreach (IFunctionTree subTree in tree.SubTrees) {
         result += Export(subTree);
         result += ";\n";
       }
       result = result.TrimEnd(';', '\n');
-      if(tree.SubTrees.Count > 0) result += ")";
+      if (tree.SubTrees.Count > 0) result += ")";
       return result;
     }
-
-    public IFunctionTree Import(string tree) {
-      throw new UnknownFunctionException(tree);
-    }
-
-    public bool TryImport(string tree, out IFunctionTree importedTree) {
-      try {
-        importedTree = Import(tree);
-        return true;
-      }
-      catch (UnknownFunctionException) {
-        importedTree = null;
-        return false;
-      }
-    }
-
     #endregion
 
+    // try-export checks the keys of this dictionary
+    private static Dictionary<Type, Func<IFunction, IFunctionTree, string>> functionExporter = new Dictionary<Type, Func<IFunction, IFunctionTree, string>>() {
+      { typeof(Addition), (function, tree) => ((Addition)function).ExportToHL2(tree)},
+      { typeof(And), (function, tree) => ((And)function).ExportToHL2(tree)},
+      { typeof(Average), (function, tree) => ((Average)function).ExportToHL2(tree)},
+      { typeof(Constant), (function, tree) => ((Constant)function).ExportToHL2(tree)},
+      { typeof(Cosinus), (function, tree) => ((Cosinus)function).ExportToHL2(tree)},
+      { typeof(Differential), (function, tree) => ((Differential)function).ExportToHL2(tree)},
+      { typeof(Division), (function, tree) => ((Division)function).ExportToHL2(tree)},
+      { typeof(Equal), (function, tree) => ((Equal)function).ExportToHL2(tree)},
+      { typeof(Exponential), (function, tree) => ((Exponential)function).ExportToHL2(tree)},
+      { typeof(GreaterThan), (function, tree) => ((GreaterThan)function).ExportToHL2(tree)},
+      { typeof(IfThenElse), (function, tree) => ((IfThenElse)function).ExportToHL2(tree)},
+      { typeof(LessThan), (function, tree) => ((LessThan)function).ExportToHL2(tree)},
+      { typeof(Logarithm), (function, tree) => ((Logarithm)function).ExportToHL2(tree)},
+      { typeof(Multiplication), (function, tree) => ((Multiplication)function).ExportToHL2(tree)},
+      { typeof(Not), (function, tree) => ((Not)function).ExportToHL2(tree)},
+      { typeof(Or), (function, tree) => ((Or)function).ExportToHL2(tree)},
+      { typeof(Power), (function, tree) => ((Power)function).ExportToHL2(tree)},
+      { typeof(Signum), (function, tree) => ((Signum)function).ExportToHL2(tree)},
+      { typeof(Sinus), (function, tree) => ((Sinus)function).ExportToHL2(tree)},
+      { typeof(Sqrt), (function, tree) => ((Sqrt)function).ExportToHL2(tree)},
+      { typeof(Subtraction), (function, tree) => ((Subtraction)function).ExportToHL2(tree)},
+      { typeof(Tangens), (function, tree) => ((Tangens)function).ExportToHL2(tree)},
+      { typeof(Variable), (function, tree) => ((Variable)function).ExportToHL2(tree)},
+      { typeof(Xor), (function, tree) => ((Xor)function).ExportToHL2(tree)},
+    };
     private static string ExportFunction(IFunction function, IFunctionTree tree) {
       // this is smelly, if there is a cleaner way to have a 'dynamic' visitor 
       // please let me know! (gkronber 14.10.2008)
-      if(function is Addition) return ((Addition)function).ExportToHL2(tree);
-      if(function is And) return ((And)function).ExportToHL2(tree);
-      if(function is Average) return ((Average)function).ExportToHL2(tree);
-      if(function is Constant) return ((Constant)function).ExportToHL2(tree);
-      if(function is Cosinus) return ((Cosinus)function).ExportToHL2(tree);
-      if(function is Differential) return ((Differential)function).ExportToHL2(tree);
-      if(function is Division) return ((Division)function).ExportToHL2(tree);
-      if(function is Equal) return ((Equal)function).ExportToHL2(tree);
-      if(function is Exponential) return ((Exponential)function).ExportToHL2(tree);
-      if(function is GreaterThan) return ((GreaterThan)function).ExportToHL2(tree);
-      if(function is IfThenElse) return ((IfThenElse)function).ExportToHL2(tree);
-      if(function is LessThan) return ((LessThan)function).ExportToHL2(tree);
-      if(function is Logarithm) return ((Logarithm)function).ExportToHL2(tree);
-      if(function is Multiplication) return ((Multiplication)function).ExportToHL2(tree);
-      if(function is Not) return ((Not)function).ExportToHL2(tree);
-      if(function is Or) return ((Or)function).ExportToHL2(tree);
-      if(function is Power) return ((Power)function).ExportToHL2(tree);
-      if(function is Signum) return ((Signum)function).ExportToHL2(tree);
-      if(function is Sinus) return ((Sinus)function).ExportToHL2(tree);
-      if(function is Sqrt) return ((Sqrt)function).ExportToHL2(tree);
-      if(function is Subtraction) return ((Subtraction)function).ExportToHL2(tree);
-      if(function is Tangens) return ((Tangens)function).ExportToHL2(tree);
-      if(function is Variable) return ((Variable)function).ExportToHL2(tree);
-      if(function is Xor) return ((Xor)function).ExportToHL2(tree);
-      throw new UnknownFunctionException(function.Name);
+      if (functionExporter.ContainsKey(function.GetType())) return functionExporter[function.GetType()](function, tree);
+      else return function.Name;
     }
 
     public static string GetName(IFunctionTree tree) {
-      string name = "";
-      try {
-        name = ExportFunction(tree.Function, tree);
-      } catch(UnknownFunctionException) {
-        name = "N/A";
-      }
-      return name;
+      return ExportFunction(tree.Function, tree);
     }
   }
@@ -116,5 +99,5 @@
   internal static class HL2ExporterExtensions {
     private static string GetHL2FunctionName(string name) {
-      return "[F]" + name ;
+      return "[F]" + name;
     }
 
Index: /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs	(revision 2628)
+++ /trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/SymbolicExpressionExporter.cs	(revision 2629)
@@ -46,12 +46,11 @@
 
     public bool TryExport(IFunctionTree tree, out string exported) {
-      try {
-        exported = Export(tree);
-        return true;
-      }
-      catch (UnknownFunctionException) {
-        exported = "";
-        return false;
-      }
+      foreach (IFunctionTree t in FunctionTreeIterator.IteratePrefix(tree))
+        if (!functionExporter.ContainsKey(t.Function.GetType())) {
+          exported = null;
+          return false;
+        }
+      exported = Export(tree);
+      return true;
     }
 
@@ -68,46 +67,42 @@
     }
 
+    // try-export checks the keys of this dictionary
+    private static Dictionary<Type, Func<IFunction, IFunctionTree, string>> functionExporter = new Dictionary<Type, Func<IFunction, IFunctionTree, string>>() {
+      { typeof(Addition), (function, tree) => ((Addition)function).ExportToScheme()},
+      { typeof(And), (function, tree) => ((And)function).ExportToScheme()},
+      { typeof(Average), (function, tree) => ((Average)function).ExportToScheme()},
+      { typeof(Constant), (function, tree) => ((Constant)function).ExportToScheme(tree)},
+      { typeof(Cosinus), (function, tree) => ((Cosinus)function).ExportToScheme()},
+      { typeof(Differential), (function, tree) => ((Differential)function).ExportToScheme(tree)},
+      { typeof(Division), (function, tree) => ((Division)function).ExportToScheme()},
+      { typeof(Equal), (function, tree) => ((Equal)function).ExportToScheme()},
+      { typeof(Exponential), (function, tree) => ((Exponential)function).ExportToScheme()},
+      { typeof(GreaterThan), (function, tree) => ((GreaterThan)function).ExportToScheme()},
+      { typeof(IfThenElse), (function, tree) => ((IfThenElse)function).ExportToScheme()},
+      { typeof(LessThan), (function, tree) => ((LessThan)function).ExportToScheme()},
+      { typeof(Logarithm), (function, tree) => ((Logarithm)function).ExportToScheme()},
+      { typeof(Multiplication), (function, tree) => ((Multiplication)function).ExportToScheme()},
+      { typeof(Not), (function, tree) => ((Not)function).ExportToScheme()},
+      { typeof(Or), (function, tree) => ((Or)function).ExportToScheme()},
+      { typeof(Power), (function, tree) => ((Power)function).ExportToScheme()},
+      { typeof(Signum), (function, tree) => ((Signum)function).ExportToScheme()},
+      { typeof(Sinus), (function, tree) => ((Sinus)function).ExportToScheme()},
+      { typeof(Sqrt), (function, tree) => ((Sqrt)function).ExportToScheme()},
+      { typeof(Subtraction), (function, tree) => ((Subtraction)function).ExportToScheme()},
+      { typeof(Tangens), (function, tree) => ((Tangens)function).ExportToScheme()},
+      { typeof(Variable), (function, tree) => ((Variable)function).ExportToScheme(tree)},
+      { typeof(Xor), (function, tree) => ((Xor)function).ExportToScheme()},
+    };
     private static string ExportFunction(IFunction function, IFunctionTree tree) {
       // this is smelly, if there is a cleaner way to have a 'dynamic' visitor 
       // please let me know! (gkronber 14.10.2008)
-      if (function is Addition) return ((Addition)function).ExportToScheme();
-      if (function is And) return ((And)function).ExportToScheme();
-      if (function is Average) return ((Average)function).ExportToScheme();
-      if (function is Constant) return ((Constant)function).ExportToScheme(tree);
-      if (function is Cosinus) return ((Cosinus)function).ExportToScheme();
-      if (function is Differential) return ((Differential)function).ExportToScheme(tree);
-      if (function is Division) return ((Division)function).ExportToScheme();
-      if (function is Equal) return ((Equal)function).ExportToScheme();
-      if (function is Exponential) return ((Exponential)function).ExportToScheme();
-      if (function is GreaterThan) return ((GreaterThan)function).ExportToScheme();
-      if (function is IfThenElse) return ((IfThenElse)function).ExportToScheme();
-      if (function is LessThan) return ((LessThan)function).ExportToScheme();
-      if (function is Logarithm) return ((Logarithm)function).ExportToScheme();
-      if (function is Multiplication) return ((Multiplication)function).ExportToScheme();
-      if (function is Not) return ((Not)function).ExportToScheme();
-      if (function is Or) return ((Or)function).ExportToScheme();
-      if (function is Power) return ((Power)function).ExportToScheme();
-      if (function is Signum) return ((Signum)function).ExportToScheme();
-      if (function is Sinus) return ((Sinus)function).ExportToScheme();
-      if (function is Sqrt) return ((Sqrt)function).ExportToScheme();
-      if (function is Subtraction) return ((Subtraction)function).ExportToScheme();
-      if (function is Tangens) return ((Tangens)function).ExportToScheme();
-      if (function is Variable) return ((Variable)function).ExportToScheme(tree);
-      if (function is Xor) return ((Xor)function).ExportToScheme();
-      throw new UnknownFunctionException(function.Name);
-    }
-
+      if (functionExporter.ContainsKey(function.GetType())) return functionExporter[function.GetType()](function, tree);
+      else return function.Name;
+    }
 
     #endregion
 
     public static string GetName(IFunctionTree tree) {
-      string name = "";
-      try {
-        name = ExportFunction(tree.Function, tree);
-      }
-      catch (UnknownFunctionException) {
-        name = "N/A";
-      }
-      return name;
+      return ExportFunction(tree.Function, tree);
     }
   }
Index: /trunk/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2628)
+++ /trunk/sources/HeuristicLab.GP/3.3/HeuristicLab.GP-3.3.csproj	(revision 2629)
@@ -109,5 +109,4 @@
     </Compile>
     <Compile Include="GeneticProgrammingModel.cs" />
-    <Compile Include="UnknownFunctionException.cs" />
     <Compile Include="HeuristicLabGPPlugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
Index: unk/sources/HeuristicLab.GP/3.3/UnknownFunctionException.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP/3.3/UnknownFunctionException.cs	(revision 2628)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using System.Text;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.GP {
-  public class UnknownFunctionException : Exception {
-    public UnknownFunctionException(string functionName)
-      : base("Function "+functionName+" was not expected and can't be handled.") {
-    }
-  }
-}
