Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/10/17 00:27:31 (8 years ago)
Author:
pkimmesw
Message:

#2665 LexicaseSelector, Performance improvements, UI Fixes, Debugger only shows used stacks, fixed Debugger stepping, Added vector expressions, ERCOptions,

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/RotateExpressions.cs

    r14777 r14834  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
     2  using System.Collections.Generic;
     3
    24  using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;
    35
     
    68
    79  public abstract class RotateExpression<T> : StatelessExpression {
    8     public bool Eval(IStack<T> stack) {
     10    public bool Eval(IPushStack<T> stack) {
    911      if (stack.Count < 3) return false;
    1012
     
    1719  [PushExpression(StackTypes.Integer, "INTEGER.ROT")]
    1820  public class IntegerRotateExpression : RotateExpression<long> {
    19     public override bool Eval(IPushInterpreter interpreter) {
     21    public override bool Eval(IInternalPushInterpreter interpreter) {
    2022      return Eval(interpreter.IntegerStack);
    2123    }
     
    2426  [PushExpression(StackTypes.Float, "FLOAT.ROT")]
    2527  public class FloatRotateExpression : RotateExpression<double> {
    26     public override bool Eval(IPushInterpreter interpreter) {
     28    public override bool Eval(IInternalPushInterpreter interpreter) {
    2729      return Eval(interpreter.FloatStack);
    2830    }
     
    3133  [PushExpression(StackTypes.Boolean, "BOOLEAN.ROT")]
    3234  public class BooleanRotateExpression : RotateExpression<bool> {
    33     public override bool Eval(IPushInterpreter interpreter) {
     35    public override bool Eval(IInternalPushInterpreter interpreter) {
    3436      return Eval(interpreter.BooleanStack);
    3537    }
     
    3840  [PushExpression(StackTypes.Name, "NAME.ROT")]
    3941  public class NameRotateExpression : RotateExpression<string> {
    40     public override bool Eval(IPushInterpreter interpreter) {
     42    public override bool Eval(IInternalPushInterpreter interpreter) {
    4143      return Eval(interpreter.NameStack);
    4244    }
     
    4547  [PushExpression(StackTypes.Exec, "EXEC.ROT")]
    4648  public class ExecRotateExpression : RotateExpression<Expression> {
    47     public override bool Eval(IPushInterpreter interpreter) {
     49    public override bool Eval(IInternalPushInterpreter interpreter) {
    4850      return Eval(interpreter.ExecStack);
    4951    }
     
    5254  [PushExpression(StackTypes.Code, "CODE.ROT")]
    5355  public class CodeRotateExpression : RotateExpression<Expression> {
    54     public override bool Eval(IPushInterpreter interpreter) {
     56    public override bool Eval(IInternalPushInterpreter interpreter) {
    5557      return Eval(interpreter.CodeStack);
    5658    }
     
    5961  [PushExpression(StackTypes.Char, "CHAR.ROT")]
    6062  public class CharRotateExpression : RotateExpression<char> {
    61     public override bool Eval(IPushInterpreter interpreter) {
     63    public override bool Eval(IInternalPushInterpreter interpreter) {
    6264      return Eval(interpreter.CharStack);
    6365    }
     
    6668  [PushExpression(StackTypes.String, "STRING.ROT")]
    6769  public class StringRotateExpression : RotateExpression<string> {
    68     public override bool Eval(IPushInterpreter interpreter) {
     70    public override bool Eval(IInternalPushInterpreter interpreter) {
    6971      return Eval(interpreter.StringStack);
    7072    }
    7173  }
     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  }
    7281}
Note: See TracChangeset for help on using the changeset viewer.