Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/17 09:28:34 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

File:
1 edited

Legend:

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

    r14952 r15017  
    55  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    66  using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;
     7  using HeuristicLab.Problems.ProgramSynthesis.Push.Extensions;
    78  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
    89  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
     
    2526
    2627    protected void Eval(IPushStack<T> stack, IPushStack<long> integerStack) {
    27       var index = (int)Math.Abs(integerStack.Pop() % stack.Count);
     28      var index = integerStack.Pop().AsInt(stack.Count);
    2829      stack.Yank(index);
    2930    }
     
    9596
    9697  [StorableClass]
    97   [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer)]
     98  [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer, execIn: 0)]
    9899  public class ExecYankExpression : YankExpression<Expression> {
    99100    public ExecYankExpression() { }
     
    160161  [StorableClass]
    161162  [PushExpression(StackTypes.IntegerVector, "INTEGER[].YANK", StackTypes.Integer)]
    162   public class IntegerVectorYankExpression : YankExpression<List<long>> {
     163  public class IntegerVectorYankExpression : YankExpression<IReadOnlyList<long>> {
    163164    public IntegerVectorYankExpression() { }
    164165    [StorableConstructor]
     
    176177  [StorableClass]
    177178  [PushExpression(StackTypes.FloatVector, "FLOAT[].YANK", StackTypes.Integer)]
    178   public class FloatVectorYankExpression : YankExpression<List<double>> {
     179  public class FloatVectorYankExpression : YankExpression<IReadOnlyList<double>> {
    179180    public FloatVectorYankExpression() { }
    180181    [StorableConstructor]
     
    192193  [StorableClass]
    193194  [PushExpression(StackTypes.BooleanVector, "BOOLEAN[].YANK", StackTypes.Integer)]
    194   public class BooleanVectorYankExpression : YankExpression<List<bool>> {
     195  public class BooleanVectorYankExpression : YankExpression<IReadOnlyList<bool>> {
    195196    public BooleanVectorYankExpression() { }
    196197    [StorableConstructor]
     
    208209  [StorableClass]
    209210  [PushExpression(StackTypes.StringVector, "STRING[].YANK", StackTypes.Integer)]
    210   public class StringVectorYankExpression : YankExpression<List<string>> {
     211  public class StringVectorYankExpression : YankExpression<IReadOnlyList<string>> {
    211212    public StringVectorYankExpression() { }
    212213    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.