Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/08 00:39:50 (16 years ago)
Author:
gkronber
Message:

worked on #364 (Improve GP evaluation performance)

  • removed list of Instr
  • changes that didn't affect performance directly: reduced size of Instr class, added 'constant-folding' and pre-calculation of skip-lengths


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/SymbolTable.cs

    r656 r767  
    2929namespace HeuristicLab.GP.StructureIdentification {
    3030  class EvaluatorSymbolTable : StorableBase {
    31     public const int ADDITION = 1;
    32     public const int AND = 2;
    33     public const int AVERAGE = 3;
    34     public const int CONSTANT = 4;
    35     public const int COSINUS = 5;
    36     public const int DIFFERENTIAL = 25;
    37     public const int DIVISION = 6;
    38     public const int EQU = 7;
    39     public const int EXP = 8;
    40     public const int GT = 9;
    41     public const int IFTE = 10;
    42     public const int LT = 11;
    43     public const int LOG = 12;
    44     public const int MULTIPLICATION = 13;
    45     public const int NOT = 14;
    46     public const int OR = 15;
    47     public const int POWER = 16;
    48     public const int SIGNUM = 17;
    49     public const int SINUS = 18;
    50     public const int SQRT = 19;
    51     public const int SUBTRACTION = 20;
    52     public const int TANGENS = 21;
    53     public const int VARIABLE = 22;
    54     public const int XOR = 23;
    55     public const int UNKNOWN = 24;
     31    public const byte ADDITION = 1;
     32    public const byte AND = 2;
     33    public const byte AVERAGE = 3;
     34    public const byte CONSTANT = 4;
     35    public const byte COSINUS = 5;
     36    public const byte DIFFERENTIAL = 25;
     37    public const byte DIVISION = 6;
     38    public const byte EQU = 7;
     39    public const byte EXP = 8;
     40    public const byte GT = 9;
     41    public const byte IFTE = 10;
     42    public const byte LT = 11;
     43    public const byte LOG = 12;
     44    public const byte MULTIPLICATION = 13;
     45    public const byte NOT = 14;
     46    public const byte OR = 15;
     47    public const byte POWER = 16;
     48    public const byte SIGNUM = 17;
     49    public const byte SINUS = 18;
     50    public const byte SQRT = 19;
     51    public const byte SUBTRACTION = 20;
     52    public const byte TANGENS = 21;
     53    public const byte VARIABLE = 22;
     54    public const byte XOR = 23;
     55    public const byte UNKNOWN = 24;
    5656
    57     private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
     57    private static Dictionary<Type, byte> staticTypes = new Dictionary<Type, byte>();
    5858
    5959    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
    6060    static EvaluatorSymbolTable() {
    61       staticTypes = new Dictionary<Type, int>();
     61      staticTypes = new Dictionary<Type, byte>();
    6262      staticTypes[typeof(Addition)] = ADDITION;
    6363      staticTypes[typeof(And)] = AND;
     
    8686    }
    8787
    88     internal static int MapFunction(IFunction function) {
     88    internal static byte MapFunction(IFunction function) {
    8989      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
    9090      else return UNKNOWN;
Note: See TracChangeset for help on using the changeset viewer.