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