Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Gymnasium Tuple Space #20

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions cogment_lab/generated/cog_settings.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Copyright 2024 AI Redefined Inc. <[email protected]>
#
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this was removed by pre-commit...

# 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
Expand All @@ -22,11 +8,11 @@


_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
102 changes: 85 additions & 17 deletions cogment_lab/generated/data_pb2.py

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

40 changes: 23 additions & 17 deletions cogment_lab/generated/ndarray_pb2.py

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

117 changes: 95 additions & 22 deletions cogment_lab/generated/spaces_pb2.py

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

10 changes: 9 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,7 @@ message Space {
Dict dict = 3;
MultiBinary multi_binary = 4;
MultiDiscrete multi_discrete = 5;
Text text = 6;
Tuple tuple = 6;
Text text = 7;
}
}
Loading
Loading