|
|
|
|
|
|
public override void CollectObservations(VectorSensor sensor) |
|
|
|
{ |
|
|
|
sensor.AddObservation(System.Convert.ToInt32(m_Shoot)); |
|
|
|
sensor.AddObservation(System.Convert.ToInt32(m_Dead)); |
|
|
|
sensor.AddObservation(m_HitPoints); |
|
|
|
// Direction big agent is looking
|
|
|
|
Vector3 dirToSelf = transform.position - m_LargeAgent.transform.position; |
|
|
|
|
|
|
} |
|
|
|
else // Dead
|
|
|
|
{ |
|
|
|
AddReward(-.1f * m_Bonus); |
|
|
|
// AddReward(-.1f * m_Bonus);
|
|
|
|
EndEpisode(); |
|
|
|
gameObject.SetActive(false); |
|
|
|
gameObject.tag = "DeadSmallAgent"; |
|
|
|
myBody.GetComponentInChildren<Renderer>().material = deadMaterial; |
|
|
|
m_MyArea.AgentDied(); |
|
|
|
|
|
|
|
|
|
|
public override void OnEpisodeBegin() |
|
|
|
{ |
|
|
|
gameObject.SetActive(true); |
|
|
|
m_HitPoints = 1f; |
|
|
|
HealthStatus(); |
|
|
|
m_Dead = false; |
|
|
|