Changeset 14744 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/PushResultExpression.cs
- Timestamp:
- 03/10/17 21:42:09 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/PushResultExpression.cs
r14727 r14744 5 5 6 6 public abstract class PushResultExpression<T> : StatelessExpression { 7 protected voidEval(IStack<T> stack, int count, Func<T[], T> templateFunc) {8 if (stack.Count < count) return ;7 protected bool Eval(IStack<T> stack, int count, Func<T[], T> templateFunc) { 8 if (stack.Count < count) return false; 9 9 10 10 stack.PushResult(count, templateFunc); 11 return true; 11 12 } 12 13 13 protected voidEval(IStack<T> stack, int count, Func<T[], T> templateFunc, T ignoreValue) {14 if ((stack.Count < count) || stack.Top.Equals(ignoreValue)) return ;14 protected bool Eval(IStack<T> stack, int count, Func<T[], T> templateFunc, T ignoreValue) { 15 if ((stack.Count < count) || stack.Top.Equals(ignoreValue)) return false; 15 16 16 17 stack.PushResult(count, templateFunc); 18 return true; 17 19 } 18 20 19 protected voidEval<R>(IStack<T> stack, IStack<R> resultStack, int count, Func<T[], R> templateFunc) {20 if (stack.Count < count) return ;21 protected bool Eval<R>(IStack<T> stack, IStack<R> resultStack, int count, Func<T[], R> templateFunc) { 22 if (stack.Count < count) return false; 21 23 22 24 var items = stack.Pop(count); … … 24 26 25 27 resultStack.Push(result); 28 return true; 26 29 } 27 30 }
Note: See TracChangeset
for help on using the changeset viewer.