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/FlushExpressions.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 FlushExpression<T> : StatelessExpression {
    12     public bool Eval(IStack<T> stack) {
     14    public bool Eval(IPushStack<T> stack) {
    1315      stack.Clear();
    1416      return true;
     
    1820  [PushExpression(StackTypes.Integer, "INTEGER.FLUSH")]
    1921  public class IntegerFlushExpression : FlushExpression<long> {
    20     public override bool Eval(IPushInterpreter interpreter) {
     22    public override bool Eval(IInternalPushInterpreter interpreter) {
    2123      return Eval(interpreter.IntegerStack);
    2224    }
     
    2527  [PushExpression(StackTypes.Float, "FLOAT.FLUSH")]
    2628  public class FloatFlushExpression : FlushExpression<double> {
    27     public override bool Eval(IPushInterpreter interpreter) {
     29    public override bool Eval(IInternalPushInterpreter interpreter) {
    2830      return Eval(interpreter.FloatStack);
    2931    }
     
    3234  [PushExpression(StackTypes.Boolean, "BOOLEAN.FLUSH")]
    3335  public class BooleanFlushExpression : FlushExpression<bool> {
    34     public override bool Eval(IPushInterpreter interpreter) {
     36    public override bool Eval(IInternalPushInterpreter interpreter) {
    3537      return Eval(interpreter.BooleanStack);
    3638    }
     
    3941  [PushExpression(StackTypes.Name, "NAME.FLUSH")]
    4042  public class NameFlushExpression : FlushExpression<string> {
    41     public override bool Eval(IPushInterpreter interpreter) {
     43    public override bool Eval(IInternalPushInterpreter interpreter) {
    4244      return Eval(interpreter.NameStack);
    4345    }
     
    4648  [PushExpression(StackTypes.Exec, "EXEC.FLUSH")]
    4749  public class ExecFlushExpression : FlushExpression<Expression> {
    48     public override bool Eval(IPushInterpreter interpreter) {
     50    public override bool Eval(IInternalPushInterpreter interpreter) {
    4951      return Eval(interpreter.ExecStack);
    5052    }
     
    5355  [PushExpression(StackTypes.Code, "CODE.FLUSH")]
    5456  public class CodeFlushExpression : FlushExpression<Expression> {
    55     public override bool Eval(IPushInterpreter interpreter) {
     57    public override bool Eval(IInternalPushInterpreter interpreter) {
    5658      return Eval(interpreter.CodeStack);
    5759    }
     
    6062  [PushExpression(StackTypes.Char, "CHAR.FLUSH")]
    6163  public class CharFlushExpression : FlushExpression<char> {
    62     public override bool Eval(IPushInterpreter interpreter) {
     64    public override bool Eval(IInternalPushInterpreter interpreter) {
    6365      return Eval(interpreter.CharStack);
    6466    }
     
    6769  [PushExpression(StackTypes.String, "STRING.FLUSH")]
    6870  public class StringFlushExpression : FlushExpression<string> {
    69     public override bool Eval(IPushInterpreter interpreter) {
     71    public override bool Eval(IInternalPushInterpreter interpreter) {
    7072      return Eval(interpreter.StringStack);
    7173    }
    7274  }
     75
     76  [PushExpression(StackTypes.IntegerVector, "INTEGER[].FLUSH")]
     77  public class IntegerVectorFlushExpression : FlushExpression<List<long>> {
     78    public override bool Eval(IInternalPushInterpreter interpreter) {
     79      return Eval(interpreter.IntegerVectorStack);
     80    }
     81  }
    7382}
Note: See TracChangeset for help on using the changeset viewer.