// Constructor to use for training, i.e. when Python starts everything
    public PythonAgentController(Environment environment, int portSend, int portReceive)
    {
        this.environment     = environment;
        network              = new UDPNetwork(portSend, portReceive);
        observationDimension = environment.ObservationDimension();
        actionDimension      = environment.ActionDimension();
        network.AllocateSendBuffer(1 + 4 + 4 * observationDimension);

        /* Send network msg to Python (12 bytes)
         * 1. port                    (int = 4 bytes) (port that python sends and unity receives)
         * 2. observation dimension   (int = 4 bytes)
         * 3. action dimension        (int = 4 bytes)
         */
        byte[] obsdimBytes = BitConverter.GetBytes(observationDimension);
        byte[] actdimBytes = BitConverter.GetBytes(actionDimension);
        byte[] introMsg    = new byte[2 * 4];
        introMsg[0] = obsdimBytes[0];
        introMsg[1] = obsdimBytes[1];
        introMsg[2] = obsdimBytes[2];
        introMsg[3] = obsdimBytes[3];
        introMsg[4] = actdimBytes[0];
        introMsg[5] = actdimBytes[1];
        introMsg[6] = actdimBytes[2];
        introMsg[7] = actdimBytes[3];
        network.Send(introMsg);
    }