浏览代码

Make the env easier

/comms-grad
Ervin Teng 4 年前
当前提交
0de1c0d7
共有 2 个文件被更改,包括 77 次插入12 次删除
  1. 65
      Project/Assets/ML-Agents/Examples/Hallway/Scenes/HallwayCollab.unity
  2. 24
      Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs

65
Project/Assets/ML-Agents/Examples/Hallway/Scenes/HallwayCollab.unity


propertyPath: m_Name
value: SymbolFinderArea (14)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -106

propertyPath: m_Name
value: SymbolFinderArea (8)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 50

propertyPath: m_Name
value: SymbolFinderArea (1)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 50

propertyPath: m_Name
value: SymbolFinderArea (11)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 100

propertyPath: m_Name
value: SymbolFinderArea (10)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 0

propertyPath: m_Name
value: SymbolFinderArea (15)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -156

propertyPath: m_Name
value: SymbolFinderArea (6)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -56

propertyPath: m_Name
value: SymbolFinderArea (13)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -56

propertyPath: m_Name
value: SymbolFinderArea (4)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -206

- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_Name
value: SymbolFinderArea (2)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x

propertyPath: m_Name
value: SymbolFinderArea (7)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -106

propertyPath: m_Name
value: SymbolFinderArea (5)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: -156

propertyPath: m_Name
value: SymbolFinderArea (9)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 150

propertyPath: m_Name
value: SymbolFinderArea (3)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x
value: 150

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3849025303538859997, guid: f3a451555dc514f46a69319857762eda,
type: 3}
propertyPath: m_BehaviorType
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f3a451555dc514f46a69319857762eda, type: 3}
--- !u!1001 &2143733088

- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_Name
value: SymbolFinderArea (12)
objectReference: {fileID: 0}
- target: {fileID: 1745841960385024, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4726744827719472, guid: f3a451555dc514f46a69319857762eda, type: 3}
propertyPath: m_LocalPosition.x

24
Project/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayCollabAgent.cs


var agentOffset = 15f;
if (isSpotter)
{
agentOffset = -15f;
agentOffset = -5f;
transform.position = new Vector3(0f + Random.Range(-3f, 3f),
1f, agentOffset + Random.Range(-5f, 5f))
// transform.position = new Vector3(0f + Random.Range(-3f, 3f),
// 1f, agentOffset + Random.Range(-5f, 5f))
// + ground.transform.position;
// transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
// Remove the randomness
transform.position = new Vector3(0f,
1f, agentOffset)
transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
transform.rotation = Quaternion.Euler(0f, 0f, 0f);
m_AgentRb.velocity *= 0f;
if (isSpotter)
{

if (selection == 0)
{
symbolO.transform.position =
new Vector3(0f + Random.Range(-3f, 3f), 2f, blockOffset + Random.Range(-5f, 5f))
new Vector3(0f, 2f, blockOffset)
+ ground.transform.position;
symbolX.transform.position =
new Vector3(0f, -1000f, blockOffset + Random.Range(-5f, 5f))

new Vector3(0f, -1000f, blockOffset + Random.Range(-5f, 5f))
+ ground.transform.position;
symbolX.transform.position =
new Vector3(0f, 2f, blockOffset + Random.Range(-5f, 5f))
new Vector3(0f, 2f, blockOffset)
+ ground.transform.position;
}

public override void OnActionReceived(ActionBuffers actionBuffers)
{
AddReward(-1f / MaxStep);
MoveAgent(actionBuffers.DiscreteActions);
if (!isSpotter)
{
MoveAgent(actionBuffers.DiscreteActions);
}
int comm_act = actionBuffers.DiscreteActions[1];
teammate.tellAgent(comm_act);
// if (isSpotter) // Test

正在加载...
取消
保存