using MLAgents; using System.Collections; using System.Collections.Generic; using UnityEngine; public class CozmoAgent : Agent { public Camera renderCamera; public Academy academy; public float timeBetweenDecisionsAtInference; private float timeSinceDecision; public void FixedUpdate() { WaitTimeInference(); } private void WaitTimeInference() { if (renderCamera != null) { renderCamera.Render(); } if (!academy.GetIsInference()) { RequestDecision(); } else { if (timeSinceDecision >= timeBetweenDecisionsAtInference) { timeSinceDecision = 0f; RequestDecision(); } else { timeSinceDecision += Time.fixedDeltaTime; } } } }