Skip to content

Commit 82e20b7

Browse files
Renaming Goal to GoalSignal (#5190)
1 parent feba34b commit 82e20b7

File tree

8 files changed

+20
-36
lines changed

8 files changed

+20
-36
lines changed

com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects/Observation.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ static ObservationReflection() {
3535
"b25fdHlwZRgHIAEoDjIqLmNvbW11bmljYXRvcl9vYmplY3RzLk9ic2VydmF0",
3636
"aW9uVHlwZVByb3RvEgwKBG5hbWUYCCABKAkaGQoJRmxvYXREYXRhEgwKBGRh",
3737
"dGEYASADKAJCEgoQb2JzZXJ2YXRpb25fZGF0YSopChRDb21wcmVzc2lvblR5",
38-
"cGVQcm90bxIICgROT05FEAASBwoDUE5HEAEqRgoUT2JzZXJ2YXRpb25UeXBl",
39-
"UHJvdG8SCwoHREVGQVVMVBAAEggKBEdPQUwQARIKCgZSRVdBUkQQAhILCgdN",
40-
"RVNTQUdFEANCJaoCIlVuaXR5Lk1MQWdlbnRzLkNvbW11bmljYXRvck9iamVj",
41-
"dHNiBnByb3RvMw=="));
38+
"cGVQcm90bxIICgROT05FEAASBwoDUE5HEAEqQAoUT2JzZXJ2YXRpb25UeXBl",
39+
"UHJvdG8SCwoHREVGQVVMVBAAEg8KC0dPQUxfU0lHTkFMEAEiBAgCEAIiBAgD",
40+
"EANCJaoCIlVuaXR5Lk1MQWdlbnRzLkNvbW11bmljYXRvck9iamVjdHNiBnBy",
41+
"b3RvMw=="));
4242
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
4343
new pbr::FileDescriptor[] { },
4444
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Unity.MLAgents.CommunicatorObjects.CompressionTypeProto), typeof(global::Unity.MLAgents.CommunicatorObjects.ObservationTypeProto), }, new pbr::GeneratedClrTypeInfo[] {
@@ -56,9 +56,7 @@ internal enum CompressionTypeProto {
5656

5757
internal enum ObservationTypeProto {
5858
[pbr::OriginalName("DEFAULT")] Default = 0,
59-
[pbr::OriginalName("GOAL")] Goal = 1,
60-
[pbr::OriginalName("REWARD")] Reward = 2,
61-
[pbr::OriginalName("MESSAGE")] Message = 3,
59+
[pbr::OriginalName("GOAL_SIGNAL")] GoalSignal = 1,
6260
}
6361

6462
#endregion

com.unity.ml-agents/Runtime/Sensors/ISensor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public enum ObservationType
5858
/// <summary>
5959
/// Collected observations contain goal information.
6060
/// </summary>
61-
Goal = 1,
61+
GoalSignal = 1,
6262
}
6363

6464
/// <summary>

com.unity.ml-agents/Tests/Runtime/Sensor/CameraSensorTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public void TestObservationType()
5050
sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None, ObservationType.Default);
5151
spec = sensor.GetObservationSpec();
5252
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Default);
53-
sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None, ObservationType.Goal);
53+
sensor = new CameraSensor(camera, width, height, true, "TestCameraSensor", SensorCompressionType.None, ObservationType.GoalSignal);
5454
spec = sensor.GetObservationSpec();
55-
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Goal);
55+
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.GoalSignal);
5656
}
5757
}
5858
}

com.unity.ml-agents/Tests/Runtime/Sensor/VectorSensorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public void TestObservationType()
5151
sensor = new VectorSensor(1, observationType: ObservationType.Default);
5252
spec = sensor.GetObservationSpec();
5353
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Default);
54-
sensor = new VectorSensor(1, observationType: ObservationType.Goal);
54+
sensor = new VectorSensor(1, observationType: ObservationType.GoalSignal);
5555
spec = sensor.GetObservationSpec();
56-
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.Goal);
56+
Assert.AreEqual((int)spec.ObservationType, (int)ObservationType.GoalSignal);
5757
}
5858

5959
[Test]

ml-agents-envs/mlagents_envs/base_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ class ObservationType(Enum):
486486
# Observation information is generic.
487487
DEFAULT = 0
488488
# Observation contains goal information for current task.
489-
GOAL = 1
489+
GOAL_SIGNAL = 1
490490

491491

492492
class ObservationSpec(NamedTuple):

ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py

Lines changed: 4 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,9 @@ class ObservationTypeProto(builtin___int):
6464
@classmethod
6565
def items(cls) -> typing___List[typing___Tuple[builtin___str, 'ObservationTypeProto']]: ...
6666
DEFAULT = typing___cast('ObservationTypeProto', 0)
67-
GOAL = typing___cast('ObservationTypeProto', 1)
68-
REWARD = typing___cast('ObservationTypeProto', 2)
69-
MESSAGE = typing___cast('ObservationTypeProto', 3)
67+
GOAL_SIGNAL = typing___cast('ObservationTypeProto', 1)
7068
DEFAULT = typing___cast('ObservationTypeProto', 0)
71-
GOAL = typing___cast('ObservationTypeProto', 1)
72-
REWARD = typing___cast('ObservationTypeProto', 2)
73-
MESSAGE = typing___cast('ObservationTypeProto', 3)
69+
GOAL_SIGNAL = typing___cast('ObservationTypeProto', 1)
7470

7571
class ObservationProto(google___protobuf___message___Message):
7672
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...

protobuf-definitions/proto/mlagents_envs/communicator_objects/observation.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ enum CompressionTypeProto {
1010

1111
enum ObservationTypeProto {
1212
DEFAULT = 0;
13-
GOAL = 1;
14-
REWARD = 2;
15-
MESSAGE = 3;
13+
GOAL_SIGNAL = 1;
14+
reserved 2; // Reserved for potential "reward" type
15+
reserved 3; // Reserved for potential "message" type
1616
}
1717

1818
message ObservationProto {

0 commit comments

Comments
 (0)