1 using System.Collections.Generic;
6 namespace droid.Runtime.Prototyping.Sensors.Grid {
10 [AddComponentMenu(SensorComponentMenuPath._ComponentMenuPath
12 + SensorComponentMenuPath._Postfix)]
24 [Header(
"Observation", order = 103)]
26 float _observation_value;
28 [SerializeField]
Space1 _observation_value_space;
29 [SerializeField]
int _width = 0;
33 public override string PrototypingTypeName {
get {
return "Value"; } }
37 public float ObservationValue {
38 get {
return this._observation_value; }
46 public Space1 SingleSpace {
get {
return this._observation_value_space; } }
49 this._grid =
new int[this._width, this._height];
52 for (var i = 0; i < this._width; i++) {
53 for (var j = 0; j < this._height; j++) {
54 this._grid[i, j] = k++;
59 public override IEnumerable<float> FloatEnumerable {
get {
return new[] {this.ObservationValue}; } }
62 var position = this.transform.position;
63 var x = position.x + this._width;
64 var z = position.z + this._height;
66 this.ObservationValue = this._grid[(int)x, (
int)z];
float ClipNormaliseRound(float v)
override void UpdateObservation()