Skip to content

Commit

Permalink
tuple support
Browse files Browse the repository at this point in the history
  • Loading branch information
wduguay-air committed Apr 3, 2024
1 parent 31bf263 commit 1646eb9
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 86 deletions.
29 changes: 7 additions & 22 deletions cogment_lab/generated/cog_settings.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# Copyright 2024 AI Redefined Inc. <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from types import SimpleNamespace

import cogment as _cog
from types import SimpleNamespace

import cogment_lab.generated.data_pb2 as data_pb
import cogment_lab.generated.ndarray_pb2 as ndarray_pb
import cogment_lab.generated.spaces_pb2 as spaces_pb

import cogment_lab.generated.data_pb2 as data_pb

_player_class = _cog.actor.ActorClass(
name="player",
config_type=data_pb.AgentConfig,
action_space=data_pb.PlayerAction,
observation_space=data_pb.Observation,
)
name="player",
config_type=data_pb.AgentConfig,
action_space=data_pb.PlayerAction,
observation_space=data_pb.Observation,
)


actor_classes = _cog.actor.ActorClassList(_player_class)
Expand Down
105 changes: 86 additions & 19 deletions cogment_lab/generated/data_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 24 additions & 19 deletions cogment_lab/generated/ndarray_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 96 additions & 24 deletions cogment_lab/generated/spaces_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion cogment_lab/protos/spaces.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ message Dict {
repeated SubSpace spaces = 1;
}

message Tuple {
message SubSpace {
Space space = 1;
}
repeated SubSpace spaces = 2;
}

message Text {
int32 max_length = 1;
int32 min_length = 2;
Expand All @@ -57,6 +64,8 @@ message Space {
Dict dict = 3;
MultiBinary multi_binary = 4;
MultiDiscrete multi_discrete = 5;
Text text = 6;
Tuple tuple = 6;
Text text = 7;
}
}

Loading

0 comments on commit 1646eb9

Please sign in to comment.