Index: trunk/sources/HeuristicLab.Services.OKB/3.3/RunnerService.cs
===================================================================
--- trunk/sources/HeuristicLab.Services.OKB/3.3/RunnerService.cs	(revision 4321)
+++ trunk/sources/HeuristicLab.Services.OKB/3.3/RunnerService.cs	(revision 4381)
@@ -27,32 +27,11 @@
 using System.Web.Security;
 using HeuristicLab.Services.OKB.DataAccess;
-using log4net;
 
 namespace HeuristicLab.Services.OKB {
-
   /// <summary>
   /// Implementation of the <see cref="IRunnerService"/>.
   /// </summary>
-  [ServiceBehavior(
-    InstanceContextMode = InstanceContextMode.PerSession)]
+  [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
   public class RunnerService : IRunnerService, IDisposable {
-
-    private Guid sessionID;
-    private static ILog logger = LogManager.GetLogger(typeof(RunnerService));
-
-    private void Log(string message, params object[] args) {
-      using (log4net.ThreadContext.Stacks["NDC"].Push(sessionID.ToString())) {
-        logger.Info(String.Format(message, args));
-      }
-    }
-
-    /// <summary>
-    /// Initializes a new instance of the <see cref="RunnerService"/> class.
-    /// </summary>
-    public RunnerService() {
-      sessionID = Guid.NewGuid();
-      Log("Instantiating new service");
-    }
-
     /// <summary>
     /// Obtain a "starter kit" of information, containing:
@@ -64,5 +43,4 @@
     /// </summary>
     public StarterKit GetStarterKit(string platformName) {
-      Log("distributing starter kit");
       Platform platform;
       using (OKBDataContext okb = new OKBDataContext()) {
@@ -86,6 +64,5 @@
         var StarterKit = new StarterKit() {
           AlgorithmClasses = okb.AlgorithmClasses.ToList(),
-          ProblemClasses = okb.ProblemClasses.ToList(),
-          Projects = okb.Projects.ToList()
+          ProblemClasses = okb.ProblemClasses.ToList()
         };
         return StarterKit;
@@ -100,23 +77,20 @@
     /// </summary>
     public ExperimentKit PrepareExperiment(Algorithm algorithm, Problem problem) {
-      Log("preparing experiment: {0}@{1}", algorithm.Name, problem.Name);
       OKBDataContext okb = new OKBDataContext();
       try {
         DataLoadOptions dlo = new DataLoadOptions();
         dlo.LoadWith<Problem>(p => p.SolutionRepresentation);
-        dlo.LoadWith<Parameter>(p => p.DataType);
+        dlo.LoadWith<AlgorithmParameter>(p => p.DataType);
+        dlo.LoadWith<ProblemParameter>(p => p.DataType);
         dlo.LoadWith<Result>(r => r.DataType);
-        dlo.LoadWith<Algorithm_Parameter>(ap => ap.Parameter);
-        dlo.LoadWith<Problem_Parameter>(pp => pp.Parameter);
-        dlo.LoadWith<Algorithm_Result>(ar => ar.Result);
         okb.LoadOptions = dlo;
         algorithm = okb.Algorithms.Single(a => a.Id == algorithm.Id);
         problem = okb.Problems.Single(p => p.Id == problem.Id);
-        algorithm.Algorithm_Parameters.Load();
-        algorithm.Algorithm_Results.Load();
-        problem.IntProblemCharacteristicValues.Load();
-        problem.FloatProblemCharacteristicValues.Load();
-        problem.CharProblemCharacteristicValues.Load();
-        problem.Problem_Parameters.Load();
+        algorithm.AlgorithmParameters.Load();
+        algorithm.Results.Load();
+        problem.ProblemCharacteristicIntValues.Load();
+        problem.ProblemCharacteristicFloatValues.Load();
+        problem.ProblemCharacteristicStringValues.Load();
+        problem.ProblemParameters.Load();
         return new ExperimentKit() {
           Algorithm = algorithm,
@@ -125,5 +99,4 @@
       }
       catch (Exception x) {
-        Log("exception caught: " + x.ToString());
         throw new FaultException("Excaption caught: " + x.ToString());
       }
@@ -141,10 +114,8 @@
     /// <param name="problem">The problem.</param>
     /// <param name="project">The project.</param>
-    public void AddRun(Algorithm algorithm, Problem problem, Project project) {
-      Log("adding run for {0}@{1}({2})[{3}, {4}]",
-        algorithm.Name, problem.Name, project.Name, currentUser.Name, currentClient.Name);
+    public void AddRun(Algorithm algorithm, Problem problem) {
       try {
         using (OKBDataContext okb = new OKBDataContext()) {
-          Experiment experiment = GetOrCreateExperiment(algorithm, problem, project, currentUser, okb);
+          Experiment experiment = GetOrCreateExperiment(algorithm, problem, currentUser, okb);
           Run run = new Run() {
             Experiment = experiment,
@@ -159,26 +130,19 @@
       }
       catch (Exception x) {
-        Log(x.ToString());
         throw new FaultException("Could not add run: " + x.ToString());
       }
     }
 
-    private Experiment GetOrCreateExperiment(Algorithm algorithm, Problem problem,
-        Project project, User user, OKBDataContext okb) {
+    private Experiment GetOrCreateExperiment(Algorithm algorithm, Problem problem, User user, OKBDataContext okb) {
       MatchResults(algorithm.Results, okb);
       EnsureParametersExist(algorithm.Parameters, okb);
-      var experimentQuery = CreateExperimentQuery(algorithm, problem, project, okb);
+      var experimentQuery = CreateExperimentQuery(algorithm, problem, okb);
       if (experimentQuery.Count() > 0) {
-        if (experimentQuery.Count() > 1)
-          Log("Warning: duplicate experiment found");
-        Log("reusing existing experiment");
         Experiment experiment = experimentQuery.First();
         return experiment;
       } else {
-        Log("creating new experiment");
         Experiment experiment = new Experiment() {
           AlgorithmId = algorithm.Id,
           ProblemId = problem.Id,
-          ProjectId = project.Id,
           ParameterValues = algorithm.ParameterValues
         };
@@ -191,5 +155,4 @@
       foreach (var result in results.Where(r => r.Name != null)) {
         result.Id = okb.Results.Single(r => r.Name == result.Name).Id;
-        Log("mapping named result {0} -> Id {1}", result.Name, result.Id);
         var value = result.ResultValue;
         if (value != null) {
@@ -205,5 +168,4 @@
         DataType dataType = GetOrCreateDataType(okb, param.DataType.ClrName);
         param.DataType = new DataType() { Id = dataType.Id };
-        Log("mapping datatype {0} to id {1}", dataType.ClrName, dataType.Id);
       }
       okb.SubmitChanges();
@@ -211,5 +173,4 @@
       var newParams = namedParams.Except(okb.Parameters, new NameComprarer());
       foreach (var p in newParams) {
-        Log("creating new parameter {0} ({2}:{1})", p.Name, p.DataType.ClrName, p.DataType.Id);
         okb.Parameters.InsertOnSubmit(new Parameter() {
           Name = p.Name,
@@ -220,5 +181,4 @@
       foreach (var np in namedParams) {
         np.Id = okb.Parameters.Single(p => p.Name == np.Name).Id;
-        Log("mapping named parameter {0} -> Id {1}", np.Name, np.Id);
         var value = np.ParameterValue;
         if (value != null) {
@@ -231,5 +191,4 @@
             DataType dataType = GetOrCreateDataType(okb, opVal.DataType.ClrName);
             newVal.DataType = new DataType() { Id = dataType.Id };
-            Log("mapping operator parameter datatype {0} to id {1}", dataType.ClrName, dataType.Id);
           }
         }
@@ -240,5 +199,4 @@
       DataType dataType = okb.DataTypes.SingleOrDefault(dt => dt.ClrName == clrName);
       if (dataType == null) {
-        Log("creating new datatype for ", clrName);
         dataType = new DataType() {
           ClrName = clrName,
@@ -251,11 +209,9 @@
     }
 
-    private IQueryable<Experiment> CreateExperimentQuery(Algorithm algorithm, Problem problem, Project project,
-        OKBDataContext okb) {
+    private IQueryable<Experiment> CreateExperimentQuery(Algorithm algorithm, Problem problem, OKBDataContext okb) {
       var experimentQuery =
         from x in okb.Experiments
         where x.Algorithm == algorithm
         where x.Problem == problem
-        where x.ProjectId == project.Id
         select x;
       foreach (IntParameterValue ipv in algorithm.IntParameterValues) {
@@ -279,5 +235,4 @@
             p.ParameterId == opv.ParameterId && p.DataTypeId == opv.DataTypeId));
       }
-      Log("experiment query: ", experimentQuery.Expression.ToString());
       return experimentQuery;
     }
@@ -310,9 +265,7 @@
       MembershipUser user = Membership.GetUser();
 
-      Log("Authenticating {0}@{1}", user.UserName, clientname);
       if (user == null ||
           string.IsNullOrEmpty(clientname) ||
           ServiceSecurityContext.Current.IsAnonymous) {
-        Log("rejecting anonymous login");
         return false;
       }
@@ -330,5 +283,4 @@
           okb.SubmitChanges();
         }
-        Log("  user = {0}, client = {1}", currentUser, currentClient);
         return true;
       }
@@ -339,5 +291,4 @@
     /// </summary>
     public void Logout() {
-      Log("Logging out");
       currentUser = null;
       currentClient = null;
@@ -348,5 +299,4 @@
     /// </summary>
     public void Dispose() {
-      Log("Closing session...");
       Logout();
     }
@@ -383,5 +333,4 @@
       return obj.Name.GetHashCode();
     }
-
   }
 }
