Changeset 15017 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/YankExpressions.cs
- Timestamp:
- 06/01/17 09:28:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/YankExpressions.cs
r14952 r15017 5 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes; 7 using HeuristicLab.Problems.ProgramSynthesis.Push.Extensions; 7 8 using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter; 8 9 using HeuristicLab.Problems.ProgramSynthesis.Push.Stack; … … 25 26 26 27 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); 28 29 stack.Yank(index); 29 30 } … … 95 96 96 97 [StorableClass] 97 [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer )]98 [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer, execIn: 0)] 98 99 public class ExecYankExpression : YankExpression<Expression> { 99 100 public ExecYankExpression() { } … … 160 161 [StorableClass] 161 162 [PushExpression(StackTypes.IntegerVector, "INTEGER[].YANK", StackTypes.Integer)] 162 public class IntegerVectorYankExpression : YankExpression< List<long>> {163 public class IntegerVectorYankExpression : YankExpression<IReadOnlyList<long>> { 163 164 public IntegerVectorYankExpression() { } 164 165 [StorableConstructor] … … 176 177 [StorableClass] 177 178 [PushExpression(StackTypes.FloatVector, "FLOAT[].YANK", StackTypes.Integer)] 178 public class FloatVectorYankExpression : YankExpression< List<double>> {179 public class FloatVectorYankExpression : YankExpression<IReadOnlyList<double>> { 179 180 public FloatVectorYankExpression() { } 180 181 [StorableConstructor] … … 192 193 [StorableClass] 193 194 [PushExpression(StackTypes.BooleanVector, "BOOLEAN[].YANK", StackTypes.Integer)] 194 public class BooleanVectorYankExpression : YankExpression< List<bool>> {195 public class BooleanVectorYankExpression : YankExpression<IReadOnlyList<bool>> { 195 196 public BooleanVectorYankExpression() { } 196 197 [StorableConstructor] … … 208 209 [StorableClass] 209 210 [PushExpression(StackTypes.StringVector, "STRING[].YANK", StackTypes.Integer)] 210 public class StringVectorYankExpression : YankExpression< List<string>> {211 public class StringVectorYankExpression : YankExpression<IReadOnlyList<string>> { 211 212 public StringVectorYankExpression() { } 212 213 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.