浏览代码

add brains

/hh-32-observation-crawler
HH 4 年前
当前提交
011e55df
共有 3 个文件被更改,包括 22 次插入82 次删除
  1. 83
      Project/Assets/ML-Agents/Examples/Crawler/Prefabs/Ragdoll/CrawlerBase.prefab
  2. 5
      Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerDynamicVariableSpeed.unity
  3. 16
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs

83
Project/Assets/ML-Agents/Examples/Crawler/Prefabs/Ragdoll/CrawlerBase.prefab


- {fileID: 4845971001588102148}
- {fileID: 2310084103354264149}
- {fileID: 2270141184585723026}
- {fileID: 379643616018628928}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1001 &3459778465278260478
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4845971001715176651}
m_Modifications:
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalPosition.z
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3840539935788495952, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_Name
value: Target
objectReference: {fileID: 0}
- target: {fileID: 3840539935788495952, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1a2a52e48911845a8a189e0891357ea2, type: 3}
--- !u!4 &379643616018628928 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3839136118347789758, guid: 1a2a52e48911845a8a189e0891357ea2,
type: 3}
m_PrefabInstance: {fileID: 3459778465278260478}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &4357529801223143938
PrefabInstance:
m_ObjectHideFlags: 0

type: 3}
propertyPath: targetToLookAt
value:
objectReference: {fileID: 379643616018628928}
objectReference: {fileID: 0}
- target: {fileID: 6026464216722085689, guid: e568400ebedb3474fac505995f12ed4a,
type: 3}
propertyPath: updatedByAgent

5
Project/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerDynamicVariableSpeed.unity


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3421283062001101770, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: typeOfCrawler
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.x

16
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


using System;
using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;

}
public CrawlerAgentBehaviorType typeOfCrawler;
//Crawler Brains
//A different brain will be used depending on the CrawlerAgentBehaviorType selected
[Header("NN Models")]
public NNModel crawlerDyBrain;
public NNModel crawlerDyVSBrain;
public NNModel crawlerStBrain;
public NNModel crawlerStVSBrain;
public float TargetWalkingSpeed // property
{

case CrawlerAgentBehaviorType.CrawlerDynamicVariableSpeed :
{
m_BehaviorParams.BehaviorName = "CrawlerDynamicVariableSpeed";
target = Instantiate(targetPrefab, transform.position, Quaternion.identity, transform);
randomizeWalkSpeedEachEpisode = true;
break;
}

var targetSpawnPos = transform.TransformDirection(new Vector3(0, 0, 1800));
target = Instantiate(targetPrefab, targetSpawnPos, Quaternion.identity, transform);
randomizeWalkSpeedEachEpisode = false;
break;
}

var targetSpawnPos = transform.TransformDirection(new Vector3(0, 0, 1800));
target = Instantiate(targetPrefab, targetSpawnPos, Quaternion.identity, transform);
randomizeWalkSpeedEachEpisode = true;
break;
}

正在加载...
取消
保存