Ignore:
Timestamp:
04/10/17 00:27:31 (3 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/StackdepthExpressions.cs

    r14777 r14834  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
     2  using System.Collections.Generic;
     3
    24  using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;
    35
     
    1012  /// <typeparam name="T">Stacktype</typeparam>
    1113  public abstract class StackdepthExpression<T> : StatelessExpression {
    12     public bool Eval(IStack<T> stack, IStack<long> integerStack, bool incremental = false) {
     14    public bool Eval(IPushStack<T> stack, IPushStack<long> integerStack, bool incremental = false) {
    1315      var count = stack.Count;
    1416
     
    2325  public class IntegerStackdepthExpression : StackdepthExpression<long> {
    2426
    25     public override bool Eval(IPushInterpreter interpreter) {
     27    public override bool Eval(IInternalPushInterpreter interpreter) {
    2628      return Eval(interpreter.IntegerStack, interpreter.IntegerStack, true);
    2729    }
     
    3032  [PushExpression(StackTypes.Float, "FLOAT.STACKDEPTH", StackTypes.Integer)]
    3133  public class FloatStackdepthExpression : StackdepthExpression<double> {
    32     public override bool Eval(IPushInterpreter interpreter) {
     34    public override bool Eval(IInternalPushInterpreter interpreter) {
    3335      return Eval(interpreter.FloatStack, interpreter.IntegerStack);
    3436    }
     
    3739  [PushExpression(StackTypes.Boolean, "BOOLEAN.STACKDEPTH", StackTypes.Integer)]
    3840  public class BooleanStackdepthExpression : StackdepthExpression<bool> {
    39     public override bool Eval(IPushInterpreter interpreter) {
     41    public override bool Eval(IInternalPushInterpreter interpreter) {
    4042      return Eval(interpreter.BooleanStack, interpreter.IntegerStack);
    4143    }
     
    4446  [PushExpression(StackTypes.Name, "NAME.STACKDEPTH", StackTypes.Integer)]
    4547  public class NameStackdepthExpression : StackdepthExpression<string> {
    46     public override bool Eval(IPushInterpreter interpreter) {
     48    public override bool Eval(IInternalPushInterpreter interpreter) {
    4749      return Eval(interpreter.NameStack, interpreter.IntegerStack);
    4850    }
     
    5153  [PushExpression(StackTypes.Exec, "EXEC.STACKDEPTH", StackTypes.Integer)]
    5254  public class ExecStackdepthExpression : StackdepthExpression<Expression> {
    53     public override bool Eval(IPushInterpreter interpreter) {
     55    public override bool Eval(IInternalPushInterpreter interpreter) {
    5456      return Eval(interpreter.ExecStack, interpreter.IntegerStack);
    5557    }
     
    5860  [PushExpression(StackTypes.Code, "CODE.STACKDEPTH", StackTypes.Integer)]
    5961  public class CodeStackdepthExpression : StackdepthExpression<Expression> {
    60     public override bool Eval(IPushInterpreter interpreter) {
     62    public override bool Eval(IInternalPushInterpreter interpreter) {
    6163      return Eval(interpreter.CodeStack, interpreter.IntegerStack);
    6264    }
     
    6567  [PushExpression(StackTypes.Char, "CHAR.STACKDEPTH", StackTypes.Integer)]
    6668  public class CharStackdepthExpression : StackdepthExpression<char> {
    67     public override bool Eval(IPushInterpreter interpreter) {
     69    public override bool Eval(IInternalPushInterpreter interpreter) {
    6870      return Eval(interpreter.CharStack, interpreter.IntegerStack);
    6971    }
     
    7274  [PushExpression(StackTypes.String, "STRING.STACKDEPTH", StackTypes.Integer)]
    7375  public class StringStackdepthExpression : StackdepthExpression<string> {
    74     public override bool Eval(IPushInterpreter interpreter) {
     76    public override bool Eval(IInternalPushInterpreter interpreter) {
    7577      return Eval(interpreter.StringStack, interpreter.IntegerStack);
    7678    }
    7779  }
     80
     81  [PushExpression(StackTypes.IntegerVector, "INTEGER[].STACKDEPTH", StackTypes.Integer)]
     82  public class IntegerVectorStackdepthExpression : StackdepthExpression<List<long>> {
     83    public override bool Eval(IInternalPushInterpreter interpreter) {
     84      return Eval(interpreter.IntegerVectorStack, interpreter.IntegerStack);
     85    }
     86  }
    7887}
Note: See TracChangeset for help on using the changeset viewer.