/// <summary>
 /// Disconnect this Input from Target Output.
 /// </summary>
 /// <param name="Target_output">The Target Output you want to disconnect</param>
 public void disconnect_this_Input_from(ISimulatable Target_output)
 {
     ((ISimulatable)Target_output).I_am_finish -= ConnectEventHandler;
 }
 /// <summary>
 /// Connect this input with the output of another ISimulatable object in your Schematic.
 /// </summary>
 /// <param name="Target_output">You want to connect with</param>
 public void connect_this_Input_with(ISimulatable Target_output)
 {
     ((ISimulatable)Target_output).I_am_finish += ConnectEventHandler;
 }
 /// <summary>
 /// Initializes a new instance of a Simulator of a standard Controller Schematic
 /// </summary>
 /// <param name="Controller">The Controller of your Schematic</param>
 /// <param name="Jamming">The Jamming of your Schematic</param>
 /// <param name="Control_loop">The Control-Loop of your Schematic</param>
 public Simulator(ISimulatable Controller, Step Jamming, ISimulatable Control_loop)
 {
     _Schematic = new ISimulatable[] { new Adder(new string[] { "+1", "-1" }), Controller, Jamming ,Control_loop };
     _Schematic[1].connect_this_Input_with(_Schematic[0]);
     _Schematic[2].connect_this_Input_with(_Schematic[1]);
     _Schematic[3].connect_this_Input_with(_Schematic[2]);
     _Schematic[0].connect_this_Input_with(_Schematic[3]);
 }
        /// <summary>
        /// Replaces the ISimulatable Object at the specified position in the Schematic
        /// </summary>
        /// <param name="position">The Position you want to replace</param>
        /// <param name="x">The ISimulatable Object</param>
        /// <returns></returns>
        public bool replace_in_Schematic_at_pos(int position, ISimulatable x)
        {
            int kdh = _Schematic.Length;
            if ((_Schematic.Length - 1 > position) && position > 0)
            {
                //Step 1: Disconnect both old connections
                _Schematic[position].disconnect_this_Input_from(_Schematic[position - 1]);
                _Schematic[position + 1].disconnect_this_Input_from(_Schematic[position]);

                //Step 2: Set new Object to the position
                _Schematic[position] = x;

                //Step 3: new connections
                _Schematic[position].connect_this_Input_with(_Schematic[position - 1]);
                _Schematic[position + 1].connect_this_Input_with(_Schematic[position]);
                return true;
            }
            else if ((_Schematic.Length - 1 == position) && position > 0)                         //Last position in Schematic
            {
                //Step 1: Disconnect both old connections
                _Schematic[position].disconnect_this_Input_from(_Schematic[position - 1]);
                _Schematic[0].disconnect_this_Input_from(_Schematic[position]);

                //Step 2: Set new Object to the position
                _Schematic[position] = x;

                //Step 3: new connections
                _Schematic[position].connect_this_Input_with(_Schematic[position - 1]);
                _Schematic[0].connect_this_Input_with(_Schematic[position]);
                return true;
            }
            else
                return false;
        }
 /// <summary>
 /// Initializes a new instance of a Simulator
 /// </summary>
 /// <param name="x">The Schematic you want to simulate</param>
 public Simulator(ISimulatable[] x)
 {
     _Schematic = x;
 }