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/YankExpressions.cs

    r14777 r14834  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
     2  using System.Collections.Generic;
     3
    24  using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;
    35  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
     
    1012  /// <typeparam name="T">Stacktype</typeparam>
    1113  public abstract class YankExpression<T> : StatelessExpression {
    12     public bool Eval(IStack<T> stack, IStack<long> integerStack, int count = 1) {
     14    public bool Eval(IPushStack<T> stack, IPushStack<long> integerStack, int count = 1) {
    1315      if (integerStack.Count == 0) return false;
    1416
     
    2628  [PushExpression(StackTypes.Integer, "INTEGER.YANK")]
    2729  public class IntegerYankExpression : YankExpression<long> {
    28     public override bool Eval(IPushInterpreter interpreter) {
     30    public override bool Eval(IInternalPushInterpreter interpreter) {
    2931      return this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2);
    3032    }
     
    3335  [PushExpression(StackTypes.Float, "FLOAT.YANK", StackTypes.Integer)]
    3436  public class FloatYankExpression : YankExpression<double> {
    35     public override bool Eval(IPushInterpreter interpreter) {
     37    public override bool Eval(IInternalPushInterpreter interpreter) {
    3638      return this.Eval(interpreter.FloatStack, interpreter.IntegerStack);
    3739    }
     
    4042  [PushExpression(StackTypes.Boolean, "BOOLEAN.YANK", StackTypes.Integer)]
    4143  public class BooleanYankExpression : YankExpression<bool> {
    42     public override bool Eval(IPushInterpreter interpreter) {
     44    public override bool Eval(IInternalPushInterpreter interpreter) {
    4345      return this.Eval(interpreter.BooleanStack, interpreter.IntegerStack);
    4446    }
     
    4749  [PushExpression(StackTypes.Name, "NAME.YANK", StackTypes.Integer)]
    4850  public class NameYankExpression : YankExpression<string> {
    49     public override bool Eval(IPushInterpreter interpreter) {
     51    public override bool Eval(IInternalPushInterpreter interpreter) {
    5052      return this.Eval(interpreter.NameStack, interpreter.IntegerStack);
    5153    }
     
    5456  [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer)]
    5557  public class ExecYankExpression : YankExpression<Expression> {
    56     public override bool Eval(IPushInterpreter interpreter) {
     58    public override bool Eval(IInternalPushInterpreter interpreter) {
    5759      return this.Eval(interpreter.ExecStack, interpreter.IntegerStack);
    5860    }
     
    6163  [PushExpression(StackTypes.Code, "CODE.YANK", StackTypes.Integer)]
    6264  public class CodeYankExpression : YankExpression<Expression> {
    63     public override bool Eval(IPushInterpreter interpreter) {
     65    public override bool Eval(IInternalPushInterpreter interpreter) {
    6466      return this.Eval(interpreter.CodeStack, interpreter.IntegerStack);
    6567    }
     
    6870  [PushExpression(StackTypes.Char, "CHAR.YANK", StackTypes.Integer)]
    6971  public class CharYankExpression : YankExpression<char> {
    70     public override bool Eval(IPushInterpreter interpreter) {
     72    public override bool Eval(IInternalPushInterpreter interpreter) {
    7173      return Eval(interpreter.CharStack, interpreter.IntegerStack);
    7274    }
     
    7577  [PushExpression(StackTypes.String, "STRING.YANK", StackTypes.Integer)]
    7678  public class StringYankExpression : YankExpression<string> {
    77     public override bool Eval(IPushInterpreter interpreter) {
     79    public override bool Eval(IInternalPushInterpreter interpreter) {
    7880      return Eval(interpreter.StringStack, interpreter.IntegerStack);
    7981    }
    8082  }
     83
     84  [PushExpression(StackTypes.IntegerVector, "INTEGER[].YANK", StackTypes.Integer)]
     85  public class IntegerVectorYankExpression : YankExpression<List<long>> {
     86    public override bool Eval(IInternalPushInterpreter interpreter) {
     87      return Eval(interpreter.IntegerVectorStack, interpreter.IntegerStack);
     88    }
     89  }
    8190}
Note: See TracChangeset for help on using the changeset viewer.