Toward Seamless Transfer from Simulated to Real Worlds: A Dynamically-Rearranging Neural Network Approach