Download com.unity.ml-agents/Runtime/Sensors/Reflection/IntReflectionSensor.cs from ashish2244/ppo-SnowballTarget: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/com.unity.ml-agents/Runtime/Sensors/Reflection/IntReflectionSensor.cs
- Command line
-
hf download hf://ashish2244/ppo-SnowballTarget/com.unity.ml-agents/Runtime/Sensors/Reflection/IntReflectionSensor.cs
-
curl -L -o IntReflectionSensor.cs https://huggingface.co/ashish2244/ppo-SnowballTarget/resolve/main/com.unity.ml-agents/Runtime/Sensors/Reflection/IntReflectionSensor.cs
596 Bytes
| namespace Unity.MLAgents.Sensors.Reflection | |
| { | |
| /// <summary> | |
| /// Sensor that wraps an integer field or property of an object, and returns | |
| /// that as an observation. | |
| /// </summary> | |
| internal class IntReflectionSensor : ReflectionSensorBase | |
| { | |
| public IntReflectionSensor(ReflectionSensorInfo reflectionSensorInfo) | |
| : base(reflectionSensorInfo, 1) | |
| { } | |
| internal override void WriteReflectedField(ObservationWriter writer) | |
| { | |
| var intVal = (System.Int32)GetReflectedValue(); | |
| writer[0] = intVal; | |
| } | |
| } | |
| } | |