Learn Unity ML-Agents:Fundamentals of Unity Machine Learning
上QQ阅读APP看书,第一时间看更新

Creating an environment

One thing you may have noticed while looking over the last example was that an ML-Agent environment requires a bit of custom setup. Unity documentation recommends that an ML environment be constructed of Academy, Agent, and Brain objects with associated scripts. There is a Template folder in the ML-Agents project which we will use to configure and set up a simple environment. Let's jump back to the Unity editor and get started setting up our first simple ML environment:

  1. Locate the Template folder in the ML-Agents folder within the Project window of the editor.  
  2. Right-click (Command Click on macOS) on the Template folder and select Show in Explorer from the context menu. This will open an explorer window with the files. 
  3. Select and copy the Template folder.
  4. Navigate up two levels to the Assets folder and paste the copied folder. This will add the Template folder to the root Assets folder.
  5. Rename the Template folder to Simple.
When you return to the editor, you will see a few namespace errors due to the duplicate Template scripts. We will fix that shortly.
  1. Return to the Unity editor and confirm the folder and files have been copied to the new Simple folder, as shown in the following screenshot:
Verifying that the Simple folder was created
  1. Double-click on the Scene to open it in the editor.