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

    r14952 r15017  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
    2   using System;
    32  using System.Collections.Generic;
    43
     
    65
    76  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     7  using HeuristicLab.Problems.ProgramSynthesis.Push.Extensions;
    88
    99  using Interpreter;
     
    1717
    1818    protected void Eval(IPushStack<T> stack, IPushStack<long> integerStack) {
    19       var index = (int)Math.Abs(integerStack.Pop() % stack.Count);
     19      var index = integerStack.Pop().AsInt(stack.Count);
    2020      var item = stack.Pop();
    2121      stack.Insert(index, item);
     
    8787  }
    8888
    89   [PushExpression(StackTypes.Exec, "EXEC.SHOVE", StackTypes.Integer)]
     89  [PushExpression(StackTypes.Exec, "EXEC.SHOVE", StackTypes.Integer, execIn: 1)]
    9090  [StorableClass]
    9191  public class ExecShoveExpression : ShoveExpression<Expression> {
     
    153153  [PushExpression(StackTypes.IntegerVector, "INTEGER[].SHOVE", StackTypes.Integer)]
    154154  [StorableClass]
    155   public class IntegerVectorShoveExpression : ShoveExpression<List<long>> {
     155  public class IntegerVectorShoveExpression : ShoveExpression<IReadOnlyList<long>> {
    156156    public IntegerVectorShoveExpression() { }
    157157    [StorableConstructor]
     
    169169  [PushExpression(StackTypes.FloatVector, "FLOAT[].SHOVE", StackTypes.Integer)]
    170170  [StorableClass]
    171   public class FloatVectorShoveExpression : ShoveExpression<List<double>> {
     171  public class FloatVectorShoveExpression : ShoveExpression<IReadOnlyList<double>> {
    172172    public FloatVectorShoveExpression() { }
    173173    [StorableConstructor]
     
    185185  [PushExpression(StackTypes.BooleanVector, "BOOLEAN[].SHOVE", StackTypes.Integer)]
    186186  [StorableClass]
    187   public class BooleanVectorShoveExpression : ShoveExpression<List<bool>> {
     187  public class BooleanVectorShoveExpression : ShoveExpression<IReadOnlyList<bool>> {
    188188    public BooleanVectorShoveExpression() { }
    189189    [StorableConstructor]
     
    201201  [PushExpression(StackTypes.StringVector, "STRING[].SHOVE", StackTypes.Integer)]
    202202  [StorableClass]
    203   public class StringVectorShoveExpression : ShoveExpression<List<string>> {
     203  public class StringVectorShoveExpression : ShoveExpression<IReadOnlyList<string>> {
    204204    public StringVectorShoveExpression() { }
    205205    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.