浏览代码

Fix episode ending

/develop/collab-envs-exp-ervin
Ervin Teng 4 年前
当前提交
14fd1b74
共有 2 个文件被更改,包括 11 次插入33 次删除
  1. 32
      Project/Assets/ML-Agents/Examples/PushBlock/Scenes/1ZombieVs2AgentsPushBlock.unity
  2. 12
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs

32
Project/Assets/ML-Agents/Examples/PushBlock/Scenes/1ZombieVs2AgentsPushBlock.unity


m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!1 &271453778
GameObject:

m_BehaviorType: 2
m_BehaviorName:
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 2
m_BehaviorName:
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 2
m_BehaviorName:
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &897538731
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 2
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &1364603546
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 3
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &1632614511
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 2
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &1903542480
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 1
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &2112390553
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 1
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!114 &2117505560
MonoBehaviour:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 3
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 5000
MaxStep: 0
useVectorObs: 1
--- !u!1 &1500989827241484
GameObject:

m_BehaviorType: 0
m_BehaviorName: PushBlock
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

m_BehaviorType: 2
m_BehaviorName:
TeamId: 0
GroupId: 0
m_UseChildSensors: 1
m_UseChildActuators: 1
m_ObservableAttributeHandling: 0

12
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs


m_ResetTimer += 1;
if (m_ResetTimer > MaxEnvironmentSteps)
{
m_AgentGroup.GroupEpisodeInterrupted();
ResetScene();
}
}

// col.gameObject.SetActive(false);
//Give Agent Rewards
m_AgentGroup.AddGroupReward(score);
m_AgentGroup.AddGroupReward(score);
if (item.Agent.gameObject.activeInHierarchy)
{
print($"{item.Agent.name} scored");

// if (done)
// {
//Reset assets
m_AgentGroup.EndGroupEpisode();
ResetScene();
// }
}

area.transform.Rotate(new Vector3(0f, rotationAngle, 0f));
//End Episode
foreach (var item in AgentsList)
{
if (!item.Agent)
{
return;
}
item.Agent.EndEpisode();
}
//Reset Agents
foreach (var item in AgentsList)
{

正在加载...
取消
保存