Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4685


Ignore:
Timestamp:
10/29/10 20:02:11 (12 years ago)
Author:
abeham
Message:

#922

  • Refactored HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Grammars.cs

    r4106 r4685  
    2323using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2424using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
     25using HeuristicLab.Common;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
    2628namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests {
    2729  public static class Grammars {
    28     private class Addition : Symbol { public Addition() : base("Addition", "") { } }
    29     private class Subtraction : Symbol { public Subtraction() : base("Subtraction", "") { } }
    30     private class Multiplication : Symbol { public Multiplication() : base("Multiplication", "") { } }
    31     private class Division : Symbol { public Division() : base("Division", "") { } }
    32     private class Terminal : Symbol { public Terminal() : base("Terminal", "") { } }
     30    private class Addition : Symbol {
     31      protected Addition(Addition original, Cloner cloner) : base(original, cloner) { }
     32      public Addition() : base("Addition", "") { }
     33      public override IDeepCloneable Clone(Cloner cloner) {
     34        return new Addition(this, cloner);
     35      }
     36    }
     37    private class Subtraction : Symbol {
     38      protected Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { }
     39      public Subtraction() : base("Subtraction", "") { }
     40      public override IDeepCloneable Clone(Cloner cloner) {
     41        return new Subtraction(this, cloner);
     42      }
     43    }
     44    private class Multiplication : Symbol {
     45      protected Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { }
     46      public Multiplication() : base("Multiplication", "") { }
     47      public override IDeepCloneable Clone(Cloner cloner) {
     48        return new Multiplication(this, cloner);
     49      }
     50    }
     51    private class Division : Symbol {
     52      protected Division(Division original, Cloner cloner) : base(original, cloner) { }
     53      public Division() : base("Division", "") { }
     54      public override IDeepCloneable Clone(Cloner cloner) {
     55        return new Division(this, cloner);
     56      }
     57    }
     58    private class Terminal : Symbol {
     59      protected Terminal(Terminal original, Cloner cloner) : base(original, cloner) { }
     60      public Terminal() : base("Terminal", "") { }
     61      public override IDeepCloneable Clone(Cloner cloner) {
     62        return new Terminal(this, cloner);
     63      }
     64    }
    3365
    3466    private class SimpleArithmeticGrammar : DefaultSymbolicExpressionGrammar {
     67      protected SimpleArithmeticGrammar(SimpleArithmeticGrammar original, Cloner cloner) : base(original, cloner) { }
    3568      public SimpleArithmeticGrammar()
    3669        : base() {
    3770        Initialize();
     71      }
     72
     73      public override IDeepCloneable Clone(Cloner cloner) {
     74        return new SimpleArithmeticGrammar(this, cloner);
    3875      }
    3976
Note: See TracChangeset for help on using the changeset viewer.