using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Problems.ProgramSynthesis { /// /// InExpression has a state, but this state is static at compile time and therefore InExpression can be seen as stateless at runtime /// [StorableClass] public abstract class InExpression : StatelessExpression { private readonly int index; protected InExpression(int nr) { index = nr - 1; } [StorableConstructor] protected InExpression(bool deserializing) : base(deserializing) { } public override bool IsNoop(IInternalPushInterpreter interpreter) { var expression = interpreter.InputExpressions[index]; return expression.IsNoop(interpreter); } public override void Eval(IInternalPushInterpreter interpreter) { var expression = interpreter.InputExpressions[index]; expression.Eval(interpreter); } } [PushExpression( StackTypes.None, "IN1", "Pushes first input parameter.", isHidden: true, inExpressionNr: 1)] [StorableClass] public class In1Expression : InExpression { public In1Expression() : base(1) { } [StorableConstructor] protected In1Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN2", "Pushes second input parameter.", isHidden: true, inExpressionNr: 2)] [StorableClass] public class In2Expression : InExpression { public In2Expression() : base(2) { } [StorableConstructor] protected In2Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN3", "Pushes third input parameter.", isHidden: true, inExpressionNr: 3)] [StorableClass] public class In3Expression : InExpression { public In3Expression() : base(3) { } [StorableConstructor] protected In3Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN4", "Pushes fourth input parameter.", isHidden: true, inExpressionNr: 4)] [StorableClass] public class In4Expression : InExpression { public In4Expression() : base(4) { } [StorableConstructor] protected In4Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN5", "Pushes fifth input parameter.", isHidden: true, inExpressionNr: 5)] [StorableClass] public class In5Expression : InExpression { public In5Expression() : base(5) { } [StorableConstructor] protected In5Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN6", "Pushes sixth input parameter.", isHidden: true, inExpressionNr: 6)] [StorableClass] public class In6Expression : InExpression { public In6Expression() : base(6) { } [StorableConstructor] protected In6Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN7", "Pushes seventh input parameter.", isHidden: true, inExpressionNr: 7)] [StorableClass] public class In7Expression : InExpression { public In7Expression() : base(7) { } [StorableConstructor] protected In7Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN8", "Pushes eighth input parameter.", isHidden: true, inExpressionNr: 8)] [StorableClass] public class In8Expression : InExpression { public In8Expression() : base(8) { } [StorableConstructor] protected In8Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN9", "Pushes nineth input parameter.", isHidden: true, inExpressionNr: 9)] [StorableClass] public class In9Expression : InExpression { public In9Expression() : base(9) { } [StorableConstructor] protected In9Expression(bool deserializing) : base(deserializing) { } } [PushExpression( StackTypes.None, "IN10", "Pushes tenth input parameter.", isHidden: true, inExpressionNr: 10)] [StorableClass] public class In10Expression : InExpression { public In10Expression() : base(10) { } [StorableConstructor] protected In10Expression(bool deserializing) : base(deserializing) { } } }