Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/InterpreterBuilder.cs @ 9430

Last change on this file since 9430 was 9430, checked in by gkronber, 11 years ago

initial import of GPDL parser plugin

File size: 875 bytes
Line 
1using System.Collections.Generic;
2using System;
3
4public class InterpreterBuilder {
5  private static Dictionary<string, string> code;
6  private static bool maximization;
7  private static string fitnessFunction;
8  private static string additionalCode;
9
10  public static void Initialize() {
11    code = new Dictionary<string, string>();
12  }
13
14  public static void AddSymbolSemantics(string symbol, MethodBuilder mBuilder) {
15    code.Add(symbol, mBuilder.GetCode());
16  }
17  public static void SetMaximization(bool val) {
18    maximization = val;
19  }
20
21  public static void SetFitnessFunction(string srcCode) {
22    fitnessFunction = srcCode;
23  }
24  public static void SetAdditionalCode(string srcCode) {
25    additionalCode = srcCode;
26  }
27
28  public static void Write() {
29    foreach (var entry in code) {
30      Console.WriteLine(entry.Value);
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.