Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/RotateExpressions.cs
- Timestamp:
- 04/10/17 00:27:31 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/RotateExpressions.cs
r14777 r14834 1 1 namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions { 2 using System.Collections.Generic; 3 2 4 using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes; 3 5 … … 6 8 7 9 public abstract class RotateExpression<T> : StatelessExpression { 8 public bool Eval(I Stack<T> stack) {10 public bool Eval(IPushStack<T> stack) { 9 11 if (stack.Count < 3) return false; 10 12 … … 17 19 [PushExpression(StackTypes.Integer, "INTEGER.ROT")] 18 20 public class IntegerRotateExpression : RotateExpression<long> { 19 public override bool Eval(I PushInterpreter interpreter) {21 public override bool Eval(IInternalPushInterpreter interpreter) { 20 22 return Eval(interpreter.IntegerStack); 21 23 } … … 24 26 [PushExpression(StackTypes.Float, "FLOAT.ROT")] 25 27 public class FloatRotateExpression : RotateExpression<double> { 26 public override bool Eval(I PushInterpreter interpreter) {28 public override bool Eval(IInternalPushInterpreter interpreter) { 27 29 return Eval(interpreter.FloatStack); 28 30 } … … 31 33 [PushExpression(StackTypes.Boolean, "BOOLEAN.ROT")] 32 34 public class BooleanRotateExpression : RotateExpression<bool> { 33 public override bool Eval(I PushInterpreter interpreter) {35 public override bool Eval(IInternalPushInterpreter interpreter) { 34 36 return Eval(interpreter.BooleanStack); 35 37 } … … 38 40 [PushExpression(StackTypes.Name, "NAME.ROT")] 39 41 public class NameRotateExpression : RotateExpression<string> { 40 public override bool Eval(I PushInterpreter interpreter) {42 public override bool Eval(IInternalPushInterpreter interpreter) { 41 43 return Eval(interpreter.NameStack); 42 44 } … … 45 47 [PushExpression(StackTypes.Exec, "EXEC.ROT")] 46 48 public class ExecRotateExpression : RotateExpression<Expression> { 47 public override bool Eval(I PushInterpreter interpreter) {49 public override bool Eval(IInternalPushInterpreter interpreter) { 48 50 return Eval(interpreter.ExecStack); 49 51 } … … 52 54 [PushExpression(StackTypes.Code, "CODE.ROT")] 53 55 public class CodeRotateExpression : RotateExpression<Expression> { 54 public override bool Eval(I PushInterpreter interpreter) {56 public override bool Eval(IInternalPushInterpreter interpreter) { 55 57 return Eval(interpreter.CodeStack); 56 58 } … … 59 61 [PushExpression(StackTypes.Char, "CHAR.ROT")] 60 62 public class CharRotateExpression : RotateExpression<char> { 61 public override bool Eval(I PushInterpreter interpreter) {63 public override bool Eval(IInternalPushInterpreter interpreter) { 62 64 return Eval(interpreter.CharStack); 63 65 } … … 66 68 [PushExpression(StackTypes.String, "STRING.ROT")] 67 69 public class StringRotateExpression : RotateExpression<string> { 68 public override bool Eval(I PushInterpreter interpreter) {70 public override bool Eval(IInternalPushInterpreter interpreter) { 69 71 return Eval(interpreter.StringStack); 70 72 } 71 73 } 74 75 [PushExpression(StackTypes.IntegerVector, "INTEGER[].ROT")] 76 public class IntegerVectorRotateExpression : RotateExpression<List<long>> { 77 public override bool Eval(IInternalPushInterpreter interpreter) { 78 return Eval(interpreter.IntegerVectorStack); 79 } 80 } 72 81 }
Note: See TracChangeset
for help on using the changeset viewer.