|
|
|
|
|
|
|
|
|
|
sensor.AddObservation(goal.transform.localPosition); |
|
|
|
sensor.AddObservation(hand.transform.localPosition); |
|
|
|
|
|
|
|
|
|
|
|
sensor.AddObservation(m_GoalSpeed); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
var torqueZ = Mathf.Clamp(vectorAction[1], -1f, 1f) * 150f; |
|
|
|
m_RbA.AddTorque(new Vector3(torqueX, 0f, torqueZ)); |
|
|
|
|
|
|
|
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ)); |
|
|
|
|
|
|
|
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ)); |
|
|
|
AddReward( - 0.005f * (vectorAction[0] * vectorAction[0] |
|
|
|
+ vectorAction[1] * vectorAction[1] |
|
|
|
+ vectorAction[2] * vectorAction[2] |
|
|
|
+ vectorAction[3] * vectorAction[3] |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|