internal void SetRayPerceptionInput(RayPerceptionInput rayInput) { // Note that change the number of rays or tags doesn't directly call this, // but changing them and then changing another field will. if (m_RayPerceptionInput.OutputSize() != rayInput.OutputSize()) { Debug.Log( "Changing the number of tags or rays at runtime is not " + "supported and may cause errors in training or inference." ); // Changing the shape will probably break things downstream, but we can at least // keep this consistent. SetNumObservations(rayInput.OutputSize()); } m_RayPerceptionInput = rayInput; }
/// <summary> /// Creates the RayPerceptionSensor. /// </summary> /// <param name="name">The name of the sensor.</param> /// <param name="rayInput">The inputs for the sensor.</param> public RayPerceptionSensor(string name, RayPerceptionInput rayInput) { m_Name = name; m_RayPerceptionInput = rayInput; SetNumObservations(rayInput.OutputSize()); if (Application.isEditor) { m_DebugDisplayInfo = new DebugDisplayInfo(); } }
/// <summary> /// Creates the RayPerceptionSensor. /// </summary> /// <param name="name">The name of the sensor.</param> /// <param name="rayInput">The inputs for the sensor.</param> public RayPerceptionSensor(string name, RayPerceptionInput rayInput) { var numObservations = rayInput.OutputSize(); m_Shape = new[] { numObservations }; m_Name = name; m_RayPerceptionInput = rayInput; m_Observations = new float[numObservations]; if (Application.isEditor) { m_DebugDisplayInfo = new DebugDisplayInfo(); } }