浏览代码

cp

/hh-develop-pushblockcollab
HH 4 年前
当前提交
4f93957b
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 3
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabArea.prefab
  2. 10
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs
  3. 1
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockEnvController.cs

3
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabArea.prefab


m_Script: {fileID: 11500000, guid: 4bb2bb36bb51d452ab58d30a868dfab3, type: 3}
m_Name:
m_EditorClassIdentifier:
MaxEnvironmentSteps: 25000
areaBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}

maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
useVectorObs: 1
--- !u!65 &2416809913911815185
BoxCollider:
m_ObjectHideFlags: 0

maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
useVectorObs: 1
--- !u!65 &2404981946995968560
BoxCollider:
m_ObjectHideFlags: 0

10
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
public class PushAgentCollab : Agent
{

// Rigidbody m_BlockRb; //cached on initialization
Rigidbody m_AgentRb; //cached on initialization
public bool useVectorObs = true;
void Awake()
{
m_PushBlockSettings = FindObjectOfType<PushBlockSettings>();

m_AgentRb.AddForce(dirToGo * m_PushBlockSettings.agentRunSpeed,
ForceMode.VelocityChange);
}
// public override void CollectObservations(VectorSensor sensor)
// {
// if (useVectorObs)
// {
// sensor.AddObservation(StepCount / (float)MaxStep);
// }
// }
/// <summary>
/// Called every step of the engine. Here the agent takes an action.

1
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushBlockEnvController.cs


//Reset counter
m_NumberOfRemainingBlocks = BlocksList.Count;
// m_NumberOfRemainingBlocks = 2;
}
}
正在加载...
取消
保存