public override void OnEpisodeBegin() { if (nmoves > 0) { cmvAgMan.cmvSettings.RegisterFailure(this.nmoves); } Debug.Log($"Called OnEpisodeBegin override on {name} in {area.name} nmoves:{nmoves}"); float agentOffset = -15f; selection = Random.Range(0, 2); var xpos = 0f + Random.Range(-3f, 3f); var ypos = 1f; var zpos = agentOffset + Random.Range(-5f, 5f); transform.position = new Vector3(xpos, ypos, zpos) + ground.transform.position; transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); cmvagbod.AgentReset(); redGoal.transform.position = new Vector3(0f, 0.5f, 9f) + area.transform.position; nmoves = 0; }
public override void AgentReset() { if (nmoves > 0) { academy.RegisterFailure(this.nmoves); } //Debug.Log("AgentReset in " + area.name + " for:" + name+" nmoves:"+nmoves); float agentOffset = -15f; selection = Random.Range(0, 2); var xpos = 0f + Random.Range(-3f, 3f); var ypos = 1f; var zpos = agentOffset + Random.Range(-5f, 5f); transform.position = new Vector3(xpos, ypos, zpos) + ground.transform.position; transform.rotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); cmvagbod.AgentReset(); redGoal.transform.position = new Vector3(0f, 0.5f, 9f) + area.transform.position; nmoves = 0; }