比较提交

...
此合并请求有变更与目标分支冲突。
/Project/ProjectSettings/TagManager.asset
/Project/ProjectSettings/GraphicsSettings.asset
/Project/ProjectSettings/DynamicsManager.asset
/Project/ProjectSettings/ProjectVersion.txt
/Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Area.prefab
/Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
/Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity
/Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab
/Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab
/com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs
/com.unity.ml-agents/Runtime/Sensors/CameraSensor.cs
/com.unity.ml-agents/Runtime/Sensors/CameraSensorComponent.cs
/ml-agents-envs/mlagents_envs/rpc_utils.py
/config/ppo/VisualFoodCollector.yaml
/Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/goal.prefab
/Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/pit.prefab

3 次代码提交

作者 SHA1 备注 提交日期
Jonathan Harper 7656f419 More experimentation 4 年前
Jonathan Harper 4e7a1170 Adding training configs 5 年前
Jonathan Harper 5906cd61 WIP dump - working prototype 5 年前
共有 42 个文件被更改,包括 8062 次插入940 次删除
  1. 28
      ml-agents-envs/mlagents_envs/rpc_utils.py
  2. 24
      Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Area.prefab
  3. 318
      Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/goal.prefab
  4. 326
      Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/pit.prefab
  5. 96
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BadFood.prefab
  6. 96
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/Food.prefab
  7. 71
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab
  8. 863
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab
  9. 808
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity
  10. 2
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity.meta
  11. 4
      Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
  12. 16
      Project/ProjectSettings/TagManager.asset
  13. 2
      Project/ProjectSettings/ProjectVersion.txt
  14. 2
      Project/ProjectSettings/DynamicsManager.asset
  15. 11
      Project/ProjectSettings/EditorBuildSettings.asset
  16. 1
      Project/ProjectSettings/GraphicsSettings.asset
  17. 1
      com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs
  18. 24
      com.unity.ml-agents/Runtime/Sensors/CameraSensorComponent.cs
  19. 484
      com.unity.ml-agents/Runtime/Sensors/CameraSensor.cs
  20. 1001
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-hackweekbackup.unity
  21. 7
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-hackweekbackup.unity.meta
  22. 1001
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-segmented.unity
  23. 7
      Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-segmented.unity.meta
  24. 1001
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-1.nn
  25. 11
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-1.nn.meta
  26. 1001
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-2.nn
  27. 11
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-2.nn.meta
  28. 1001
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-depthfood-1agent3.nn
  29. 11
      Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-depthfood-1agent3.nn.meta
  30. 105
      com.unity.ml-agents/Editor/CameraSensorSettingsDrawer.cs
  31. 3
      com.unity.ml-agents/Editor/CameraSensorSettingsDrawer.cs.meta
  32. 8
      com.unity.ml-agents/Runtime/Shaders.meta
  33. 37
      com.unity.ml-agents/Runtime/Sensors/CameraSensorSettings.cs
  34. 3
      com.unity.ml-agents/Runtime/Sensors/CameraSensorSettings.cs.meta
  35. 3
      com.unity.ml-agents/Runtime/Sensors/ColorEncoding.cs.meta
  36. 85
      com.unity.ml-agents/Runtime/Sensors/ColorEncoding.cs
  37. 28
      config/sac/VisualFoodCollector.yaml
  38. 26
      config/ppo/VisualFoodCollector.yaml
  39. 26
      config/ppo/VisualFoodCollector-linuxworking.yaml
  40. 440
      com.unity.ml-agents/Runtime/Shaders/UberReplacement.shader
  41. 9
      com.unity.ml-agents/Runtime/Shaders/UberReplacement.shader.meta

28
ml-agents-envs/mlagents_envs/rpc_utils.py


:param image_bytes: input byte array corresponding to image
:return: processed numpy array of observation from environment
"""
# we may have multiple pngs, so first
png_header = b"\x89PNG\r\n\x1a\n"
images = []
image = Image.open(io.BytesIO(image_bytearray))
# Normally Image loads lazily, this forces it to do loading in the timer scope.
image.load()
s = np.array(image, dtype=np.float32) / 255.0
if gray_scale:
s = np.mean(s, axis=2)
s = np.reshape(s, [s.shape[0], s.shape[1], 1])
return s
image_byte_splits = image_bytearray.split(png_header)
for image_bytes in image_byte_splits:
if len(image_bytes) > 0:
# add back the header
image = Image.open(io.BytesIO(png_header + image_bytes))
# Normally Image loads lazily, this forces it to do loading in the timer scope.
image.load()
images.append(image)
arrs = list(map(lambda i: np.array(i, dtype=np.float32) / 255.0, images))
return np.concatenate(arrs, axis=2)
@timed

return img
else:
img = process_pixels(obs.compressed_data, gray_scale)
# We can drop additional channels since they may need to be added to include
# numbers of observation channels not divisible by 3.
expected_channels = list(obs.shape)[2]
actual_channels = list(img.shape)[2]
if actual_channels > expected_channels:
img = img[..., 0:expected_channels]
# Compare decompressed image size to observation shape and make sure they match
if list(obs.shape) != list(img.shape):
raise UnityObservationException(

24
Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/Area.prefab


- component: {fileID: 33152597024021804}
- component: {fileID: 65829039252076494}
- component: {fileID: 23027717151182946}
m_Layer: 0
m_Layer: 11
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}

- component: {fileID: 114650561397225712}
- component: {fileID: 114889700908650620}
- component: {fileID: 7980686505185502968}
m_Layer: 8
m_Layer: 11
m_Name: Agent
m_TagString: agent
m_Icon: {fileID: 0}

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 0
numStackedVectorObservations: 1
vectorActionSize: 05000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 0
NumStackedVectorObservations: 1
VectorActionSize: 05000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: a812f1ce7763a4a0c912717f3594fe20, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114650561397225712
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 100
MaxStep: 100
area: {fileID: 114704252266302846}
timeBetweenDecisionsAtInference: 0.15
renderCamera: {fileID: 0}

m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1625008366184734
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 33813191588135886}
- component: {fileID: 65922560747716658}
- component: {fileID: 23740566138369150}
m_Layer: 0
m_Layer: 11
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}

- component: {fileID: 33825707296015202}
- component: {fileID: 65020466233620882}
- component: {fileID: 23205928308810388}
m_Layer: 0
m_Layer: 11
m_Name: Cube (3)
m_TagString: Untagged
m_Icon: {fileID: 0}

- component: {fileID: 33172111281575160}
- component: {fileID: 65321351298141546}
- component: {fileID: 23200653194041678}
m_Layer: 0
m_Layer: 11
m_Name: Cube (2)
m_TagString: Untagged
m_Icon: {fileID: 0}

318
Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/goal.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1508142483324970}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Layer: 0
m_Layer: 10
m_Name: goal
m_TagString: goal
m_Icon: {fileID: 0}

--- !u!1 &1765554778432800
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4401303026649678}
- component: {fileID: 33048545948983598}
- component: {fileID: 65991532807116388}
- component: {fileID: 23889676296172340}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1823577511622086
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4889404563930382}
- component: {fileID: 33298529236581638}
- component: {fileID: 65392370003653392}
- component: {fileID: 23079780473834094}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1508142483324970}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4401303026649678
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1765554778432800}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.2, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4266498611226432}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4889404563930382
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1823577511622086}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0.2}
m_Children: []
m_Father: {fileID: 4266498611226432}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23079780473834094
--- !u!33 &33776711028771674
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1508142483324970}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65981801441420474
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1508142483324970}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.9, y: 0.9, z: 0.9}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23936659159756770
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1823577511622086}
m_Enabled: 1
m_CastShadows: 1
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1508142483324970}
m_Enabled: 0
m_CastShadows: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &1765554778432800
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4401303026649678}
- component: {fileID: 33048545948983598}
- component: {fileID: 65991532807116388}
- component: {fileID: 23889676296172340}
m_Layer: 10
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4401303026649678
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1765554778432800}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.2, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4266498611226432}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33048545948983598
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1765554778432800}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65991532807116388
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1765554778432800}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1765554778432800}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23936659159756770
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1508142483324970}
--- !u!1 &1823577511622086
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4889404563930382}
- component: {fileID: 33298529236581638}
- component: {fileID: 65392370003653392}
- component: {fileID: 23079780473834094}
m_Layer: 10
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4889404563930382
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823577511622086}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 0.2}
m_Children: []
m_Father: {fileID: 4266498611226432}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33298529236581638
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823577511622086}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65392370003653392
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823577511622086}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_CastShadows: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23079780473834094
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823577511622086}
m_Enabled: 1
m_CastShadows: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33048545948983598
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1765554778432800}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33298529236581638
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1823577511622086}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33776711028771674
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1508142483324970}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65392370003653392
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1823577511622086}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65981801441420474
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1508142483324970}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.9, y: 0.9, z: 0.9}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65991532807116388
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1765554778432800}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

326
Project/Assets/ML-Agents/Examples/GridWorld/Prefabs/pit.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1811317785436014}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Layer: 0
m_Layer: 9
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}

--- !u!1 &1778744900735866
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4012045820321770}
- component: {fileID: 33355843709390916}
- component: {fileID: 65087511814012390}
- component: {fileID: 23151230937589412}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1811317785436014
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4302184315941402}
- component: {fileID: 33217562963522382}
- component: {fileID: 65172047905851350}
- component: {fileID: 23740670609665506}
m_Layer: 0
m_Name: pit
m_TagString: pit
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4012045820321770
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1778744900735866}
m_LocalRotation: {x: -0, y: 0.38268343, z: -0, w: 0.92387956}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.20000002, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4302184315941402}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0}
--- !u!4 &4302184315941402
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1811317785436014}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4012045820321770}
- {fileID: 4873889445063974}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1308998153656692}
m_LocalRotation: {x: -0, y: -0.38268343, z: -0, w: 0.92387956}
m_LocalPosition: {x: 0, y: 0, z: 0}

m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: -45, z: 0}
--- !u!23 &23151230937589412
--- !u!33 &33297748647671602
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1308998153656692}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65439704505015706
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1308998153656692}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23833739472231758
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1778744900735866}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1308998153656692}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1

m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23740670609665506
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1811317785436014}
--- !u!1 &1778744900735866
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4012045820321770}
- component: {fileID: 33355843709390916}
- component: {fileID: 65087511814012390}
- component: {fileID: 23151230937589412}
m_Layer: 9
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4012045820321770
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1778744900735866}
m_LocalRotation: {x: -0, y: 0.38268343, z: -0, w: 0.92387956}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.20000002, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4302184315941402}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0}
--- !u!33 &33355843709390916
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1778744900735866}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65087511814012390
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1778744900735866}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_CastShadows: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23151230937589412
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1778744900735866}
m_Enabled: 1
m_CastShadows: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!23 &23833739472231758
--- !u!1 &1811317785436014
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4302184315941402}
- component: {fileID: 33217562963522382}
- component: {fileID: 65172047905851350}
- component: {fileID: 23740670609665506}
m_Layer: 9
m_Name: pit
m_TagString: pit
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4302184315941402
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1811317785436014}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4012045820321770}
- {fileID: 4873889445063974}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33217562963522382
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1811317785436014}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65172047905851350
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1811317785436014}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.9, y: 0.9, z: 0.9}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23740670609665506
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1308998153656692}
m_Enabled: 1
m_CastShadows: 1
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1811317785436014}
m_Enabled: 0
m_CastShadows: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33217562963522382
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1811317785436014}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33297748647671602
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1308998153656692}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &33355843709390916
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1778744900735866}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65087511814012390
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1778744900735866}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65172047905851350
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1811317785436014}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.9, y: 0.9, z: 0.9}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65439704505015706
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1308998153656692}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}

96
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/BadFood.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1853821981215314}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4094284922894548}
- component: {fileID: 33861055306973786}

- component: {fileID: 114054540722299252}
m_Layer: 0
m_Layer: 12
m_Name: BadFood
m_TagString: badFood
m_Icon: {fileID: 0}

--- !u!4 &4094284922894548
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -32.01, y: 2, z: -12.46}

m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33861055306973786
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!135 &135398688903115902
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33861055306973786
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853821981215314}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Drag: 0
m_AngularDrag: 0.05
m_Drag: 0.1
m_AngularDrag: 0.1
m_Constraints: 0
m_Constraints: 90
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853821981215314}
m_Enabled: 1
m_EditorHideFlags: 0

respawn: 0
myArea: {fileID: 0}
--- !u!135 &135398688903115902
SphereCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853821981215314}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}

96
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/Food.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1699568242032636}
m_IsPrefabParent: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4317744128851916}
- component: {fileID: 33865088620820440}

- component: {fileID: 114154930672833238}
m_Layer: 0
m_Layer: 13
m_Name: Food
m_TagString: food
m_Icon: {fileID: 0}

--- !u!4 &4317744128851916
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -32.01, y: 2, z: -9.559753}

m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33865088620820440
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!135 &135161629589834772
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33865088620820440
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1699568242032636}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Drag: 0
m_AngularDrag: 0.05
m_Drag: 0.1
m_AngularDrag: 0.1
m_Constraints: 0
m_Constraints: 90
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699568242032636}
m_Enabled: 1
m_EditorHideFlags: 0

respawn: 0
myArea: {fileID: 0}
--- !u!135 &135161629589834772
SphereCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1699568242032636}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.75
m_Center: {x: 0, y: 0, z: 0}

71
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab


m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 4
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 4
NumStackedVectorObservations: 1
VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: 36ab3e93020504f48858d0856f939685, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114176228333253036
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 5000
MaxStep: 5000
area: {fileID: 1819751139121548}
turnSpeed: 300
moveSpeed: 2

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
offsetStep: 0
--- !u!114 &1222199865870203693
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1482701732800114
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 4
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 4
NumStackedVectorObservations: 1
VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: 36ab3e93020504f48858d0856f939685, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114711827726849508
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 5000
MaxStep: 5000
area: {fileID: 1819751139121548}
turnSpeed: 300
moveSpeed: 2

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
offsetStep: 0
--- !u!1 &1528397385587768
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 4
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 4
NumStackedVectorObservations: 1
VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: 36ab3e93020504f48858d0856f939685, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114542632553128056
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 5000
MaxStep: 5000
area: {fileID: 1819751139121548}
turnSpeed: 300
moveSpeed: 2

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
offsetStep: 0
--- !u!1 &1617924810425504
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 4
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 4
NumStackedVectorObservations: 1
VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: 36ab3e93020504f48858d0856f939685, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114189751434580810
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 5000
MaxStep: 5000
area: {fileID: 1819751139121548}
turnSpeed: 300
moveSpeed: 2

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
offsetStep: 0
--- !u!1 &1688105343773098
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
vectorObservationSize: 4
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
vectorActionDescriptions: []
vectorActionSpaceType: 0
VectorObservationSize: 4
NumStackedVectorObservations: 1
VectorActionSize: 03000000030000000300000002000000
VectorActionDescriptions: []
VectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: 36ab3e93020504f48858d0856f939685, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0

m_ObservableAttributeHandling: 0
--- !u!114 &114235147148547996
MonoBehaviour:
m_ObjectHideFlags: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 5000
MaxStep: 5000
area: {fileID: 1819751139121548}
turnSpeed: 300
moveSpeed: 2

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
offsetStep: 0
--- !u!1 &1729825611722018
GameObject:
m_ObjectHideFlags: 0

863
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab
文件差异内容过多而无法显示
查看文件

808
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity


m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3

m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.44971162, g: 0.49977726, b: 0.5756362, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:

m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000,
type: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 273651478}
m_CullTransparentMesh: 0
--- !u!1001 &319126439
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1145096862361766, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_Name
value: VisualFoodCollectorArea
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.y
value: 12.3
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 388844068572732955, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 1885620624539145840, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2034865352926823123, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 5034354815516504833, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5149732301250347434, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 6465564399590757004, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6981080584877106066, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 3323fafb8b6b84159b4bc0b81dfddd13,
type: 3}
- target: {fileID: 7792873244987358972, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8057085080167528306, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8700737784952367316, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
--- !u!1 &378228137
GameObject:
m_ObjectHideFlags: 0

- {fileID: 1799584681}
- {fileID: 1086444498}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

--- !u!1001 &611835165
--- !u!1 &499540684
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 499540687}
- component: {fileID: 499540686}
- component: {fileID: 499540685}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &499540685
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 499540684}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &499540686
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 499540684}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &499540687
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 499540684}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &639811942
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2

- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 1145096862361766, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_Name
value: VisualFoodCollectorArea (3)
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
value: 0
value: -300
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
value: 0
value: -0
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
value: 0
value: -0
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
value: 0
value: -0
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 388844068572732955, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_RootOrder
propertyPath: contribute
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_AnchoredPosition.x
value: 0
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_AnchoredPosition.y
value: 0
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 1885620624539145840, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_SizeDelta.x
propertyPath: m_IsActive
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 2034865352926823123, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_SizeDelta.y
value: 0
propertyPath: contribute
value: 1
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_AnchorMin.x
value: 0
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 5149732301250347434, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 6465564399590757004, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 6981080584877106066, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 3323fafb8b6b84159b4bc0b81dfddd13,
propertyPath: m_AnchorMin.y
- target: {fileID: 7792873244987358972, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 8057085080167528306, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_AnchorMax.x
propertyPath: m_IsActive
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 8700737784952367316, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_AnchorMax.y
propertyPath: m_IsActive
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_Pivot.x
value: 0
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
propertyPath: m_Pivot.y
value: 0
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}
--- !u!1001 &868060419
m_SourcePrefab: {fileID: 100100000, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
--- !u!1001 &846304648
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2

- target: {fileID: 1145096862361766, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_Name
value: VisualFoodCollectorArea (1)
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.x
value: 0

value: 0
value: -100
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.z

objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_RootOrder
value: 5
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 388844068572732955, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 1885620624539145840, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2034865352926823123, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 5034354815516504833, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5149732301250347434, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 6465564399590757004, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6981080584877106066, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 3323fafb8b6b84159b4bc0b81dfddd13,
type: 3}
- target: {fileID: 7792873244987358972, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8057085080167528306, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8700737784952367316, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
--- !u!1001 &916917435
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.x
value: 0.31598538
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.y
value: -0.3596048
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.z
value: 0.13088542
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.w
value: 0.8681629
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
--- !u!1 &1009000883
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0}
--- !u!20 &1009000887
Camera:

m_AnchoredPosition: {x: -1000, y: -239.57645}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1001 &1232021009
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1537121661968964, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_Name
value: Directional Light
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.x
value: 106.38621
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.y
value: 38.840767
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.z
value: 34.72934
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.x
value: 0.31598538
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.y
value: -0.3596048
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.z
value: 0.13088542
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.w
value: 0.8681629
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
--- !u!1 &1574236047
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1799584680
GameObject:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1799584680}
m_CullTransparentMesh: 0
--- !u!1001 &1924527812
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1145096862361766, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_Name
value: VisualFoodCollectorArea (2)
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.y
value: -200
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4307641258646068, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 388844068572732955, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1206132776009993105, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 1885620624539145840, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2034865352926823123, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2998257954453135152, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 5149732301250347434, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 5996503233874835621, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
- target: {fileID: 6465564399590757004, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: contribute
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6981080584877106066, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 3323fafb8b6b84159b4bc0b81dfddd13,
type: 3}
- target: {fileID: 7792873244987358972, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8057085080167528306, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8700737784952367316, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 8770797731974984656, guid: c85b585836e104587b4efdc4d8b9d62b,
type: 3}
propertyPath: m_CameraSensorSettings.LayerMasks.Array.data[0]
value: 13
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c85b585836e104587b4efdc4d8b9d62b, type: 3}
--- !u!1001 &2124876351
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}

2
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity.meta


fileFormatVersion: 2
guid: dbc5c542957ef47bd8ebe87fc1000c37
guid: f20e977ac950e415792850aabc6c6812
DefaultImporter:
externalObjects: {}
userData:

4
Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs


public override void Heuristic(float[] actionsOut)
{
actionsOut[0] = 0f;
actionsOut[1] = 0f;
actionsOut[2] = 0f;
if (Input.GetKey(KeyCode.D))
{
actionsOut[2] = 2f;

}
if (collision.gameObject.CompareTag("badFood"))
{
//Debug.Log("Colliding with bad food!");
Poison();
collision.gameObject.GetComponent<FoodLogic>().OnEaten();

16
Project/ProjectSettings/TagManager.asset


-
-
- invisible
-
-
-
-
-
-
-
-
- pit
- goal
- agent
- badFood
- food
- floor
- walls
- laser
-
-
-

2
Project/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2018.4.17f1
m_EditorVersion: 2018.4.18f1

2
Project/ProjectSettings/DynamicsManager.asset


m_ClothInterCollisionDistance: 0
m_ClothInterCollisionStiffness: 0
m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffebffffffddffffffeffffffff5fffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 1
m_ReuseCollisionCallbacks: 1

11
Project/ProjectSettings/EditorBuildSettings.asset


EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 0
path: Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollectorOld.unity
guid: dbc5c542957ef47bd8ebe87fc1000c37
- enabled: 0
path: Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity
guid: 11583205ab5b74bb4bb1b9951cf9e437
- enabled: 1
path: Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector.unity
guid: f20e977ac950e415792850aabc6c6812
m_configObjects: {}

1
Project/ProjectSettings/GraphicsSettings.asset


- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,

1
com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs


EditorGUILayout.PropertyField(so.FindProperty("m_Width"), true);
EditorGUILayout.PropertyField(so.FindProperty("m_Height"), true);
EditorGUILayout.PropertyField(so.FindProperty("m_Grayscale"), true);
EditorGUILayout.PropertyField(so.FindProperty("m_CameraSensorSettings"), true);
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(so.FindProperty("m_Compression"), true);

24
com.unity.ml-agents/Runtime/Sensors/CameraSensorComponent.cs


set { m_Grayscale = value; }
}
[HideInInspector, SerializeField]
CameraSensorSettings m_CameraSensorSettings = new CameraSensorSettings();
/// <summary>
/// Whether to render the main camera.
/// </summary>
public CameraSensorSettings CameraSensorSettings
{
get { return m_CameraSensorSettings; }
set { m_CameraSensorSettings = value; }
}
/// <summary>
///
/// </summary>
[HideInInspector, SerializeField, FormerlySerializedAs("compression")]
SensorCompressionType m_Compression = SensorCompressionType.PNG;

/// <returns>The created <see cref="CameraSensor"/> object for this component.</returns>
public override ISensor CreateSensor()
{
m_Sensor = new CameraSensor(m_Camera, m_Width, m_Height, Grayscale, m_SensorName, m_Compression);
m_Sensor = new CameraSensor(m_Camera, m_Width, m_Height, Grayscale, m_SensorName, m_Compression, m_CameraSensorSettings);
return m_Sensor;
}

/// <returns>The observation shape of the associated <see cref="CameraSensor"/> object.</returns>
public override int[] GetObservationShape()
{
return CameraSensor.GenerateShape(m_Width, m_Height, Grayscale);
if (m_Sensor == null)
{
CreateSensor();
}
return m_Sensor.GenerateShape();
}
/// <summary>

484
com.unity.ml-agents/Runtime/Sensors/CameraSensor.cs


using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
using UnityEngine.Rendering;
using Object = UnityEngine.Object;
internal enum CameraSensorPassType
{
RGB,
Depth,
Segmentation,
AutoSegmentation
}
struct CameraSensorPass
{
public CameraSensorPassType PassType;
public Camera Camera;
public CameraSensorPass(CameraSensorPassType passType, Camera camera)
{
PassType = passType;
Camera = camera;
}
}
/// <summary>
/// A sensor that wraps a Camera object to generate visual observations for an agent.
/// </summary>

string m_Name;
int[] m_Shape;
SensorCompressionType m_CompressionType;
Shader uberReplacementShader = Shader.Find("Hidden/UberReplacement");
static readonly int _objectColor = Shader.PropertyToID("_ObjectColor");
static readonly int _categoryColor = Shader.PropertyToID("_CategoryColor");
static readonly int _layerNumber = Shader.PropertyToID("_LayerNumber");
CameraSensorSettings m_Settings;
List<CameraSensorPass> m_Passes;
/// <summary>
/// The Camera used for rendering the sensor observations.

set { m_Camera = value; }
}
internal List<CameraSensorPass> CreatePasses()
{
var passes = new List<CameraSensorPass>();
if (!m_Settings.DisableCamera)
{
passes.Add(new CameraSensorPass(CameraSensorPassType.RGB, m_Camera));
}
if (m_Settings.EnableDepth)
{
passes.Add(new CameraSensorPass(CameraSensorPassType.Depth, CreateHiddenCamera("depthCam")));
}
if (m_Settings.LayerMasks.Length > 0)
{
passes.Add(new CameraSensorPass(CameraSensorPassType.Segmentation, CreateHiddenCamera("segmentationCam")));
}
if (m_Settings.EnableAutoSegment)
{
passes.Add(new CameraSensorPass(CameraSensorPassType.AutoSegmentation, CreateHiddenCamera("autoSegmentationCam")));
}
return passes;
}
Camera CreateHiddenCamera(string name)
{
var go = new GameObject (name, typeof (Camera));
go.hideFlags = HideFlags.HideAndDontSave;
go.transform.parent = m_Camera.transform;
var newCamera = go.GetComponent<Camera>();
return newCamera;
}
/// <summary>
/// The compression type used by the sensor.
/// </summary>

set { m_CompressionType = value; }
}
/// <summary>
/// Creates and returns the camera sensor.

public CameraSensor(
Camera camera, int width, int height, bool grayscale, string name, SensorCompressionType compression)
{
m_Camera = camera;
m_Settings = new CameraSensorSettings();
Camera = camera;
m_Shape = GenerateShape(width, height, grayscale);
m_Passes = CreatePasses();
m_Shape = GenerateShape();
OnSceneChange();
}
public CameraSensor(
Camera camera,
int width,
int height,
bool grayscale,
string name,
SensorCompressionType compression,
CameraSensorSettings settings
) : this(camera, width, height, grayscale, name, compression)
{
m_Settings = settings;
Camera = camera;
m_Width = width;
m_Height = height;
m_Grayscale = grayscale;
m_Name = name;
m_CompressionType = compression;
m_Passes = CreatePasses();
m_Shape = GenerateShape();
OnSceneChange();
}
public void OnSceneChange()
{
var segPasses = m_Passes.Where(
p => p.PassType == CameraSensorPassType.Segmentation || p.PassType == CameraSensorPassType.AutoSegmentation
);
// NOTE: This avoids the expensive search for all renderers if we don't need segmentation.
if (!segPasses.Any()) return;
var renderers = Object.FindObjectsOfType<Renderer>();
// var renderers = m_Camera.transform.root.GetComponentsInChildren<Renderer>();
var mpb = new MaterialPropertyBlock();
foreach (var r in renderers)
{
GameObject gameObject = r.gameObject;
var id = gameObject.GetInstanceID();
var layer = gameObject.layer;
var tag = gameObject.tag;
mpb.SetColor(_objectColor, ColorEncoding.EncodeIDAsColor(id));
mpb.SetColor(_categoryColor, ColorEncoding.EncodeLayerAsColor(layer));
mpb.SetInt(_layerNumber, layer);
r.SetPropertyBlock(mpb);
}
}
internal List<float[,]> GetObservationChannels()
{
UpdateCameras();
OnSceneChange();
var channels = new List<float[,]>();
foreach (var pass in m_Passes)
{
var disableAntialiasing = pass.PassType != CameraSensorPassType.RGB;
var texture = ObservationToTexture(pass.Camera, m_Width, m_Height, disableAntialiasing);
var width = texture.width;
var height = texture.height;
var texturePixels = texture.GetPixels();
if (pass.PassType == CameraSensorPassType.RGB || pass.PassType == CameraSensorPassType.AutoSegmentation)
{
var r = new float[texture.width, texture.height];
var g = new float[texture.width, texture.height];
var b = new float[texture.width, texture.height];
for (var h = height - 1; h >= 0; h--)
{
for (var w = 0; w < width; w++)
{
var currentPixel = texturePixels[(height - h - 1) * width + w];
if (m_Grayscale)
{
r[h, w] = (currentPixel.r + currentPixel.g + currentPixel.b) / 3f;
}
else
{
// For Color32, the r, g and b values are between 0 and 1.
r[h, w] = currentPixel.r;
g[h, w] = currentPixel.g;
b[h, w] = currentPixel.b;
}
}
}
if (m_Grayscale)
{
channels.Add(r);
}
else
{
channels.Add(r); channels.Add(g); channels.Add(b);
}
}
else if (pass.PassType == CameraSensorPassType.Depth)
{
var depth = new float[texture.width, texture.height];
for (var h = height - 1; h >= 0; h--)
{
for (var w = 0; w < width; w++)
{
var currentPixel = texturePixels[(height - h - 1) * width + w];
depth[h, w] = (currentPixel.r + currentPixel.g + currentPixel.b) / 3f;
}
}
channels.Add(depth);
}
else if (pass.PassType == CameraSensorPassType.Segmentation)
{
var layerChannels = new List<float[,]>();
foreach (var layer in m_Settings.LayerMasks)
{
layerChannels.Add(new float[texture.width, texture.height]);
}
for (var h = height - 1; h >= 0; h--)
{
for (var w = 0; w < width; w++)
{
var currentPixel = texturePixels[(height - h - 1) * width + w];
// layer index is encoded in the red channel, divided by 100
var currentPixelIndex = (int)Math.Round((double) currentPixel.r * 100f);
// Try to decode the "r" channel as one of our layer IDs
var foundLayerIndex = Array.FindIndex(m_Settings.LayerMasks, i => i == currentPixelIndex);
if (foundLayerIndex >= 0)
{
// We found it, so set the value to 1
var layerChannel = layerChannels[foundLayerIndex];
layerChannel[h, w] = 1f;
}
}
}
foreach (var layerChannel in layerChannels) channels.Add(layerChannel);
}
// else if (pass.PassType == CameraSensorPassType.AutoSegmentation)
// {
// var r = new float[texture.width, texture.height];
// var g = new float[texture.width, texture.height];
// var b = new float[texture.width, texture.height];
// for (var h = height - 1; h >= 0; h--)
// {
// for (var w = 0; w < width; w++)
// {
// var currentPixel = texturePixels[(height - h - 1) * width + w];
// // For Color32, the r, g and b values are between 0 and 1.
// r[h, w] = currentPixel.r;
// g[h, w] = currentPixel.g;
// b[h, w] = currentPixel.b;
// }
// }
//
// channels.Add(r);
// channels.Add(g);
// channels.Add(b);
// }
DestroyTexture(texture);
}
return channels;
}
// Texture2D MakeGrayscale (tex : Texture2D) {
// var texColors = tex.GetPixels();
// for (i = 0; i < texColors.Length; i++) {
// var grayValue = texColors[i].grayscale;
// texColors[i] = Color(grayValue, grayValue, grayValue, texColors[i].a);
// }
// tex.SetPixels(texColors);
// tex.Apply();
// }
internal List<Texture2D> GetObservationTextures()
{
UpdateCameras();
OnSceneChange();
var textures = new List<Texture2D>();
var singleChannels = new List<float[]>();
foreach (var pass in m_Passes)
{
var disableAntialiasing = pass.PassType != CameraSensorPassType.RGB;
var texture = ObservationToTexture(pass.Camera, m_Width, m_Height, disableAntialiasing);
var width = texture.width;
var height = texture.height;
var texturePixels = texture.GetPixels();
if (pass.PassType == CameraSensorPassType.RGB)
{
if (m_Grayscale)
{
// turn to grayscale
for (var i = 0; i < texturePixels.Length; ++i)
{
var grayVal = texturePixels[i].grayscale;
texturePixels[i] = new Color(grayVal, grayVal, grayVal, texturePixels[i].a);
}
texture.SetPixels(texturePixels);
texture.Apply();
textures.Add(texture);
}
else
{
textures.Add(texture);
}
}
else if (pass.PassType == CameraSensorPassType.Depth)
{
// single channel -- convert to grayscale and add to single channels list
var channelVals = new float[texturePixels.Length];
for (var i = 0; i < texturePixels.Length; ++i)
{
channelVals[i] = texturePixels[i].grayscale;
}
singleChannels.Add(channelVals);
DestroyTexture(texture);
}
else if (pass.PassType == CameraSensorPassType.Segmentation)
{
var layerChannels = new List<float[]>();
foreach (var layer in m_Settings.LayerMasks)
{
layerChannels.Add(new float[texturePixels.Length]);
}
for (var i = 0; i < texturePixels.Length; ++i)
{
var currentPixel = texturePixels[i];
// layer index is encoded in the red channel, divided by 100
var currentPixelIndex = (int)Math.Round((double) currentPixel.r * 100f);
// Try to decode the "r" channel as one of our layer IDs
var foundLayerIndex = Array.FindIndex(m_Settings.LayerMasks, j => j == currentPixelIndex);
if (foundLayerIndex >= 0)
{
// We found it, so set the value to 1
var layerChannel = layerChannels[foundLayerIndex];
layerChannel[i] = 1f;
}
}
foreach (var layerChannel in layerChannels) singleChannels.Add(layerChannel);
// Since we captured these layers as a float array, we need to destroy the texture
DestroyTexture(texture);
}
else if (pass.PassType == CameraSensorPassType.AutoSegmentation)
{
if (m_Grayscale)
{
// turn to grayscale
for (var i = 0; i < texturePixels.Length; ++i)
{
var grayVal = texturePixels[i].grayscale;
texturePixels[i] = new Color(grayVal, grayVal, grayVal, texturePixels[i].a);
}
texture.SetPixels(texturePixels);
texture.Apply();
textures.Add(texture);
}
else
{
textures.Add(texture);
}
}
}
// Single channels need to be converted to colors and assigned to new textures.
// if we have 5 channels, we will need ceil(5/3) textures. Or, 2.
var numNewTextures = (int) Math.Ceiling(singleChannels.Count / 3f);
for (var i = 0; i < numNewTextures; ++i)
{
var tex = new Texture2D(m_Width, m_Height, TextureFormat.RGB24, false);
var colors = new Color[m_Width * m_Height];
var begin = i * 3;
for (var j = 0; j < m_Width * m_Height; ++j)
{
var firstChannelVal = singleChannels[begin][j];
var secondChannelVal = 0f;
if (singleChannels.Count > begin + 1)
{
secondChannelVal = singleChannels[begin + 1][j];
}
var thirdChannelVal = 0f;
if (singleChannels.Count > begin + 2)
{
thirdChannelVal = singleChannels[begin + 2][j];
}
colors[j] = new Color(firstChannelVal, secondChannelVal, thirdChannelVal);
}
tex.SetPixels(colors);
tex.Apply();
textures.Add(tex);
}
return textures;
}
public void UpdateCameras()
{
foreach (var pass in m_Passes)
{
if (pass.PassType == CameraSensorPassType.RGB)
continue;
// cleanup capturing camera
pass.Camera.RemoveAllCommandBuffers();
pass.Camera.ResetReplacementShader();
// copy all "main" camera parameters into capturing camera
pass.Camera.CopyFrom(m_Camera);
// setup command buffers and replacement shaders
SetupCameraWithReplacementShader(pass.Camera, uberReplacementShader, pass.PassType);
}
// cache materials and setup material properties
// if (!opticalFlowMaterial || opticalFlowMaterial.shader != opticalFlowShader)
// opticalFlowMaterial = new Material(opticalFlowShader);
// opticalFlowMaterial.SetFloat("_Sensitivity", opticalFlowSensitivity);
}
static void SetupCameraWithReplacementShader(Camera cam, Shader shader, CameraSensorPassType passType)
{
var cb = new CommandBuffer();
Color clearColor = Color.black;
int mode = -1;
if (passType == CameraSensorPassType.Depth)
{
mode = 2;
clearColor = Color.white;
}
else if (passType == CameraSensorPassType.Segmentation)
{
//Debug.Log("Setting shader mode to 3");
mode = 3;
}
else if (passType == CameraSensorPassType.AutoSegmentation)
{
mode = 1;
}
if (mode < 0)
{
throw new Exception("Error: unexpected pass type");
}
cb.SetGlobalInt("_OutputMode", mode);
cam.AddCommandBuffer(CameraEvent.BeforeForwardOpaque, cb);
cam.AddCommandBuffer(CameraEvent.BeforeFinalPass, cb);
cam.SetReplacementShader(shader, "");
cam.backgroundColor = clearColor;
cam.clearFlags = CameraClearFlags.SolidColor;
}
/// <summary>

/// <returns>Compressed image.</returns>
public byte[] GetCompressedObservation()
{
var allBytes = new List<byte>();
var texture = ObservationToTexture(m_Camera, m_Width, m_Height);
var textures = GetObservationTextures();
var compressed = texture.EncodeToPNG();
DestroyTexture(texture);
return compressed;
foreach (var tex in textures)
{
allBytes.AddRange(tex.EncodeToPNG());
DestroyTexture(tex);
}
return allBytes.ToArray();
}
}

{
using (TimerStack.Instance.Scoped("CameraSensor.WriteToTensor"))
{
var texture = ObservationToTexture(m_Camera, m_Width, m_Height);
var numWritten = Utilities.TextureToTensorProxy(texture, writer, m_Grayscale);
DestroyTexture(texture);
var numWritten = 0;
var channels = GetObservationChannels();
for (var channelInd = 0; channelInd < channels.Count; ++channelInd)
{
for (var h = 0; h < m_Height; ++h)
{
for (var w = 0; w < m_Width; ++w)
{
writer[h, w, channelInd] = channels[channelInd][h, w];
numWritten++;
}
}
}
return numWritten;
}
}

/// <param name="width">Width of resulting 2D texture.</param>
/// <param name="height">Height of resulting 2D texture.</param>
/// <returns name="texture2D">Texture2D to render to.</returns>
public static Texture2D ObservationToTexture(Camera obsCamera, int width, int height)
public static Texture2D ObservationToTexture(Camera obsCamera, int width, int height, bool disableAntialiasing = false)
{
var texture2D = new Texture2D(width, height, TextureFormat.RGB24, false);
var oldRec = obsCamera.rect;

var readWrite = RenderTextureReadWrite.Default;
var antiAliasing = (disableAntialiasing) ? 1 : Mathf.Max(1, QualitySettings.antiAliasing);
RenderTexture.GetTemporary(width, height, depth, format, readWrite);
RenderTexture.GetTemporary(width, height, depth, format, readWrite, antiAliasing);
var prevActiveRt = RenderTexture.active;
var prevCameraRt = obsCamera.targetTexture;

obsCamera.Render();
texture2D.ReadPixels(new Rect(0, 0, texture2D.width, texture2D.height), 0, 0);
texture2D.Apply();
obsCamera.targetTexture = prevCameraRt;
obsCamera.rect = oldRec;

/// <param name="height">Height of the image captures from the camera.</param>
/// <param name="grayscale">Whether or not to convert the image to grayscale.</param>
/// <returns>The observation shape.</returns>
internal static int[] GenerateShape(int width, int height, bool grayscale)
internal int[] GenerateShape()
return new[] { height, width, grayscale ? 1 : 3 };
int channels = 0;
foreach (var pass in m_Passes)
{
if (pass.PassType == CameraSensorPassType.RGB)
{
if (m_Grayscale) channels += 1;
else channels += 3;
}
if (pass.PassType == CameraSensorPassType.Depth)
{
channels += 1;
}
if (pass.PassType == CameraSensorPassType.Segmentation)
{
channels += m_Settings.LayerMasks.Length;
}
if (pass.PassType == CameraSensorPassType.AutoSegmentation)
{
if (m_Grayscale) channels += 1;
else channels += 3;
}
}
return new[] { m_Height, m_Width, channels };
}
static void DestroyTexture(Texture2D texture)

1001
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-hackweekbackup.unity
文件差异内容过多而无法显示
查看文件

7
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-hackweekbackup.unity.meta


fileFormatVersion: 2
guid: 269b9915616d54f788f7a6d7b86cf5a0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-segmented.unity
文件差异内容过多而无法显示
查看文件

7
Project/Assets/ML-Agents/Examples/FoodCollector/Scenes/VisualFoodCollector-segmented.unity.meta


fileFormatVersion: 2
guid: 9aef3dc1213244eb7baca088b43649cf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-1.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-1.nn.meta


fileFormatVersion: 2
guid: 1fdb1c796f9f942dfb458ab95b2f74e2
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-2.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-autoseg-linux-2.nn.meta


fileFormatVersion: 2
guid: 3323fafb8b6b84159b4bc0b81dfddd13
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-depthfood-1agent3.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/FoodCollector/TFModels/VisualFoodCollector-depthfood-1agent3.nn.meta


fileFormatVersion: 2
guid: d0ba90886892941509b7782249943202
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

105
com.unity.ml-agents/Editor/CameraSensorSettingsDrawer.cs


using Unity.MLAgents.Sensors;
using UnityEditor;
using UnityEngine;
namespace Unity.MLAgents.Editor
{
/// <summary>
/// PropertyDrawer for BrainParameters. Defines how BrainParameters are displayed in the
/// Inspector.
/// </summary>
[CustomPropertyDrawer(typeof(CameraSensorSettings))]
internal class CameraSensorSettingsDrawer : PropertyDrawer
{
// The height of a line in the Unity Inspectors
const float k_LineHeight = 17f;
const string k_LayerMasksPropName = "LayerMasks";
const string k_DisableCameraPropName = "DisableCamera";
const string k_EnableDepthPropName = "EnableDepth";
const string k_EnableAutoSegmentPropName = "EnableAutoSegment";
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return GetHeightDrawLayerMasks(property) + 4 * k_LineHeight;
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var indent = EditorGUI.indentLevel;
position.height = k_LineHeight;
EditorGUI.BeginProperty(position, label, property);
var disableCamProp = property.FindPropertyRelative(k_DisableCameraPropName);
EditorGUI.PropertyField(position, disableCamProp, new GUIContent("Disable camera"));
position.y += k_LineHeight;
var enableDepthProp = property.FindPropertyRelative(k_EnableDepthPropName);
EditorGUI.PropertyField(position, enableDepthProp, new GUIContent("Enable depth channel"));
position.y += k_LineHeight;
var enableAutoSegmentProp = property.FindPropertyRelative(k_EnableAutoSegmentPropName);
EditorGUI.PropertyField(position, enableAutoSegmentProp, new GUIContent("Enable auto segment"));
position.y += k_LineHeight;
// Vector Observations
DrawLayerMasks(position, property);
position.y += GetHeightDrawLayerMasks(property);
EditorGUI.EndProperty();
EditorGUI.indentLevel = indent;
}
/// <summary>
/// Draws the Layer Masks for the CameraSensorComponent
/// </summary>
/// <param name="position">Rectangle on the screen to use for the property GUI.</param>
/// <param name="property">The SerializedProperty of the CameraSensorComponent
/// to make the custom GUI for.</param>
static void DrawLayerMasks(Rect position, SerializedProperty property)
{
var layerMasksProp = property.FindPropertyRelative(k_LayerMasksPropName);
var newSize = EditorGUI.IntField(
position,
"# Layer Masks",
layerMasksProp.arraySize
);
// This check is here due to:
// https://fogbugz.unity3d.com/f/cases/1246524/
// If this case has been resolved, please remove this if condition.
if (newSize != layerMasksProp.arraySize)
{
layerMasksProp.arraySize = newSize;
}
position.y += k_LineHeight;
position.x += 20;
position.width -= 20;
for (var branchIndex = 0;
branchIndex < layerMasksProp.arraySize;
branchIndex++)
{
var layerMask =
layerMasksProp.GetArrayElementAtIndex(branchIndex);
var newMaskLayer = EditorGUI.LayerField(
position,
new GUIContent("Mask " + branchIndex + " layer number:",
"Layer number for layer mask " + branchIndex + "."),
layerMask.intValue
);
if (layerMask.intValue != newMaskLayer)
{
layerMask.intValue = newMaskLayer;
}
position.y += k_LineHeight;
}
}
static float GetHeightDrawLayerMasks(SerializedProperty property)
{
var layerMasksProp = property.FindPropertyRelative(k_LayerMasksPropName);
return (1 + layerMasksProp.arraySize) * k_LineHeight;
}
}
}

3
com.unity.ml-agents/Editor/CameraSensorSettingsDrawer.cs.meta


fileFormatVersion: 2
guid: 10f930409af6449fa72f05801f08cfb6
timeCreated: 1592871661

8
com.unity.ml-agents/Runtime/Shaders.meta


fileFormatVersion: 2
guid: b5af96abaf69d4ed2956e12ef0bf7e8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

37
com.unity.ml-agents/Runtime/Sensors/CameraSensorSettings.cs


using System;
namespace Unity.MLAgents.Sensors
{
[Serializable]
public class CameraSensorSettings
{
/// <summary>
/// Whether to disable sensor reporting back the raw pixels from the camera.
/// </summary>
/// <remarks>
/// This may be useful if using depth, layer masks, etc. if the raw pixels from the camera
/// would be redundant.
/// </remarks>
public bool DisableCamera;
/// <summary>
/// Whether to add a depth field channel to the sensor.
/// </summary>
public bool EnableDepth;
/// <summary>
/// Whether to enable automatic segmentation by layer
/// </summary>
public bool EnableAutoSegment;
/// <summary>
/// The list of Unity Layers to render masks for.
/// </summary>
/// <remarks>
/// In addition to RGB, Grayscale, or other image channels, we provide "layer masks" as
/// a way to explicitly capture whether objects in a certain Unity Layer fall within each
/// pixel.
/// </remarks>
public int[] LayerMasks = {};
}
}

3
com.unity.ml-agents/Runtime/Sensors/CameraSensorSettings.cs.meta


fileFormatVersion: 2
guid: f02d656dd2124d339fd2056ca0f26839
timeCreated: 1592871589

3
com.unity.ml-agents/Runtime/Sensors/ColorEncoding.cs.meta


fileFormatVersion: 2
guid: e3d8e3ee929e4029af6d000dbc7ca686
timeCreated: 1592847947

85
com.unity.ml-agents/Runtime/Sensors/ColorEncoding.cs


using UnityEngine;
namespace Unity.MLAgents.Sensors
{
public class ColorEncoding
{
public static byte ReverseBits(byte value)
{
return (byte)((value * 0x0202020202 & 0x010884422010) % 1023);
}
public static int SparsifyBits(byte value, int sparse)
{
int retVal = 0;
for (int bits = 0; bits < 8; bits++, value >>= 1)
{
retVal |= (value & 1);
retVal <<= sparse;
}
return retVal >> sparse;
}
public static Color EncodeIDAsColor(int instanceId)
{
var uid = instanceId * 2;
if (uid < 0)
uid = -uid + 1;
var sid =
(SparsifyBits((byte)(uid >> 16), 3) << 2) |
(SparsifyBits((byte)(uid >> 8), 3) << 1) |
SparsifyBits((byte)(uid ), 3);
//Debug.Log(uid + " >>> " + System.Convert.ToString(sid, 2).PadLeft(24, '0'));
var r = (byte)(sid >> 8);
var g = (byte)(sid >> 16);
var b = (byte)(sid);
//Debug.Log(r + " " + g + " " + b);
return new Color32 (r, g, b, 255);
}
public static Color EncodeTagAsColor(string tag)
{
var hash = tag.GetHashCode();
var a = (byte)(hash >> 24);
var r = (byte)(hash >> 16);
var g = (byte)(hash >> 8);
var b = (byte)(hash);
return new Color32 (r, g, b, a);
}
public static Color EncodeLayerAsColor(int layer)
{
// Following value must be in the range (0.5 .. 1.0)
// in order to avoid color overlaps when using 'divider' in this func
var z = .7f;
// First 8 layers are Unity Builtin layers
// Unity supports up to 32 layers in total
// Lets create palette of unique 16 colors
var uniqueColors = new []{
new Color(1,1,1,1), new Color(z,z,z,1), // 0
new Color(1,1,z,1), new Color(1,z,1,1), new Color(z,1,1,1), //
new Color(1,z,0,1), new Color(z,0,1,1), new Color(0,1,z,1), // 7
new Color(1,0,0,1), new Color(0,1,0,1), new Color(0,0,1,1), // 8
new Color(1,1,0,1), new Color(1,0,1,1), new Color(0,1,1,1), //
new Color(1,z,z,1), new Color(z,1,z,1) // 15
};
// Create as many colors as necessary by using base 16 color palette
// To create more than 16 - will simply adjust brightness with 'divider'
var color = uniqueColors[layer % uniqueColors.Length];
var divider = 1.0f + Mathf.Floor(layer / uniqueColors.Length);
color /= divider;
return color;
}
}
}

28
config/sac/VisualFoodCollector.yaml


behaviors:
VisualFoodCollector:
trainer_type: sac
hyperparameters:
learning_rate: 0.0003
learning_rate_schedule: constant
batch_size: 256
buffer_size: 100000
buffer_init_steps: 20000
tau: 0.005
steps_per_update: 10.0
save_replay_buffer: false
init_entcoef: 0.05
reward_signal_steps_per_update: 10.0
network_settings:
normalize: false
hidden_units: 128
num_layers: 2
vis_encode_type: nature_cnn
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 2000000
time_horizon: 64
summary_freq: 10000
threaded: true

26
config/ppo/VisualFoodCollector.yaml


behaviors:
VisualFoodCollector:
trainer_type: ppo
hyperparameters:
batch_size: 1024
buffer_size: 10240
learning_rate: 0.0003
beta: 0.005
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: constant
network_settings:
normalize: false
hidden_units: 128
num_layers: 2
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 2000000
time_horizon: 64
summary_freq: 10000
threaded: true

26
config/ppo/VisualFoodCollector-linuxworking.yaml


behaviors:
VisualFoodCollector:
trainer_type: ppo
hyperparameters:
batch_size: 500
buffer_size: 5000
learning_rate: 0.0003
beta: 0.005
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: linear
network_settings:
normalize: false
hidden_units: 128
num_layers: 2
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 10000000
time_horizon: 100
summary_freq: 40000
threaded: true

440
com.unity.ml-agents/Runtime/Shaders/UberReplacement.shader


// Based on builtin Internal-DepthNormalsTexture.shader
// EncodeDepthNormal() is replaced with custom Output() function
Shader "Hidden/UberReplacement" {
Properties {
_MainTex ("", 2D) = "white" {}
_Cutoff ("", Float) = 0.5
_Color ("", Color) = (1,1,1,1)
_ObjectColor ("Object Color", Color) = (1,1,1,1)
_CategoryColor ("Category Color", Color) = (0,1,0,1)
_LayerNumber ("Layer Number", int) = -1
}
SubShader {
CGINCLUDE
fixed4 _ObjectColor;
fixed4 _CategoryColor;
int _LayerNumber;
int _OutputMode;
// remap depth: [0 @ eye .. 1 @ far] => [0 @ near .. 1 @ far]
inline float Linear01FromEyeToLinear01FromNear(float depth01)
{
float near = _ProjectionParams.y;
float far = _ProjectionParams.z;
return (depth01 - near/far) * (1 + near/far);
}
float4 Output(float depth01, float3 normal)
{
if (_OutputMode == 0) // ObjectId
{
return _ObjectColor;
}
else if (_OutputMode == 1) // CategoryId
{
return _CategoryColor;
}
else if (_OutputMode == 2) // DepthCompressed
{
float linearZFromNear = Linear01FromEyeToLinear01FromNear(depth01);
float k = 0.25; // compression factor
return pow(linearZFromNear, k);
}
else if (_OutputMode == 3) // Layers
{
return float4(_LayerNumber / 100.0, 0.0, 0.0, 1);
}
// unsupported _OutputMode
return float4(1, 0.5, 0.5, 1);
}
ENDCG
// Support for different RenderTypes
// The following code is based on builtin Internal-DepthNormalsTexture.shader
Tags { "RenderType"="Opaque" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
float4 nz : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_base v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.pos = UnityObjectToClipPos(v.vertex);
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
fixed4 frag(v2f i) : SV_Target {
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TransparentCutout" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
uniform float4 _MainTex_ST;
v2f vert( appdata_base v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
uniform fixed4 _Color;
fixed4 frag(v2f i) : SV_Target {
fixed4 texcol = tex2D( _MainTex, i.uv );
clip( texcol.a*_Color.a - _Cutoff );
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TreeBark" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityBuiltin3xTreeLibrary.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TreeVertBark(v);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
fixed4 frag( v2f i ) : SV_Target {
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TreeLeaf" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityBuiltin3xTreeLibrary.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TreeVertLeaf(v);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
fixed4 frag( v2f i ) : SV_Target {
half alpha = tex2D(_MainTex, i.uv).a;
clip (alpha - _Cutoff);
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TreeOpaque" "DisableBatching"="True" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
float4 nz : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
v2f vert( appdata v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TerrainAnimateTree(v.vertex, v.color.w);
o.pos = UnityObjectToClipPos(v.vertex);
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
fixed4 frag(v2f i) : SV_Target {
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TreeTransparentCutout" "DisableBatching"="True" }
Pass {
Cull Back
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float4 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
v2f vert( appdata v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TerrainAnimateTree(v.vertex, v.color.w);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
fixed4 frag(v2f i) : SV_Target {
half alpha = tex2D(_MainTex, i.uv).a;
clip (alpha - _Cutoff);
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
Pass {
Cull Front
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float4 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
v2f vert( appdata v ) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TerrainAnimateTree(v.vertex, v.color.w);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.nz.xyz = -COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
fixed4 frag(v2f i) : SV_Target {
fixed4 texcol = tex2D( _MainTex, i.uv );
clip( texcol.a - _Cutoff );
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="TreeBillboard" }
Pass {
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert (appdata_tree_billboard v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y);
o.pos = UnityObjectToClipPos(v.vertex);
o.uv.x = v.texcoord.x;
o.uv.y = v.texcoord.y > 0;
o.nz.xyz = float3(0,0,1);
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
fixed4 frag(v2f i) : SV_Target {
fixed4 texcol = tex2D( _MainTex, i.uv );
clip( texcol.a - 0.001 );
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="GrassBillboard" }
Pass {
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
fixed4 color : COLOR;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert (appdata_full v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
WavingGrassBillboardVert (v);
o.color = v.color;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
fixed4 frag(v2f i) : SV_Target {
fixed4 texcol = tex2D( _MainTex, i.uv );
fixed alpha = texcol.a * i.color.a;
clip( alpha - _Cutoff );
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
SubShader {
Tags { "RenderType"="Grass" }
Pass {
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TerrainEngine.cginc"
struct v2f {
float4 pos : SV_POSITION;
fixed4 color : COLOR;
float2 uv : TEXCOORD0;
float4 nz : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert (appdata_full v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
WavingGrassVert (v);
o.color = v.color;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord;
o.nz.xyz = COMPUTE_VIEW_NORMAL;
o.nz.w = COMPUTE_DEPTH_01;
return o;
}
uniform sampler2D _MainTex;
uniform fixed _Cutoff;
fixed4 frag(v2f i) : SV_Target {
fixed4 texcol = tex2D( _MainTex, i.uv );
fixed alpha = texcol.a * i.color.a;
clip( alpha - _Cutoff );
return Output (i.nz.w, i.nz.xyz);
}
ENDCG
}
}
Fallback Off
}

9
com.unity.ml-agents/Runtime/Shaders/UberReplacement.shader.meta


fileFormatVersion: 2
guid: 3ffefcbf3b7a34356bd15ac448c73d3e
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存