浏览代码

running cubewar

/asymm-envs
Andrew Cohen 5 年前
当前提交
33458d24
共有 8 个文件被更改,包括 23 次插入31 次删除
  1. 1
      Project/Assets/ML-Agents/Examples/CubeWars/Prefabs/CubeWarArea.prefab
  2. 16
      Project/Assets/ML-Agents/Examples/CubeWars/Prefabs/SmallAgent.prefab
  3. 2
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/CubeWarArea.cs
  4. 3
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/CubeWarSettings.cs
  5. 11
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/LargeCubeAgent.cs
  6. 12
      Project/Assets/ML-Agents/Examples/CubeWars/Scripts/SmallCubeAgent.cs
  7. 7
      config/ppo/CubeWar.yaml
  8. 2
      config/ppo/SoccerTwos.yaml

1
Project/Assets/ML-Agents/Examples/CubeWars/Prefabs/CubeWarArea.prefab


m_DetectableTags:
- StrongSmallAgent
- WeakSmallAgent
- DeadSmallAgent
- wall
m_RaysPerDirection: 20
m_MaxRayDegrees: 180

16
Project/Assets/ML-Agents/Examples/CubeWars/Prefabs/SmallAgent.prefab


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

m_DetectableTags:
- StrongSmallAgent
- WeakSmallAgent
- DeadSmallAgent
- wall
- StrongLargeAgent
- WeakLargeAgent

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

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
maxStep: 3000
MaxStep: 0
area: {fileID: 0}
largeAgent: {fileID: 0}
turnSpeed: 300

- target: {fileID: 123071959092199671, guid: d40a32b30361e40b49d59bdfbbdb2e8c,
type: 3}
propertyPath: width
value: 1
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3343439013409978073, guid: d40a32b30361e40b49d59bdfbbdb2e8c,
type: 3}

2
Project/Assets/ML-Agents/Examples/CubeWars/Scripts/CubeWarArea.cs


using UnityEngine;
using MLAgentsExamples;
using Unity.MLAgentsExamples;
public class CubeWarArea : Area
{

3
Project/Assets/ML-Agents/Examples/CubeWars/Scripts/CubeWarSettings.cs


using System;
using UnityEngine;
using UnityEngine.UI;
using MLAgents;
using MLAgents.SideChannels;
using Unity.MLAgents;
public class CubeWarSettings : MonoBehaviour
{

11
Project/Assets/ML-Agents/Examples/CubeWars/Scripts/LargeCubeAgent.cs


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

bool m_Shockwave;
float m_ShockwaveTime;
Rigidbody m_AgentRb;
float m_LaserLength;
float m_HitPoints;
// Speed of agent rotation.
public float turnSpeed;

return m_Dead;
}
public void SetLaserLengths()
{
m_LaserLength = 1f;
}
public void SetAgentScale()
{
float agentScale = 5f;

public void SetResetParameters()
{
SetLaserLengths();
SetAgentScale();
}
}

12
Project/Assets/ML-Agents/Examples/CubeWars/Scripts/SmallCubeAgent.cs


using UnityEngine;
using MLAgents;
using MLAgents.Sensors;
using MLAgents.SideChannels;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;
public class SmallCubeAgent : Agent
{

bool m_Shoot;
float m_ShootTime;
Rigidbody m_AgentRb;
float m_LaserLength;
float m_HitPoints;
// Speed of agent rotation.
public float turnSpeed;

return m_Dead;
}
public void SetLaserLengths()
{
m_LaserLength = 1f;
}
public void SetAgentScale()
{
float agentScale = 1f;

public void SetResetParameters()
{
SetLaserLengths();
SetAgentScale();
}
}

7
config/ppo/CubeWar.yaml


save_steps: 50000
swap_steps: 15000
team_change: 200000
curriculum:
measure: progress
thresholds: [0.025, 0.05]
min_lesson_length: 100
signal_smoothing: true
parameters:
bonus: [1.0, 0.5, 0.0]
LargeCubeSoldier:
trainer: ppo

2
config/ppo/SoccerTwos.yaml


team_change: 200000
curriculum:
measure: progress
thresholds: [0.05, 0.1]
thresholds: [0.025, 0.05]
min_lesson_length: 100
signal_smoothing: true
parameters:
正在加载...
取消
保存