├── .gitignore ├── .bumpversion.cfg ├── setup.py ├── .drone.yml ├── protobuf └── veinsgym.proto ├── Dockerfile ├── README.md ├── src └── veins_gym │ ├── veinsgym_pb2.pyi │ ├── __init__.py │ └── veinsgym_pb2.py ├── doc └── getting_started.md └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # virtual environment 2 | .venv 3 | 4 | # python build artifacts 5 | build 6 | dist 7 | *.egg-info 8 | -------------------------------------------------------------------------------- /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.3.3 3 | commit = True 4 | tag = True 5 | tag_name = veins_gym-{new_version} 6 | 7 | [bumpversion:file:setup.py] 8 | search = version="{current_version}" 9 | replace = version="{new_version}" 10 | 11 | [bumpversion:file:Dockerfile] 12 | search = ENV VEINSGYM_VERSION {current_version} 13 | replace = ENV VEINSGYM_VERSION {new_version} 14 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | with open("README.md", "r", encoding="utf-8") as fh: 4 | long_description = fh.read() 5 | 6 | setup( 7 | name="veins_gym", 8 | version="0.3.3", 9 | author="Dominik S. Buse", 10 | author_email="buse@ccs-labs.org", 11 | description="Reinforcement Learning-based VANET simulations", 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="https://www2.tkn.tu-berlin.de/software/veins-gym/", 15 | classifiers=[ 16 | "Programming Language :: Python :: 3", 17 | "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", 18 | "Operating System :: OS Independent", 19 | ], 20 | python_requires=">=3.6", 21 | package_dir={"": "src"}, 22 | data_files=[("protobuf", ["protobuf/veinsgym.proto"])], 23 | packages=["veins_gym"], 24 | install_requires=[ 25 | "gym", 26 | "protobuf", 27 | "zmq", 28 | ], 29 | ) 30 | -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: pipeline 3 | name: python3.7 4 | 5 | steps: 6 | - name: build 7 | image: python:3.7 8 | commands: 9 | - python setup.py sdist 10 | - python setup.py bdist_wheel 11 | - ls -l dist 12 | 13 | - name: install sdist 14 | image: python:3.7 15 | commands: 16 | - ls -l dist 17 | - pip install dist/veins_gym-*.tar.gz 18 | 19 | - name: install bdist_wheel 20 | image: python:3.7 21 | commands: 22 | - pip install dist/veins_gym-*.whl 23 | 24 | --- 25 | kind: pipeline 26 | name: python3.8 27 | 28 | steps: 29 | - name: build 30 | image: python:3.8 31 | commands: 32 | - python setup.py sdist 33 | - python setup.py bdist_wheel 34 | - ls -l dist 35 | 36 | - name: install sdist 37 | image: python:3.8 38 | commands: 39 | - ls -l dist 40 | - pip install dist/veins_gym-*.tar.gz 41 | 42 | - name: install bdist_wheel 43 | image: python:3.8 44 | commands: 45 | - pip install dist/veins_gym-*.whl 46 | 47 | --- 48 | kind: pipeline 49 | name: python3.9 50 | 51 | steps: 52 | - name: build 53 | image: python:3.9 54 | commands: 55 | - python setup.py sdist 56 | - python setup.py bdist_wheel 57 | - ls -l dist 58 | 59 | - name: install sdist 60 | image: python:3.9 61 | commands: 62 | - ls -l dist 63 | - pip install dist/veins_gym-*.tar.gz 64 | 65 | - name: install bdist_wheel 66 | image: python:3.9 67 | commands: 68 | - pip install dist/veins_gym-*.whl 69 | -------------------------------------------------------------------------------- /protobuf/veinsgym.proto: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020 Dominik S. Buse, , Max Schettler 3 | // 4 | // Documentation for these modules is at http://veins.car2x.org/ 5 | // 6 | // SPDX-License-Identifier: GPL-2.0-or-later 7 | // 8 | // This program is free software; you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation; either version 2 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | // 22 | 23 | syntax = "proto3"; 24 | 25 | package veinsgym.proto; 26 | 27 | message Request { 28 | uint64 id = 1; 29 | oneof payload { 30 | Init init = 2; 31 | Shutdown shutdown = 3; 32 | Step step = 4; 33 | } 34 | } 35 | 36 | message Reply { 37 | uint64 id = 1; 38 | oneof payload { 39 | Init init = 2; 40 | Shutdown shutdown = 3; 41 | Space action = 4; 42 | } 43 | } 44 | 45 | message Init { // allways a request 46 | string action_space_code = 1; 47 | string observation_space_code = 2; 48 | string reward_space_code = 3; 49 | } 50 | 51 | message Shutdown { // can be request or reply 52 | } 53 | 54 | message Step { 55 | Space observation = 1; 56 | Space reward = 2; 57 | } 58 | 59 | message Space { 60 | oneof value { 61 | Box box = 1; 62 | Dict dict = 2; 63 | Discrete discrete = 3; 64 | MultiBinary multi_binary = 4; 65 | MultiDiscrete multi_discrete = 5; 66 | Tuple tuple = 6; 67 | } 68 | } 69 | 70 | message Box { 71 | repeated double values = 1; 72 | } 73 | 74 | message Dict { 75 | message Item { 76 | string key = 1; 77 | Space value = 2; 78 | } 79 | 80 | repeated Item values = 1; 81 | } 82 | 83 | message Discrete { 84 | uint64 value = 1; 85 | } 86 | 87 | message MultiBinary { 88 | repeated bool values = 1; 89 | } 90 | 91 | message MultiDiscrete { 92 | repeated uint64 values = 1; 93 | } 94 | 95 | message Tuple { 96 | repeated Space values = 1; 97 | } 98 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8-buster AS builder 2 | 3 | ENV SUMO_VERSION 1_6_0 4 | ENV SUMO_HOME /opt/sumo 5 | ENV OMNET_VERSION 5.6.2 6 | ENV OMNET_HOME /opt/omnet 7 | 8 | # Install system dependencies. 9 | RUN apt-get update && apt-get -qq install \ 10 | wget \ 11 | g++ \ 12 | make \ 13 | cmake \ 14 | libxerces-c-dev \ 15 | libfox-1.6-0 libfox-1.6-dev \ 16 | libgdal-dev \ 17 | libproj-dev \ 18 | python2.7 \ 19 | swig \ 20 | bison \ 21 | flex \ 22 | libxml2-dev \ 23 | zlib1g-dev \ 24 | && rm -rf /var/lib/apt/lists/* 25 | 26 | # Build SUMO 27 | 28 | # Download and extract source code 29 | RUN cd /tmp &&\ 30 | wget -q -O /tmp/sumo.tar.gz https://github.com/eclipse/sumo/archive/v$SUMO_VERSION.tar.gz &&\ 31 | tar xzf sumo.tar.gz && \ 32 | mv sumo-$SUMO_VERSION $SUMO_HOME && \ 33 | rm sumo.tar.gz 34 | 35 | # Configure and build from source. 36 | RUN cd $SUMO_HOME &&\ 37 | sed -i 's/endif (PROJ_FOUND)/\tadd_compile_definitions(ACCEPT_USE_OF_DEPRECATED_PROJ_API_H)\n\0/' CMakeLists.txt &&\ 38 | mkdir build/cmake-build &&\ 39 | cd build/cmake-build &&\ 40 | cmake -DCMAKE_BUILD_TYPE:STRING=Release ../.. &&\ 41 | make -j$(nproc) 42 | 43 | # Build OMNeT++ 44 | 45 | # Download and extract source code 46 | RUN wget https://github.com/omnetpp/omnetpp/releases/download/omnetpp-$OMNET_VERSION/omnetpp-$OMNET_VERSION-src-core.tgz \ 47 | --referer=https://omnetpp.org/ \ 48 | --progress=dot:giga \ 49 | -O omnetpp-src-core.tgz \ 50 | && tar xf omnetpp-src-core.tgz \ 51 | && mv omnetpp-$OMNET_VERSION $OMNET_HOME \ 52 | && rm omnetpp-src-core.tgz 53 | 54 | # Configure and build from source. 55 | RUN export PATH=$OMNET_HOME/bin:$PATH \ 56 | && cd $OMNET_HOME \ 57 | && ./configure WITH_QTENV=no WITH_OSG=no WITH_OSGEARTH=no \ 58 | && make -j $(nproc) MODE=debug \ 59 | && make -j $(nproc) MODE=release \ 60 | && rm -r doc out test samples misc config.log config.status 61 | 62 | 63 | # construct final container 64 | FROM python:3.8-buster 65 | MAINTAINER Dominik S. Buse (buse@ccs-labs.org) 66 | LABEL Description="Dockerised Veins-Gym base container" 67 | 68 | ENV SUMO_VERSION 1_6_0 69 | ENV SUMO_HOME /opt/sumo 70 | ENV OMNET_VERSION 5.6.2 71 | ENV OMNET_HOME /opt/omnet 72 | ENV VEINSGYM_VERSION 0.3.3 73 | 74 | RUN apt-get update && apt-get -qq install \ 75 | libgdal20 \ 76 | libc6 \ 77 | libfox-1.6-0 \ 78 | libgcc1 \ 79 | libgdal20 \ 80 | libgl1 \ 81 | libgl2ps1.4 \ 82 | libglu1 \ 83 | libproj13 \ 84 | libstdc++6 \ 85 | libxerces-c3.2 \ 86 | libprotobuf-dev \ 87 | libzmq3-dev \ 88 | protobuf-compiler \ 89 | && rm -rf /var/lib/apt/lists/* 90 | 91 | # copy over sumo 92 | RUN mkdir -p $SUMO_HOME 93 | COPY --from=builder $SUMO_HOME/data $SUMO_HOME/data 94 | COPY --from=builder $SUMO_HOME/tools $SUMO_HOME/tools 95 | COPY --from=builder $SUMO_HOME/bin $SUMO_HOME/bin 96 | # copy in pre-compiled OMNeT++ 97 | COPY --from=builder /opt/omnet /opt/omnet 98 | 99 | # update PATH 100 | ENV PATH="$SUMO_HOME/bin:$OMNET_HOME/bin:${PATH}" 101 | 102 | # install snakemake and veins_gym via pip 103 | RUN python3 -m pip install snakemake veins_gym==$VEINSGYM_VERSION --no-cache 104 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Veins-Gym 2 | ========= 3 | 4 | Veins-Gym exports Veins simulations as Open AI Gyms. 5 | This enables the application of Reinforcement Learning algorithms to solve problems in the VANET domain, in particular popular frameworks such as Tensorflow or PyTorch. 6 | 7 | To install, simply run `pip install veins-gym` ([Veins-Gym on PyPI](https://pypi.org/project/veins-gym/)). 8 | 9 | License 10 | ------- 11 | This project is licensed under the terms of the GNU General Public License 2.0. 12 | 13 | 14 | Hints and FAQ 15 | ------------- 16 | 17 | Here are some frequent issues with Veins-Gym and its environments. 18 | 19 | Please also checkout the guide on how to build new environments in [doc/getting_started.md](https://github.com/tkn-tub/veins-gym/blob/master/doc/getting_started.md). 20 | 21 | 22 | ### Protobuf Files Out of Sync 23 | 24 | Sometimes the C++ code files generated by `protoc` get out of sync with the installed version of `libprotobuf`. 25 | This leads to errors at link-time of the environment (not veins-gym itself, which does not contain C++-code) like: 26 | ``` 27 | undefined reference to google::protobuf::internal::ParseContext::ParseMessage 28 | ``` 29 | 30 | **Solution:** 31 | Re-generate the `.pb.cc` and `.pb.h` files in the environment. 32 | 33 | * check/update the installation of `protobuf-compiler` and `libprotoc` on your system (package names may differ based on the Linux distribution) 34 | * remove the generated `src/protobuf/veinsgym.pb.h` and `src/protobuf/veinsgym.pb.cc` files (or however they may be called in the environment) 35 | * re-generate the protobuf-files by running `snakemake src/protobuf/veinsgym.pb.cc src/protobuf/veinsgym.pb.h` (adapt for the files in your environment. 36 | 37 | Also see [Issue #1 of serpentine-env](https://github.com/tkn-tub/serpentine-env/issues/1). 38 | 39 | 40 | ### Showing the (Debug) Output of Veins through the Agent 41 | 42 | Normally, Veins-Gym swallows the standard output of veins simulations started by its environments. 43 | This reduces output clutter but makes debugging harder as error messages are not visible. 44 | 45 | **Solution:** 46 | Enable veins standard output by adjusting `gym.register` when running your agent: 47 | 48 | ```python 49 | gym.register( 50 | # ... 51 | kwargs={ 52 | # ... 53 | "print_veins_stdout": True, # enable (debug) output of veins 54 | } 55 | ) 56 | ``` 57 | 58 | ### Starting Veins Simulations Separately 59 | 60 | Sometimes you want to run Veins simulations separately, e.g., with custom parameters, in a (different) container, or within a debugger. 61 | This is hard to achieve and less flexible when Veins-Gym launches the Veins simulation, as it does by default. 62 | 63 | **Solution:** 64 | Disable auto-start of Veins in your agent's environment: 65 | 66 | ```python 67 | gym.register( 68 | # ... 69 | kwargs={ 70 | # ... 71 | "run_veins": False, # do not start veins through Veins-Gym 72 | "port": 5555, # pick a port to use 73 | } 74 | ) 75 | ``` 76 | 77 | Then run your veins simulation manually, typically from a `scenario` directory, in which the `omnetpp.ini` file is located: 78 | ```bash 79 | ./run -u Cmdenv '--*.gym-connection.port=5555' 80 | ``` 81 | 82 | Make sure to use the same port there. 83 | Also, consider starting Veins first in order to avoid timeouts. 84 | 85 | 86 | ### Avoid Timeouts 87 | 88 | Veins-Gym expects a request from the Veins simulation after a certain time after `env.reset` (which may in turn have started the Veins simulation). 89 | If the Veins simulation takes a longer amount of (wall-clock) time to reach the point where the request is sent, the agent's environment may have timed out. 90 | This is intended to notify about stuck simulations, but may not work as intended if the simulation is more complex or the host' hardware is less powerful than expected. 91 | 92 | **Solution:** 93 | Increase the timeout when registering the gym environment. 94 | 95 | ```python 96 | gym.register( 97 | # ... 98 | kwargs={ 99 | # ... 100 | "timeout": 10.0, # new timeout value (in seconds) 101 | } 102 | ) 103 | ``` 104 | -------------------------------------------------------------------------------- /src/veins_gym/veinsgym_pb2.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | @generated by mypy-protobuf. Do not edit manually! 3 | isort:skip_file 4 | """ 5 | from google.protobuf.descriptor import ( 6 | Descriptor as google___protobuf___descriptor___Descriptor, 7 | FileDescriptor as google___protobuf___descriptor___FileDescriptor, 8 | ) 9 | 10 | from google.protobuf.internal.containers import ( 11 | RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, 12 | RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, 13 | ) 14 | 15 | from google.protobuf.message import ( 16 | Message as google___protobuf___message___Message, 17 | ) 18 | 19 | from typing import ( 20 | Iterable as typing___Iterable, 21 | Optional as typing___Optional, 22 | Text as typing___Text, 23 | ) 24 | 25 | from typing_extensions import ( 26 | Literal as typing_extensions___Literal, 27 | ) 28 | 29 | 30 | builtin___bool = bool 31 | builtin___bytes = bytes 32 | builtin___float = float 33 | builtin___int = int 34 | 35 | 36 | DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... 37 | 38 | class Request(google___protobuf___message___Message): 39 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 40 | id: builtin___int = ... 41 | 42 | @property 43 | def init(self) -> type___Init: ... 44 | 45 | @property 46 | def shutdown(self) -> type___Shutdown: ... 47 | 48 | @property 49 | def step(self) -> type___Step: ... 50 | 51 | def __init__(self, 52 | *, 53 | id : typing___Optional[builtin___int] = None, 54 | init : typing___Optional[type___Init] = None, 55 | shutdown : typing___Optional[type___Shutdown] = None, 56 | step : typing___Optional[type___Step] = None, 57 | ) -> None: ... 58 | def HasField(self, field_name: typing_extensions___Literal[u"init",b"init",u"payload",b"payload",u"shutdown",b"shutdown",u"step",b"step"]) -> builtin___bool: ... 59 | def ClearField(self, field_name: typing_extensions___Literal[u"id",b"id",u"init",b"init",u"payload",b"payload",u"shutdown",b"shutdown",u"step",b"step"]) -> None: ... 60 | def WhichOneof(self, oneof_group: typing_extensions___Literal[u"payload",b"payload"]) -> typing_extensions___Literal["init","shutdown","step"]: ... 61 | type___Request = Request 62 | 63 | class Reply(google___protobuf___message___Message): 64 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 65 | id: builtin___int = ... 66 | 67 | @property 68 | def init(self) -> type___Init: ... 69 | 70 | @property 71 | def shutdown(self) -> type___Shutdown: ... 72 | 73 | @property 74 | def action(self) -> type___Space: ... 75 | 76 | def __init__(self, 77 | *, 78 | id : typing___Optional[builtin___int] = None, 79 | init : typing___Optional[type___Init] = None, 80 | shutdown : typing___Optional[type___Shutdown] = None, 81 | action : typing___Optional[type___Space] = None, 82 | ) -> None: ... 83 | def HasField(self, field_name: typing_extensions___Literal[u"action",b"action",u"init",b"init",u"payload",b"payload",u"shutdown",b"shutdown"]) -> builtin___bool: ... 84 | def ClearField(self, field_name: typing_extensions___Literal[u"action",b"action",u"id",b"id",u"init",b"init",u"payload",b"payload",u"shutdown",b"shutdown"]) -> None: ... 85 | def WhichOneof(self, oneof_group: typing_extensions___Literal[u"payload",b"payload"]) -> typing_extensions___Literal["init","shutdown","action"]: ... 86 | type___Reply = Reply 87 | 88 | class Init(google___protobuf___message___Message): 89 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 90 | action_space_code: typing___Text = ... 91 | observation_space_code: typing___Text = ... 92 | reward_space_code: typing___Text = ... 93 | 94 | def __init__(self, 95 | *, 96 | action_space_code : typing___Optional[typing___Text] = None, 97 | observation_space_code : typing___Optional[typing___Text] = None, 98 | reward_space_code : typing___Optional[typing___Text] = None, 99 | ) -> None: ... 100 | def ClearField(self, field_name: typing_extensions___Literal[u"action_space_code",b"action_space_code",u"observation_space_code",b"observation_space_code",u"reward_space_code",b"reward_space_code"]) -> None: ... 101 | type___Init = Init 102 | 103 | class Shutdown(google___protobuf___message___Message): 104 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 105 | 106 | def __init__(self, 107 | ) -> None: ... 108 | type___Shutdown = Shutdown 109 | 110 | class Step(google___protobuf___message___Message): 111 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 112 | 113 | @property 114 | def observation(self) -> type___Space: ... 115 | 116 | @property 117 | def reward(self) -> type___Space: ... 118 | 119 | def __init__(self, 120 | *, 121 | observation : typing___Optional[type___Space] = None, 122 | reward : typing___Optional[type___Space] = None, 123 | ) -> None: ... 124 | def HasField(self, field_name: typing_extensions___Literal[u"observation",b"observation",u"reward",b"reward"]) -> builtin___bool: ... 125 | def ClearField(self, field_name: typing_extensions___Literal[u"observation",b"observation",u"reward",b"reward"]) -> None: ... 126 | type___Step = Step 127 | 128 | class Space(google___protobuf___message___Message): 129 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 130 | 131 | @property 132 | def box(self) -> type___Box: ... 133 | 134 | @property 135 | def dict(self) -> type___Dict: ... 136 | 137 | @property 138 | def discrete(self) -> type___Discrete: ... 139 | 140 | @property 141 | def multi_binary(self) -> type___MultiBinary: ... 142 | 143 | @property 144 | def multi_discrete(self) -> type___MultiDiscrete: ... 145 | 146 | @property 147 | def tuple(self) -> type___Tuple: ... 148 | 149 | def __init__(self, 150 | *, 151 | box : typing___Optional[type___Box] = None, 152 | dict : typing___Optional[type___Dict] = None, 153 | discrete : typing___Optional[type___Discrete] = None, 154 | multi_binary : typing___Optional[type___MultiBinary] = None, 155 | multi_discrete : typing___Optional[type___MultiDiscrete] = None, 156 | tuple : typing___Optional[type___Tuple] = None, 157 | ) -> None: ... 158 | def HasField(self, field_name: typing_extensions___Literal[u"box",b"box",u"dict",b"dict",u"discrete",b"discrete",u"multi_binary",b"multi_binary",u"multi_discrete",b"multi_discrete",u"tuple",b"tuple",u"value",b"value"]) -> builtin___bool: ... 159 | def ClearField(self, field_name: typing_extensions___Literal[u"box",b"box",u"dict",b"dict",u"discrete",b"discrete",u"multi_binary",b"multi_binary",u"multi_discrete",b"multi_discrete",u"tuple",b"tuple",u"value",b"value"]) -> None: ... 160 | def WhichOneof(self, oneof_group: typing_extensions___Literal[u"value",b"value"]) -> typing_extensions___Literal["box","dict","discrete","multi_binary","multi_discrete","tuple"]: ... 161 | type___Space = Space 162 | 163 | class Box(google___protobuf___message___Message): 164 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 165 | values: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___float] = ... 166 | 167 | def __init__(self, 168 | *, 169 | values : typing___Optional[typing___Iterable[builtin___float]] = None, 170 | ) -> None: ... 171 | def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... 172 | type___Box = Box 173 | 174 | class Dict(google___protobuf___message___Message): 175 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 176 | class Item(google___protobuf___message___Message): 177 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 178 | key: typing___Text = ... 179 | 180 | @property 181 | def value(self) -> type___Space: ... 182 | 183 | def __init__(self, 184 | *, 185 | key : typing___Optional[typing___Text] = None, 186 | value : typing___Optional[type___Space] = None, 187 | ) -> None: ... 188 | def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... 189 | def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ... 190 | type___Item = Item 191 | 192 | 193 | @property 194 | def values(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Dict.Item]: ... 195 | 196 | def __init__(self, 197 | *, 198 | values : typing___Optional[typing___Iterable[type___Dict.Item]] = None, 199 | ) -> None: ... 200 | def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... 201 | type___Dict = Dict 202 | 203 | class Discrete(google___protobuf___message___Message): 204 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 205 | value: builtin___int = ... 206 | 207 | def __init__(self, 208 | *, 209 | value : typing___Optional[builtin___int] = None, 210 | ) -> None: ... 211 | def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... 212 | type___Discrete = Discrete 213 | 214 | class MultiBinary(google___protobuf___message___Message): 215 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 216 | values: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___bool] = ... 217 | 218 | def __init__(self, 219 | *, 220 | values : typing___Optional[typing___Iterable[builtin___bool]] = None, 221 | ) -> None: ... 222 | def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... 223 | type___MultiBinary = MultiBinary 224 | 225 | class MultiDiscrete(google___protobuf___message___Message): 226 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 227 | values: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... 228 | 229 | def __init__(self, 230 | *, 231 | values : typing___Optional[typing___Iterable[builtin___int]] = None, 232 | ) -> None: ... 233 | def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... 234 | type___MultiDiscrete = MultiDiscrete 235 | 236 | class Tuple(google___protobuf___message___Message): 237 | DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... 238 | 239 | @property 240 | def values(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Space]: ... 241 | 242 | def __init__(self, 243 | *, 244 | values : typing___Optional[typing___Iterable[type___Space]] = None, 245 | ) -> None: ... 246 | def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... 247 | type___Tuple = Tuple 248 | -------------------------------------------------------------------------------- /doc/getting_started.md: -------------------------------------------------------------------------------- 1 | Getting Started with Veins-Gym 2 | ============================== 3 | 4 | This guide is intended to give you some hints on how to set up your own environments with Veins-Gym. 5 | It's a rough outline for now and assumes you have at least some knowledge of Reinforcement Learning (RL) and V2X. 6 | We will use the [serpentine-env](https://github.com/tkn-tub/serpentine-env) as an example and show how that was built. 7 | 8 | In general, you will need the following components for your own Veins-Gym environment: 9 | 10 | - a traffic scenario (in/via SUMO) 11 | - a V2X simulation experiment (in Veins / OMNeT++) 12 | - a data type description of actions, observations, and rewards (in Python / OpenAI gym shapes) 13 | - an interface to your agent (in Veins / OMNeT++) 14 | 15 | Let's go through them step by step 16 | 17 | 18 | Traffic Scenario 19 | ---------------- 20 | 21 | To simulate vehicles and their mobility, Veins (and thus Veins-Gym) uses SUMO. 22 | The definition of roads and traffic elements, such as cars, routes, and traffic lights, is done there. 23 | At the very minimum, you need: 24 | 25 | - a road network (`.net.xml` file) 26 | - a set of vehicles with routes (typically a `.rou.xml` file) 27 | - and a configuration file (`.sumo.cfg` file) 28 | 29 | The [SUMO wiki](https://sumo.dlr.de/docs/) has excellent resources on how to build these scenarios, so head there to find out more. 30 | Also note that there are many established scenarios for road traffic already. 31 | Check out or the [sss4s project](https://github.com/veins/sss4s). 32 | You should always be able to test-drive your scenario by running it in `sumo-gui` and observe what is going on. 33 | 34 | For the serpentine-env, we added these files as `scenario/serpentine.{net.xml,rou.xml,sumo.cfg}`. 35 | This is primarily a single, very curvy road on which two vehicles will drive. 36 | Both have the same route, maximum speed, and are spawned wit a little distance between them. 37 | So the `leader` will drive ahead and the `follower` will stay somewhat close behind it. 38 | 39 | There is also an alternative scenario (`scenario/lysevegen.{net.xml,rou.xml,sumo.cfg}`), but that is not important right now. 40 | Just see that the same V2X simulation code can potentially run with different traffic scenarios. 41 | 42 | 43 | V2X Simulation Experiment 44 | ------------------------- 45 | 46 | Once you have vehicles driving around in SUMO, you can start simulating wireless communication among them using Veins. 47 | With Veins, you can implement your own communication protocol and control which vehicles communicate. 48 | An V2X simulation experiment is what we call a collection of C++ code files, `.ned` OMNeT++ configuration files, and an `omnetpp.ini` file that define a simulation. 49 | It defines the communication behavior of the vehicles and everything they should do beyond driving around (the communication may even influence the driving behavior, e.g., in platooning). 50 | Typically, this means implementing an application layer, e.g. by sub-classing `veins::BaseApplLayer`. 51 | We assume you already have some experience with Veins and/or have an experiment at the ready. 52 | 53 | We suggest you develop your V2X simulation experiment without any connection to an RL agent at first. 54 | This way, you can run the simulation without the Gym-environment and an agent attached, which makes debugging much faster and easier. 55 | While there probably will be decision the agent will have to make, you can typically simplify that in the beginning. 56 | E.g., by using hard-coded or random decisions, or implementing a simple algorithm directly in Veins. 57 | 58 | For the `serpentine-env`, the simulation experiment is switching between two communication technologies to efficiently exchange messages between the `leader` and `follower`. 59 | We wrote `veins::serpentin::SerpentineApp` as a new application layer to implement simple periodic beaconing. 60 | We used a different `Car` module definition than the normal one provided by Veins, as we wanted to incorporate multiple communication technologies: 61 | Our `serpentine.Car` has a `Nic80211p` for DSRC communication and two `NicVlc`s for visible light communication, as well as a `ISplitter` module to multiplex between those. 62 | 63 | The module implementing the `ISplitter` interface is the major point of interest in the `serpentine-env`. 64 | We provided the `GymSplitter` to do this. 65 | It does also implement the interaction with the agent (which is the topic of the following sections). 66 | But it also contains the code to implement what the car should do with the decision which will be made by the agent. 67 | In short, the `GymSplitter` module receives all messages coming down the stack from the application layer. 68 | It then decides (through `GymSplitter::getAccessTechnology()`) which communication technology to use for transmission: DSRC or VLC. 69 | Then, it passes the message to the MAC layer of the selected technology stack. 70 | For development, the `GymSplitter::getAccessTechnology()` method could easily be implemented without an agent connection by only using a random communication technology. 71 | 72 | All the code specific to the `serpentine-env` experiment went into the `src/serpentine` directory, e.g., the `.cc`, `.h`, and `.ned` files. 73 | The `omnetpp.ini` file was placed next to the traffic scenario configuration in the `scenario` directory. 74 | To keep all dependencies close at hand, we added Veins directly into the repository under `lib/veins`. 75 | Note that to implement visible light communication, we also embedded `veins_vlc` under `lib/veins_vlc`. 76 | Finally, we added workflow definitions in the `Snakefile` to facilitate building both the dependencies and the `serpentine-env` experiment. 77 | 78 | 79 | Data Type Descriptions of the Interface to the Agent 80 | ---------------------------------------------------- 81 | 82 | Now that the V2X Simulation experiment is running on its own, it is time to prepare the connection to an RL agent. 83 | For that, we need to formalize the inputs and outputs of the agent: observations, rewards, and actions. 84 | The concept of [OpenAI gyms](http://gym.openai.com/) is agnostic to the specifics of how these inputs and outputs looks. 85 | It simply provides [spaces](https://github.com/openai/gym/tree/master/gym/spaces) to allow the environment to specify the data types. 86 | 87 | For Veins-Gym, the reward is currently always a single scalar `float`. 88 | The action and observation space are fully defined by the environment, though. 89 | 90 | Identify the observations and actions an agent in your environment should use. 91 | Then specify a definition of `spaces` in which the observations and actions can be encoded. 92 | 93 | If your agent produces non-trivial actions, it may be necessary to provide a serialization adapter. 94 | Simple scalars like `int`s or `float`s can be converted by Veins-Gym itself. 95 | But more complex types are not converted automatically at the moment. 96 | Instead, write a function that receives the actions from the agent and returns a `Reply` object. 97 | This function can then be passed to the Veins-Gym environment via `gym.register`: 98 | For example: 99 | 100 | ```python 101 | from veins_gym import veinsgym_pb2 102 | 103 | def serialize_action(actions): 104 | """Serialize a list of floats into an action.""" 105 | reply = veinsgym_pb2.Reply() 106 | reply.action.box.values.extend(actions) 107 | return reply.SerializeToString() 108 | 109 | gym.register( 110 | id="veins-v1", 111 | entry_point="veins_gym:VeinsEnv", 112 | "action_serializer": serialize_action, 113 | # ... 114 | ) 115 | ``` 116 | 117 | 118 | For the `serpentine-env`, the decision is to choose to send a message among any of the DSRC radio, the VLC headlight or the VLC taillight. 119 | We encoded this into a simple 3 bit bitmap, stored as a discrete number with 8 choices: `gym.spaces.Discrete(8)`. 120 | The observations are more complex: 121 | The agent receives the vector pointing from the `follower` to the `leader` vehicle and the angle of impact of that vector on the back of the `leader`. 122 | Both of these values are encoded as two-dimensional vectors `float`s. 123 | The value of the distance vector is unbounded, while the angle (implemented as a heading vector) is normalized to -1 to 1. 124 | So we encoded these observations into a `Box` (vector) of 4 floats with embedded limits: `gym.spaces.Box(low=np.array([-np.inf, -np.inf, -1, -1], dtype=np.float32), high=np.array([np.inf, np.inf, 1, 1], dtype=np.float32))`. 125 | 126 | 127 | Experiment to Agent Interface 128 | ----------------------------- 129 | 130 | With the specification done, the last step is to implement the code in Veins that will communicate with the agent in the OpenAI environment (the Python script that also controls the agent). 131 | Whenever a decision from the agent is required in the simulation experiment, observations have to be gathered and sent to the OpenAI environment. 132 | Alongside, the reward for the last action performed should be included for training. 133 | The agent will decide on an action and send that back to the Veins simulation, which in turn needs to be unpacked and fed back into the simulation behavior. 134 | 135 | A useful tool for this is the `GymConnection` module available in the `serpentine-env` release: . 136 | It can take care of connecting to the environment via a ZeroMQ socket. 137 | To the simulation, it provides the `GymConnection::communicate` method, that gets passed a `Request` and returns the `Reply` of the agent. 138 | Simply add a `GymConnection` module to your OMNeT++ scenario `.ned` file or somewhere else in the simulation. 139 | The data type definitions of the observations and actions are simply passed as configuration to the `GymConnection` in the `omnetpp.ini` ([example](https://github.com/tkn-tub/serpentine-env/blob/master/scenario/omnetpp.ini#L129)). 140 | The `GymConnection` then takes care of transmitting this to the OpenAI environment via the first message upon connection. 141 | 142 | Veins-Gym uses [Google Protocol Buffers](https://developers.google.com/protocol-buffers/) for data serialization. 143 | The [source `veinsgym.proto` file](https://github.com/tkn-tub/veins-gym/blob/master/protobuf/veinsgym.proto) is shipped with `Veins-Gym` and can be compiled to C++ using `protoc`. 144 | It implements the complete set of [OpenAI Gym spaces](https://github.com/openai/gym/tree/master/gym/spaces), so no manual serialization is needed. 145 | 146 | To communicate with the agent from the simulation then, construct and fill a `veinsgym::proto::Request` object, pass it to `GymConnection::communicate`, and process the returned `veinsgym::proto::Reply`. 147 | Filling `Request` objects can be done dynamically by setting its `step.observation` and `step.reward`. 148 | Access typically takes place via the `mutable_()` accessors and `Add()` methods for adding array values. 149 | Just make sure that the resulting structure matches the data type description specified in the previous section. 150 | 151 | For the `serpentine-env`, the agent is asked for a decision every time the `follower` wants to send a message. 152 | The observation contains the relative positions of the `leader` and the `follower` as described above. 153 | And the reward is computed from the success of the last communication and some cost based on the technologies used. 154 | To implement this, we first collect the reward and observation form the simulation in the `GymSplitter` module. 155 | The `computeReward` and `computeObservation` methods encapsulate this and return easy to handle native C++ values. 156 | Then, we construct a `Request` object via the `GymSplitter::serializeObservation` method: 157 | On a new `Request` object, a `Box` is created for the observation, and the contents of the passed observation array are copied into its `mutable_values()`. 158 | For the reward, we also simply create a `Box` and add one value, which we set to the scalar reward passed into the function. 159 | The value (an `int`) of the received `Response` of the agent is then extracted, converted into the internal `enum` and used for the selection of the corresponding technology stack. 160 | 161 | 162 | Conclusion 163 | ---------- 164 | 165 | With these parts in place, you should be able to set up your agent and start training. 166 | 167 | If you want to share your own environment, please contact us so we can add a link to the Veins-Gym docs. 168 | Veins, Veins-Gym and the example `serpentine-env` are released under the GNU General Public License 2.0, so they can be incorporated easily into your open-source projects. 169 | -------------------------------------------------------------------------------- /src/veins_gym/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020 Dominik S. Buse, , Max Schettler 3 | # 4 | # Documentation for these modules is at http://veins.car2x.org/ 5 | # 6 | # SPDX-License-Identifier: GPL-2.0-or-later 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | # 22 | 23 | """ 24 | Veins-Gym base structures to create gym environments from veins simulations. 25 | """ 26 | 27 | import atexit 28 | import logging 29 | import os 30 | import signal 31 | import subprocess 32 | import sys 33 | from typing import Any, Dict, NamedTuple 34 | 35 | import gym 36 | import numpy as np 37 | import zmq 38 | from gym import error, spaces, utils 39 | from gym.utils import seeding 40 | 41 | from . import veinsgym_pb2 42 | 43 | SENTINEL_EMPTY_SPACE = gym.spaces.Space() 44 | 45 | 46 | class StepResult(NamedTuple): 47 | """Result record from one step in the invironment.""" 48 | 49 | observation: Any 50 | reward: np.float32 51 | done: bool 52 | info: Dict 53 | 54 | 55 | def ensure_valid_scenario_dir(scenario_dir): 56 | """ 57 | Raise an exception if path is not a valid scenario directory. 58 | """ 59 | if scenario_dir is None: 60 | raise ValueError("No scenario_dir given.") 61 | if not os.path.isdir(scenario_dir): 62 | raise ValueError("The scenario_dir does not point to a directory.") 63 | if not os.path.exists(os.path.join(scenario_dir, "omnetpp.ini")): 64 | raise FileNotFoundError( 65 | "The scenario_dir needs to contain an omnetpp.ini file." 66 | ) 67 | return True 68 | 69 | 70 | def launch_veins( 71 | scenario_dir, 72 | seed, 73 | port, 74 | print_stdout=False, 75 | extra_args=None, 76 | user_interface="Cmdenv", 77 | config="General", 78 | ): 79 | """ 80 | Launch a veins experiment and return the process instance. 81 | 82 | All extra_args keys need to contain their own -- prefix. 83 | The respective values need to be correctly quouted. 84 | """ 85 | command = [ 86 | "./run", 87 | f"-u{user_interface}", 88 | f"-c{config}", 89 | f"--seed-set={seed}", 90 | f"--*.manager.seed={seed}", 91 | f"--*.gym_connection.port={port}", 92 | ] 93 | extra_args = dict() if extra_args is None else extra_args 94 | for key, value in extra_args.items(): 95 | command.append(f"{key}={value}") 96 | logging.debug("Launching veins experiment using command `%s`", command) 97 | stdout = sys.stdout if print_stdout else subprocess.DEVNULL 98 | process = subprocess.Popen(command, stdout=stdout, cwd=scenario_dir) 99 | logging.debug("Veins process launched with pid %d", process.pid) 100 | return process 101 | 102 | 103 | def shutdown_veins(process, gracetime_s=1.0): 104 | """ 105 | Shut down veins if it still runs. 106 | """ 107 | process.poll() 108 | if process.poll() is not None: 109 | logging.debug( 110 | "Veins process %d was shut down already with returncode %d.", 111 | process.pid, 112 | process.returncode, 113 | ) 114 | return 115 | process.terminate() 116 | try: 117 | process.wait(gracetime_s) 118 | except subprocess.TimeoutExpired as _exc: 119 | logging.warning( 120 | "Veins process %d did not shut down gracefully, sennding kill.", 121 | process.pid, 122 | ) 123 | process.kill() 124 | try: 125 | process.wait(gracetime_s) 126 | except subprocess.TimeoutExpired as _exc2: 127 | logging.error( 128 | "Veins process %d could not even be killed!", process.pid 129 | ) 130 | assert ( 131 | process.poll() and process.returncode is not None 132 | ), "Veins could not be killed." 133 | 134 | 135 | def serialize_action_discete(action): 136 | """Serialize a single discrete action into protobuf wire format.""" 137 | reply = veinsgym_pb2.Reply() 138 | reply.action.discrete.value = action 139 | return reply.SerializeToString() 140 | 141 | 142 | def parse_space(space): 143 | """Parse a Gym.spaces.Space from a protobuf request into python types.""" 144 | if space.HasField("discrete"): 145 | return space.discrete.value 146 | if space.HasField("box"): 147 | return np.array(space.box.values, dtype=np.float32) 148 | if space.HasField("multi_discrete"): 149 | return np.array(space.multi_discrete.values, dtype=int) 150 | if space.HasField("multi_binary"): 151 | return np.array(space.multi_binary.values, dtype=bool) 152 | if space.HasField("tuple"): 153 | return tuple(parse_space(subspace) for subspace in space.tuple.values) 154 | if space.HasField("dict"): 155 | return { 156 | item.key: parse_space(item.space) for item in space.dict.values 157 | } 158 | raise RuntimeError("Unknown space type") 159 | 160 | 161 | class VeinsEnv(gym.Env): 162 | metadata = {"render.modes": []} 163 | 164 | default_scenario_dir = None 165 | """ 166 | Default scenario_dir argument for constructor. 167 | """ 168 | 169 | def __init__( 170 | self, 171 | scenario_dir=None, 172 | run_veins=True, 173 | port=None, 174 | timeout=3.0, 175 | print_veins_stdout=False, 176 | action_serializer=serialize_action_discete, 177 | veins_kwargs=None, 178 | user_interface="Cmdenv", 179 | config="General", 180 | ): 181 | if scenario_dir is None: 182 | scenario_dir = self.default_scenario_dir 183 | assert ensure_valid_scenario_dir(scenario_dir) 184 | self.scenario_dir = scenario_dir 185 | self._action_serializer = action_serializer 186 | 187 | self.action_space = SENTINEL_EMPTY_SPACE 188 | self.observation_space = SENTINEL_EMPTY_SPACE 189 | 190 | self.context = zmq.Context() 191 | self.socket = self.context.socket(zmq.REP) 192 | self.port = port 193 | self.bound_port = None 194 | self._timeout = timeout 195 | self.print_veins_stdout = print_veins_stdout 196 | 197 | self.run_veins = run_veins 198 | self._passed_args = ( 199 | veins_kwargs if veins_kwargs is not None else dict() 200 | ) 201 | self._user_interface = user_interface 202 | self._config = config 203 | self._seed = 0 204 | self.veins = None 205 | self._veins_shutdown_handler = None 206 | 207 | def __enter__(self): 208 | return self 209 | 210 | def __exit__(self, exc_type, exc_value, exc_traceback): 211 | self.close() 212 | 213 | # Gym Env interface 214 | 215 | def step(self, action): 216 | """ 217 | Run one timestep of the environment's dynamics. 218 | """ 219 | self.socket.send(self._action_serializer(action)) 220 | step_result = self._parse_request(self._recv_request()) 221 | if step_result.done: 222 | self.socket.send( 223 | self._action_serializer(self.action_space.sample()) 224 | ) 225 | logging.debug("Episode ended") 226 | if self.veins: 227 | logging.debug("Waiting for veins to finish") 228 | self.veins.wait() 229 | assert self.observation_space.contains(step_result.observation) 230 | return step_result 231 | 232 | def reset(self): 233 | """ 234 | Start and connect to a new veins experiment, return first observation. 235 | 236 | Shut down exisiting veins experiment processes and connections. 237 | Waits until first request from veins experiment has been received. 238 | """ 239 | self.close() 240 | self.socket = self.context.socket(zmq.REP) 241 | if self.port is None: 242 | self.bound_port = self.socket.bind_to_random_port( 243 | "tcp://127.0.0.1" 244 | ) 245 | logging.debug("Listening on random port %d", self.bound_port) 246 | else: 247 | self.socket.bind(f"tcp://127.0.0.1:{self.port}") 248 | self.bound_port = self.port 249 | logging.debug("Listening on configured port %d", self.bound_port) 250 | 251 | if self.run_veins: 252 | self.veins = launch_veins( 253 | self.scenario_dir, 254 | self._seed, 255 | self.bound_port, 256 | self.print_veins_stdout, 257 | self._passed_args, 258 | self._user_interface, 259 | self._config, 260 | ) 261 | logging.info("Launched veins experiment, waiting for request.") 262 | 263 | def veins_shutdown_handler(signum=None, stackframe=None): 264 | """ 265 | Ensure that veins always gets shut down on python exit. 266 | 267 | This is implemented as a local function on purpose. 268 | There could be more than one VeinsEnv in one python process. 269 | So calling atexit.unregister(shutdown_veins) could cause leaks. 270 | """ 271 | shutdown_veins(self.veins) 272 | if signum is not None: 273 | sys.exit() 274 | 275 | atexit.register(veins_shutdown_handler) 276 | signal.signal(signal.SIGTERM, veins_shutdown_handler) 277 | self._veins_shutdown_handler = veins_shutdown_handler 278 | 279 | initial_request = self._parse_request(self._recv_request())[0] 280 | logging.info("Received first request from Veins, ready to run.") 281 | return initial_request 282 | 283 | def render(self, mode="human"): 284 | """ 285 | Render current environment (not supported by VeinsEnv right now). 286 | """ 287 | raise NotImplementedError( 288 | "Rendering is not implemented for this VeinsGym" 289 | ) 290 | 291 | def close(self): 292 | """ 293 | Close the episode and shut down veins scenario and connection. 294 | """ 295 | logging.info("Closing VeinsEnv.") 296 | if self._veins_shutdown_handler is not None: 297 | atexit.unregister(self._veins_shutdown_handler) 298 | 299 | if self.veins: 300 | # TODO: send shutdown message (which needs to be implemted in veins code) 301 | shutdown_veins(self.veins) 302 | self.veins = None 303 | 304 | if self.bound_port: 305 | logging.debug("Closing VeinsEnv server socket.") 306 | self.socket.unbind(f"tcp://127.0.0.1:{self.bound_port}") 307 | self.socket.close() 308 | self.socket = None 309 | self.bound_port = None 310 | self.veins = None 311 | 312 | def seed(self, seed=None): 313 | """ 314 | Set and return seed for the next episode. 315 | 316 | Will generate a random seed if None is passed. 317 | """ 318 | if seed is not None: 319 | logging.debug("Setting given seed %d", seed) 320 | self._seed = seed 321 | else: 322 | random_seed = gym.utils.seeding.create_seed(max_bytes=4) 323 | logging.debug("Setting random seed %d", random_seed) 324 | self._seed = seed 325 | return [self._seed] 326 | 327 | # Internal helpers 328 | 329 | def _recv_request(self): 330 | rlist, _, _ = zmq.select([self.socket], [], [], timeout=self._timeout) 331 | if not rlist: 332 | logging.error( 333 | "Veins instance with PID %d timed out after %.2f seconds", 334 | self.veins.pid, 335 | self._timeout, 336 | ) 337 | raise TimeoutError( 338 | f"Veins instance did not send a request within {self._timeout}" 339 | " seconds" 340 | ) 341 | assert rlist == [self.socket] 342 | return self.socket.recv() 343 | 344 | def _parse_request(self, data): 345 | request = veinsgym_pb2.Request() 346 | request.ParseFromString(data) 347 | if request.HasField("shutdown"): 348 | return StepResult(self.observation_space.sample(), 0.0, True, {}) 349 | if request.HasField("init"): 350 | # parse spaces 351 | self.action_space = eval(request.init.action_space_code) 352 | self.observation_space = eval(request.init.observation_space_code) 353 | # sent empty reply 354 | init_msg = veinsgym_pb2.Reply() 355 | self.socket.send(init_msg.SerializeToString()) 356 | # request next request (actual request with content) 357 | real_data = self._recv_request() 358 | real_request = veinsgym_pb2.Request() 359 | real_request.ParseFromString(real_data) 360 | # continue processing the real request 361 | request = real_request 362 | # the gym needs to be initialized at this point! 363 | assert self.action_space is not SENTINEL_EMPTY_SPACE 364 | assert self.observation_space is not SENTINEL_EMPTY_SPACE 365 | observation = parse_space(request.step.observation) 366 | reward = parse_space(request.step.reward) 367 | assert len(reward) == 1 368 | return StepResult(observation, reward[0], False, {}) 369 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /src/veins_gym/veinsgym_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: veinsgym.proto 4 | """Generated protocol buffer code.""" 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | 15 | 16 | DESCRIPTOR = _descriptor.FileDescriptor( 17 | name='veinsgym.proto', 18 | package='veinsgym.proto', 19 | syntax='proto3', 20 | serialized_options=None, 21 | create_key=_descriptor._internal_create_key, 22 | serialized_pb=b'\n\x0eveinsgym.proto\x12\x0eveinsgym.proto\"\x9a\x01\n\x07Request\x12\n\n\x02id\x18\x01 \x01(\x04\x12$\n\x04init\x18\x02 \x01(\x0b\x32\x14.veinsgym.proto.InitH\x00\x12,\n\x08shutdown\x18\x03 \x01(\x0b\x32\x18.veinsgym.proto.ShutdownH\x00\x12$\n\x04step\x18\x04 \x01(\x0b\x32\x14.veinsgym.proto.StepH\x00\x42\t\n\x07payload\"\x9b\x01\n\x05Reply\x12\n\n\x02id\x18\x01 \x01(\x04\x12$\n\x04init\x18\x02 \x01(\x0b\x32\x14.veinsgym.proto.InitH\x00\x12,\n\x08shutdown\x18\x03 \x01(\x0b\x32\x18.veinsgym.proto.ShutdownH\x00\x12\'\n\x06\x61\x63tion\x18\x04 \x01(\x0b\x32\x15.veinsgym.proto.SpaceH\x00\x42\t\n\x07payload\"\\\n\x04Init\x12\x19\n\x11\x61\x63tion_space_code\x18\x01 \x01(\t\x12\x1e\n\x16observation_space_code\x18\x02 \x01(\t\x12\x19\n\x11reward_space_code\x18\x03 \x01(\t\"\n\n\x08Shutdown\"Y\n\x04Step\x12*\n\x0bobservation\x18\x01 \x01(\x0b\x32\x15.veinsgym.proto.Space\x12%\n\x06reward\x18\x02 \x01(\x0b\x32\x15.veinsgym.proto.Space\"\x9e\x02\n\x05Space\x12\"\n\x03\x62ox\x18\x01 \x01(\x0b\x32\x13.veinsgym.proto.BoxH\x00\x12$\n\x04\x64ict\x18\x02 \x01(\x0b\x32\x14.veinsgym.proto.DictH\x00\x12,\n\x08\x64iscrete\x18\x03 \x01(\x0b\x32\x18.veinsgym.proto.DiscreteH\x00\x12\x33\n\x0cmulti_binary\x18\x04 \x01(\x0b\x32\x1b.veinsgym.proto.MultiBinaryH\x00\x12\x37\n\x0emulti_discrete\x18\x05 \x01(\x0b\x32\x1d.veinsgym.proto.MultiDiscreteH\x00\x12&\n\x05tuple\x18\x06 \x01(\x0b\x32\x15.veinsgym.proto.TupleH\x00\x42\x07\n\x05value\"\x15\n\x03\x42ox\x12\x0e\n\x06values\x18\x01 \x03(\x01\"l\n\x04\x44ict\x12)\n\x06values\x18\x01 \x03(\x0b\x32\x19.veinsgym.proto.Dict.Item\x1a\x39\n\x04Item\x12\x0b\n\x03key\x18\x01 \x01(\t\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.veinsgym.proto.Space\"\x19\n\x08\x44iscrete\x12\r\n\x05value\x18\x01 \x01(\x04\"\x1d\n\x0bMultiBinary\x12\x0e\n\x06values\x18\x01 \x03(\x08\"\x1f\n\rMultiDiscrete\x12\x0e\n\x06values\x18\x01 \x03(\x04\".\n\x05Tuple\x12%\n\x06values\x18\x01 \x03(\x0b\x32\x15.veinsgym.proto.Spaceb\x06proto3' 23 | ) 24 | 25 | 26 | 27 | 28 | _REQUEST = _descriptor.Descriptor( 29 | name='Request', 30 | full_name='veinsgym.proto.Request', 31 | filename=None, 32 | file=DESCRIPTOR, 33 | containing_type=None, 34 | create_key=_descriptor._internal_create_key, 35 | fields=[ 36 | _descriptor.FieldDescriptor( 37 | name='id', full_name='veinsgym.proto.Request.id', index=0, 38 | number=1, type=4, cpp_type=4, label=1, 39 | has_default_value=False, default_value=0, 40 | message_type=None, enum_type=None, containing_type=None, 41 | is_extension=False, extension_scope=None, 42 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 43 | _descriptor.FieldDescriptor( 44 | name='init', full_name='veinsgym.proto.Request.init', index=1, 45 | number=2, type=11, cpp_type=10, label=1, 46 | has_default_value=False, default_value=None, 47 | message_type=None, enum_type=None, containing_type=None, 48 | is_extension=False, extension_scope=None, 49 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 50 | _descriptor.FieldDescriptor( 51 | name='shutdown', full_name='veinsgym.proto.Request.shutdown', index=2, 52 | number=3, type=11, cpp_type=10, label=1, 53 | has_default_value=False, default_value=None, 54 | message_type=None, enum_type=None, containing_type=None, 55 | is_extension=False, extension_scope=None, 56 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 57 | _descriptor.FieldDescriptor( 58 | name='step', full_name='veinsgym.proto.Request.step', index=3, 59 | number=4, type=11, cpp_type=10, label=1, 60 | has_default_value=False, default_value=None, 61 | message_type=None, enum_type=None, containing_type=None, 62 | is_extension=False, extension_scope=None, 63 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 64 | ], 65 | extensions=[ 66 | ], 67 | nested_types=[], 68 | enum_types=[ 69 | ], 70 | serialized_options=None, 71 | is_extendable=False, 72 | syntax='proto3', 73 | extension_ranges=[], 74 | oneofs=[ 75 | _descriptor.OneofDescriptor( 76 | name='payload', full_name='veinsgym.proto.Request.payload', 77 | index=0, containing_type=None, 78 | create_key=_descriptor._internal_create_key, 79 | fields=[]), 80 | ], 81 | serialized_start=35, 82 | serialized_end=189, 83 | ) 84 | 85 | 86 | _REPLY = _descriptor.Descriptor( 87 | name='Reply', 88 | full_name='veinsgym.proto.Reply', 89 | filename=None, 90 | file=DESCRIPTOR, 91 | containing_type=None, 92 | create_key=_descriptor._internal_create_key, 93 | fields=[ 94 | _descriptor.FieldDescriptor( 95 | name='id', full_name='veinsgym.proto.Reply.id', index=0, 96 | number=1, type=4, cpp_type=4, label=1, 97 | has_default_value=False, default_value=0, 98 | message_type=None, enum_type=None, containing_type=None, 99 | is_extension=False, extension_scope=None, 100 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 101 | _descriptor.FieldDescriptor( 102 | name='init', full_name='veinsgym.proto.Reply.init', index=1, 103 | number=2, type=11, cpp_type=10, label=1, 104 | has_default_value=False, default_value=None, 105 | message_type=None, enum_type=None, containing_type=None, 106 | is_extension=False, extension_scope=None, 107 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 108 | _descriptor.FieldDescriptor( 109 | name='shutdown', full_name='veinsgym.proto.Reply.shutdown', index=2, 110 | number=3, type=11, cpp_type=10, label=1, 111 | has_default_value=False, default_value=None, 112 | message_type=None, enum_type=None, containing_type=None, 113 | is_extension=False, extension_scope=None, 114 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 115 | _descriptor.FieldDescriptor( 116 | name='action', full_name='veinsgym.proto.Reply.action', index=3, 117 | number=4, type=11, cpp_type=10, label=1, 118 | has_default_value=False, default_value=None, 119 | message_type=None, enum_type=None, containing_type=None, 120 | is_extension=False, extension_scope=None, 121 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 122 | ], 123 | extensions=[ 124 | ], 125 | nested_types=[], 126 | enum_types=[ 127 | ], 128 | serialized_options=None, 129 | is_extendable=False, 130 | syntax='proto3', 131 | extension_ranges=[], 132 | oneofs=[ 133 | _descriptor.OneofDescriptor( 134 | name='payload', full_name='veinsgym.proto.Reply.payload', 135 | index=0, containing_type=None, 136 | create_key=_descriptor._internal_create_key, 137 | fields=[]), 138 | ], 139 | serialized_start=192, 140 | serialized_end=347, 141 | ) 142 | 143 | 144 | _INIT = _descriptor.Descriptor( 145 | name='Init', 146 | full_name='veinsgym.proto.Init', 147 | filename=None, 148 | file=DESCRIPTOR, 149 | containing_type=None, 150 | create_key=_descriptor._internal_create_key, 151 | fields=[ 152 | _descriptor.FieldDescriptor( 153 | name='action_space_code', full_name='veinsgym.proto.Init.action_space_code', index=0, 154 | number=1, type=9, cpp_type=9, label=1, 155 | has_default_value=False, default_value=b"".decode('utf-8'), 156 | message_type=None, enum_type=None, containing_type=None, 157 | is_extension=False, extension_scope=None, 158 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 159 | _descriptor.FieldDescriptor( 160 | name='observation_space_code', full_name='veinsgym.proto.Init.observation_space_code', index=1, 161 | number=2, type=9, cpp_type=9, label=1, 162 | has_default_value=False, default_value=b"".decode('utf-8'), 163 | message_type=None, enum_type=None, containing_type=None, 164 | is_extension=False, extension_scope=None, 165 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 166 | _descriptor.FieldDescriptor( 167 | name='reward_space_code', full_name='veinsgym.proto.Init.reward_space_code', index=2, 168 | number=3, type=9, cpp_type=9, label=1, 169 | has_default_value=False, default_value=b"".decode('utf-8'), 170 | message_type=None, enum_type=None, containing_type=None, 171 | is_extension=False, extension_scope=None, 172 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 173 | ], 174 | extensions=[ 175 | ], 176 | nested_types=[], 177 | enum_types=[ 178 | ], 179 | serialized_options=None, 180 | is_extendable=False, 181 | syntax='proto3', 182 | extension_ranges=[], 183 | oneofs=[ 184 | ], 185 | serialized_start=349, 186 | serialized_end=441, 187 | ) 188 | 189 | 190 | _SHUTDOWN = _descriptor.Descriptor( 191 | name='Shutdown', 192 | full_name='veinsgym.proto.Shutdown', 193 | filename=None, 194 | file=DESCRIPTOR, 195 | containing_type=None, 196 | create_key=_descriptor._internal_create_key, 197 | fields=[ 198 | ], 199 | extensions=[ 200 | ], 201 | nested_types=[], 202 | enum_types=[ 203 | ], 204 | serialized_options=None, 205 | is_extendable=False, 206 | syntax='proto3', 207 | extension_ranges=[], 208 | oneofs=[ 209 | ], 210 | serialized_start=443, 211 | serialized_end=453, 212 | ) 213 | 214 | 215 | _STEP = _descriptor.Descriptor( 216 | name='Step', 217 | full_name='veinsgym.proto.Step', 218 | filename=None, 219 | file=DESCRIPTOR, 220 | containing_type=None, 221 | create_key=_descriptor._internal_create_key, 222 | fields=[ 223 | _descriptor.FieldDescriptor( 224 | name='observation', full_name='veinsgym.proto.Step.observation', index=0, 225 | number=1, type=11, cpp_type=10, label=1, 226 | has_default_value=False, default_value=None, 227 | message_type=None, enum_type=None, containing_type=None, 228 | is_extension=False, extension_scope=None, 229 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 230 | _descriptor.FieldDescriptor( 231 | name='reward', full_name='veinsgym.proto.Step.reward', index=1, 232 | number=2, type=11, cpp_type=10, label=1, 233 | has_default_value=False, default_value=None, 234 | message_type=None, enum_type=None, containing_type=None, 235 | is_extension=False, extension_scope=None, 236 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 237 | ], 238 | extensions=[ 239 | ], 240 | nested_types=[], 241 | enum_types=[ 242 | ], 243 | serialized_options=None, 244 | is_extendable=False, 245 | syntax='proto3', 246 | extension_ranges=[], 247 | oneofs=[ 248 | ], 249 | serialized_start=455, 250 | serialized_end=544, 251 | ) 252 | 253 | 254 | _SPACE = _descriptor.Descriptor( 255 | name='Space', 256 | full_name='veinsgym.proto.Space', 257 | filename=None, 258 | file=DESCRIPTOR, 259 | containing_type=None, 260 | create_key=_descriptor._internal_create_key, 261 | fields=[ 262 | _descriptor.FieldDescriptor( 263 | name='box', full_name='veinsgym.proto.Space.box', index=0, 264 | number=1, type=11, cpp_type=10, label=1, 265 | has_default_value=False, default_value=None, 266 | message_type=None, enum_type=None, containing_type=None, 267 | is_extension=False, extension_scope=None, 268 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 269 | _descriptor.FieldDescriptor( 270 | name='dict', full_name='veinsgym.proto.Space.dict', index=1, 271 | number=2, type=11, cpp_type=10, label=1, 272 | has_default_value=False, default_value=None, 273 | message_type=None, enum_type=None, containing_type=None, 274 | is_extension=False, extension_scope=None, 275 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 276 | _descriptor.FieldDescriptor( 277 | name='discrete', full_name='veinsgym.proto.Space.discrete', index=2, 278 | number=3, type=11, cpp_type=10, label=1, 279 | has_default_value=False, default_value=None, 280 | message_type=None, enum_type=None, containing_type=None, 281 | is_extension=False, extension_scope=None, 282 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 283 | _descriptor.FieldDescriptor( 284 | name='multi_binary', full_name='veinsgym.proto.Space.multi_binary', index=3, 285 | number=4, type=11, cpp_type=10, label=1, 286 | has_default_value=False, default_value=None, 287 | message_type=None, enum_type=None, containing_type=None, 288 | is_extension=False, extension_scope=None, 289 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 290 | _descriptor.FieldDescriptor( 291 | name='multi_discrete', full_name='veinsgym.proto.Space.multi_discrete', index=4, 292 | number=5, type=11, cpp_type=10, label=1, 293 | has_default_value=False, default_value=None, 294 | message_type=None, enum_type=None, containing_type=None, 295 | is_extension=False, extension_scope=None, 296 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 297 | _descriptor.FieldDescriptor( 298 | name='tuple', full_name='veinsgym.proto.Space.tuple', index=5, 299 | number=6, type=11, cpp_type=10, label=1, 300 | has_default_value=False, default_value=None, 301 | message_type=None, enum_type=None, containing_type=None, 302 | is_extension=False, extension_scope=None, 303 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 304 | ], 305 | extensions=[ 306 | ], 307 | nested_types=[], 308 | enum_types=[ 309 | ], 310 | serialized_options=None, 311 | is_extendable=False, 312 | syntax='proto3', 313 | extension_ranges=[], 314 | oneofs=[ 315 | _descriptor.OneofDescriptor( 316 | name='value', full_name='veinsgym.proto.Space.value', 317 | index=0, containing_type=None, 318 | create_key=_descriptor._internal_create_key, 319 | fields=[]), 320 | ], 321 | serialized_start=547, 322 | serialized_end=833, 323 | ) 324 | 325 | 326 | _BOX = _descriptor.Descriptor( 327 | name='Box', 328 | full_name='veinsgym.proto.Box', 329 | filename=None, 330 | file=DESCRIPTOR, 331 | containing_type=None, 332 | create_key=_descriptor._internal_create_key, 333 | fields=[ 334 | _descriptor.FieldDescriptor( 335 | name='values', full_name='veinsgym.proto.Box.values', index=0, 336 | number=1, type=1, cpp_type=5, label=3, 337 | has_default_value=False, default_value=[], 338 | message_type=None, enum_type=None, containing_type=None, 339 | is_extension=False, extension_scope=None, 340 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 341 | ], 342 | extensions=[ 343 | ], 344 | nested_types=[], 345 | enum_types=[ 346 | ], 347 | serialized_options=None, 348 | is_extendable=False, 349 | syntax='proto3', 350 | extension_ranges=[], 351 | oneofs=[ 352 | ], 353 | serialized_start=835, 354 | serialized_end=856, 355 | ) 356 | 357 | 358 | _DICT_ITEM = _descriptor.Descriptor( 359 | name='Item', 360 | full_name='veinsgym.proto.Dict.Item', 361 | filename=None, 362 | file=DESCRIPTOR, 363 | containing_type=None, 364 | create_key=_descriptor._internal_create_key, 365 | fields=[ 366 | _descriptor.FieldDescriptor( 367 | name='key', full_name='veinsgym.proto.Dict.Item.key', index=0, 368 | number=1, type=9, cpp_type=9, label=1, 369 | has_default_value=False, default_value=b"".decode('utf-8'), 370 | message_type=None, enum_type=None, containing_type=None, 371 | is_extension=False, extension_scope=None, 372 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 373 | _descriptor.FieldDescriptor( 374 | name='value', full_name='veinsgym.proto.Dict.Item.value', index=1, 375 | number=2, type=11, cpp_type=10, label=1, 376 | has_default_value=False, default_value=None, 377 | message_type=None, enum_type=None, containing_type=None, 378 | is_extension=False, extension_scope=None, 379 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 380 | ], 381 | extensions=[ 382 | ], 383 | nested_types=[], 384 | enum_types=[ 385 | ], 386 | serialized_options=None, 387 | is_extendable=False, 388 | syntax='proto3', 389 | extension_ranges=[], 390 | oneofs=[ 391 | ], 392 | serialized_start=909, 393 | serialized_end=966, 394 | ) 395 | 396 | _DICT = _descriptor.Descriptor( 397 | name='Dict', 398 | full_name='veinsgym.proto.Dict', 399 | filename=None, 400 | file=DESCRIPTOR, 401 | containing_type=None, 402 | create_key=_descriptor._internal_create_key, 403 | fields=[ 404 | _descriptor.FieldDescriptor( 405 | name='values', full_name='veinsgym.proto.Dict.values', index=0, 406 | number=1, type=11, cpp_type=10, label=3, 407 | has_default_value=False, default_value=[], 408 | message_type=None, enum_type=None, containing_type=None, 409 | is_extension=False, extension_scope=None, 410 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 411 | ], 412 | extensions=[ 413 | ], 414 | nested_types=[_DICT_ITEM, ], 415 | enum_types=[ 416 | ], 417 | serialized_options=None, 418 | is_extendable=False, 419 | syntax='proto3', 420 | extension_ranges=[], 421 | oneofs=[ 422 | ], 423 | serialized_start=858, 424 | serialized_end=966, 425 | ) 426 | 427 | 428 | _DISCRETE = _descriptor.Descriptor( 429 | name='Discrete', 430 | full_name='veinsgym.proto.Discrete', 431 | filename=None, 432 | file=DESCRIPTOR, 433 | containing_type=None, 434 | create_key=_descriptor._internal_create_key, 435 | fields=[ 436 | _descriptor.FieldDescriptor( 437 | name='value', full_name='veinsgym.proto.Discrete.value', index=0, 438 | number=1, type=4, cpp_type=4, label=1, 439 | has_default_value=False, default_value=0, 440 | message_type=None, enum_type=None, containing_type=None, 441 | is_extension=False, extension_scope=None, 442 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 443 | ], 444 | extensions=[ 445 | ], 446 | nested_types=[], 447 | enum_types=[ 448 | ], 449 | serialized_options=None, 450 | is_extendable=False, 451 | syntax='proto3', 452 | extension_ranges=[], 453 | oneofs=[ 454 | ], 455 | serialized_start=968, 456 | serialized_end=993, 457 | ) 458 | 459 | 460 | _MULTIBINARY = _descriptor.Descriptor( 461 | name='MultiBinary', 462 | full_name='veinsgym.proto.MultiBinary', 463 | filename=None, 464 | file=DESCRIPTOR, 465 | containing_type=None, 466 | create_key=_descriptor._internal_create_key, 467 | fields=[ 468 | _descriptor.FieldDescriptor( 469 | name='values', full_name='veinsgym.proto.MultiBinary.values', index=0, 470 | number=1, type=8, cpp_type=7, label=3, 471 | has_default_value=False, default_value=[], 472 | message_type=None, enum_type=None, containing_type=None, 473 | is_extension=False, extension_scope=None, 474 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 475 | ], 476 | extensions=[ 477 | ], 478 | nested_types=[], 479 | enum_types=[ 480 | ], 481 | serialized_options=None, 482 | is_extendable=False, 483 | syntax='proto3', 484 | extension_ranges=[], 485 | oneofs=[ 486 | ], 487 | serialized_start=995, 488 | serialized_end=1024, 489 | ) 490 | 491 | 492 | _MULTIDISCRETE = _descriptor.Descriptor( 493 | name='MultiDiscrete', 494 | full_name='veinsgym.proto.MultiDiscrete', 495 | filename=None, 496 | file=DESCRIPTOR, 497 | containing_type=None, 498 | create_key=_descriptor._internal_create_key, 499 | fields=[ 500 | _descriptor.FieldDescriptor( 501 | name='values', full_name='veinsgym.proto.MultiDiscrete.values', index=0, 502 | number=1, type=4, cpp_type=4, label=3, 503 | has_default_value=False, default_value=[], 504 | message_type=None, enum_type=None, containing_type=None, 505 | is_extension=False, extension_scope=None, 506 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 507 | ], 508 | extensions=[ 509 | ], 510 | nested_types=[], 511 | enum_types=[ 512 | ], 513 | serialized_options=None, 514 | is_extendable=False, 515 | syntax='proto3', 516 | extension_ranges=[], 517 | oneofs=[ 518 | ], 519 | serialized_start=1026, 520 | serialized_end=1057, 521 | ) 522 | 523 | 524 | _TUPLE = _descriptor.Descriptor( 525 | name='Tuple', 526 | full_name='veinsgym.proto.Tuple', 527 | filename=None, 528 | file=DESCRIPTOR, 529 | containing_type=None, 530 | create_key=_descriptor._internal_create_key, 531 | fields=[ 532 | _descriptor.FieldDescriptor( 533 | name='values', full_name='veinsgym.proto.Tuple.values', index=0, 534 | number=1, type=11, cpp_type=10, label=3, 535 | has_default_value=False, default_value=[], 536 | message_type=None, enum_type=None, containing_type=None, 537 | is_extension=False, extension_scope=None, 538 | serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), 539 | ], 540 | extensions=[ 541 | ], 542 | nested_types=[], 543 | enum_types=[ 544 | ], 545 | serialized_options=None, 546 | is_extendable=False, 547 | syntax='proto3', 548 | extension_ranges=[], 549 | oneofs=[ 550 | ], 551 | serialized_start=1059, 552 | serialized_end=1105, 553 | ) 554 | 555 | _REQUEST.fields_by_name['init'].message_type = _INIT 556 | _REQUEST.fields_by_name['shutdown'].message_type = _SHUTDOWN 557 | _REQUEST.fields_by_name['step'].message_type = _STEP 558 | _REQUEST.oneofs_by_name['payload'].fields.append( 559 | _REQUEST.fields_by_name['init']) 560 | _REQUEST.fields_by_name['init'].containing_oneof = _REQUEST.oneofs_by_name['payload'] 561 | _REQUEST.oneofs_by_name['payload'].fields.append( 562 | _REQUEST.fields_by_name['shutdown']) 563 | _REQUEST.fields_by_name['shutdown'].containing_oneof = _REQUEST.oneofs_by_name['payload'] 564 | _REQUEST.oneofs_by_name['payload'].fields.append( 565 | _REQUEST.fields_by_name['step']) 566 | _REQUEST.fields_by_name['step'].containing_oneof = _REQUEST.oneofs_by_name['payload'] 567 | _REPLY.fields_by_name['init'].message_type = _INIT 568 | _REPLY.fields_by_name['shutdown'].message_type = _SHUTDOWN 569 | _REPLY.fields_by_name['action'].message_type = _SPACE 570 | _REPLY.oneofs_by_name['payload'].fields.append( 571 | _REPLY.fields_by_name['init']) 572 | _REPLY.fields_by_name['init'].containing_oneof = _REPLY.oneofs_by_name['payload'] 573 | _REPLY.oneofs_by_name['payload'].fields.append( 574 | _REPLY.fields_by_name['shutdown']) 575 | _REPLY.fields_by_name['shutdown'].containing_oneof = _REPLY.oneofs_by_name['payload'] 576 | _REPLY.oneofs_by_name['payload'].fields.append( 577 | _REPLY.fields_by_name['action']) 578 | _REPLY.fields_by_name['action'].containing_oneof = _REPLY.oneofs_by_name['payload'] 579 | _STEP.fields_by_name['observation'].message_type = _SPACE 580 | _STEP.fields_by_name['reward'].message_type = _SPACE 581 | _SPACE.fields_by_name['box'].message_type = _BOX 582 | _SPACE.fields_by_name['dict'].message_type = _DICT 583 | _SPACE.fields_by_name['discrete'].message_type = _DISCRETE 584 | _SPACE.fields_by_name['multi_binary'].message_type = _MULTIBINARY 585 | _SPACE.fields_by_name['multi_discrete'].message_type = _MULTIDISCRETE 586 | _SPACE.fields_by_name['tuple'].message_type = _TUPLE 587 | _SPACE.oneofs_by_name['value'].fields.append( 588 | _SPACE.fields_by_name['box']) 589 | _SPACE.fields_by_name['box'].containing_oneof = _SPACE.oneofs_by_name['value'] 590 | _SPACE.oneofs_by_name['value'].fields.append( 591 | _SPACE.fields_by_name['dict']) 592 | _SPACE.fields_by_name['dict'].containing_oneof = _SPACE.oneofs_by_name['value'] 593 | _SPACE.oneofs_by_name['value'].fields.append( 594 | _SPACE.fields_by_name['discrete']) 595 | _SPACE.fields_by_name['discrete'].containing_oneof = _SPACE.oneofs_by_name['value'] 596 | _SPACE.oneofs_by_name['value'].fields.append( 597 | _SPACE.fields_by_name['multi_binary']) 598 | _SPACE.fields_by_name['multi_binary'].containing_oneof = _SPACE.oneofs_by_name['value'] 599 | _SPACE.oneofs_by_name['value'].fields.append( 600 | _SPACE.fields_by_name['multi_discrete']) 601 | _SPACE.fields_by_name['multi_discrete'].containing_oneof = _SPACE.oneofs_by_name['value'] 602 | _SPACE.oneofs_by_name['value'].fields.append( 603 | _SPACE.fields_by_name['tuple']) 604 | _SPACE.fields_by_name['tuple'].containing_oneof = _SPACE.oneofs_by_name['value'] 605 | _DICT_ITEM.fields_by_name['value'].message_type = _SPACE 606 | _DICT_ITEM.containing_type = _DICT 607 | _DICT.fields_by_name['values'].message_type = _DICT_ITEM 608 | _TUPLE.fields_by_name['values'].message_type = _SPACE 609 | DESCRIPTOR.message_types_by_name['Request'] = _REQUEST 610 | DESCRIPTOR.message_types_by_name['Reply'] = _REPLY 611 | DESCRIPTOR.message_types_by_name['Init'] = _INIT 612 | DESCRIPTOR.message_types_by_name['Shutdown'] = _SHUTDOWN 613 | DESCRIPTOR.message_types_by_name['Step'] = _STEP 614 | DESCRIPTOR.message_types_by_name['Space'] = _SPACE 615 | DESCRIPTOR.message_types_by_name['Box'] = _BOX 616 | DESCRIPTOR.message_types_by_name['Dict'] = _DICT 617 | DESCRIPTOR.message_types_by_name['Discrete'] = _DISCRETE 618 | DESCRIPTOR.message_types_by_name['MultiBinary'] = _MULTIBINARY 619 | DESCRIPTOR.message_types_by_name['MultiDiscrete'] = _MULTIDISCRETE 620 | DESCRIPTOR.message_types_by_name['Tuple'] = _TUPLE 621 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 622 | 623 | Request = _reflection.GeneratedProtocolMessageType('Request', (_message.Message,), { 624 | 'DESCRIPTOR' : _REQUEST, 625 | '__module__' : 'veinsgym_pb2' 626 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Request) 627 | }) 628 | _sym_db.RegisterMessage(Request) 629 | 630 | Reply = _reflection.GeneratedProtocolMessageType('Reply', (_message.Message,), { 631 | 'DESCRIPTOR' : _REPLY, 632 | '__module__' : 'veinsgym_pb2' 633 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Reply) 634 | }) 635 | _sym_db.RegisterMessage(Reply) 636 | 637 | Init = _reflection.GeneratedProtocolMessageType('Init', (_message.Message,), { 638 | 'DESCRIPTOR' : _INIT, 639 | '__module__' : 'veinsgym_pb2' 640 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Init) 641 | }) 642 | _sym_db.RegisterMessage(Init) 643 | 644 | Shutdown = _reflection.GeneratedProtocolMessageType('Shutdown', (_message.Message,), { 645 | 'DESCRIPTOR' : _SHUTDOWN, 646 | '__module__' : 'veinsgym_pb2' 647 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Shutdown) 648 | }) 649 | _sym_db.RegisterMessage(Shutdown) 650 | 651 | Step = _reflection.GeneratedProtocolMessageType('Step', (_message.Message,), { 652 | 'DESCRIPTOR' : _STEP, 653 | '__module__' : 'veinsgym_pb2' 654 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Step) 655 | }) 656 | _sym_db.RegisterMessage(Step) 657 | 658 | Space = _reflection.GeneratedProtocolMessageType('Space', (_message.Message,), { 659 | 'DESCRIPTOR' : _SPACE, 660 | '__module__' : 'veinsgym_pb2' 661 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Space) 662 | }) 663 | _sym_db.RegisterMessage(Space) 664 | 665 | Box = _reflection.GeneratedProtocolMessageType('Box', (_message.Message,), { 666 | 'DESCRIPTOR' : _BOX, 667 | '__module__' : 'veinsgym_pb2' 668 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Box) 669 | }) 670 | _sym_db.RegisterMessage(Box) 671 | 672 | Dict = _reflection.GeneratedProtocolMessageType('Dict', (_message.Message,), { 673 | 674 | 'Item' : _reflection.GeneratedProtocolMessageType('Item', (_message.Message,), { 675 | 'DESCRIPTOR' : _DICT_ITEM, 676 | '__module__' : 'veinsgym_pb2' 677 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Dict.Item) 678 | }) 679 | , 680 | 'DESCRIPTOR' : _DICT, 681 | '__module__' : 'veinsgym_pb2' 682 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Dict) 683 | }) 684 | _sym_db.RegisterMessage(Dict) 685 | _sym_db.RegisterMessage(Dict.Item) 686 | 687 | Discrete = _reflection.GeneratedProtocolMessageType('Discrete', (_message.Message,), { 688 | 'DESCRIPTOR' : _DISCRETE, 689 | '__module__' : 'veinsgym_pb2' 690 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Discrete) 691 | }) 692 | _sym_db.RegisterMessage(Discrete) 693 | 694 | MultiBinary = _reflection.GeneratedProtocolMessageType('MultiBinary', (_message.Message,), { 695 | 'DESCRIPTOR' : _MULTIBINARY, 696 | '__module__' : 'veinsgym_pb2' 697 | # @@protoc_insertion_point(class_scope:veinsgym.proto.MultiBinary) 698 | }) 699 | _sym_db.RegisterMessage(MultiBinary) 700 | 701 | MultiDiscrete = _reflection.GeneratedProtocolMessageType('MultiDiscrete', (_message.Message,), { 702 | 'DESCRIPTOR' : _MULTIDISCRETE, 703 | '__module__' : 'veinsgym_pb2' 704 | # @@protoc_insertion_point(class_scope:veinsgym.proto.MultiDiscrete) 705 | }) 706 | _sym_db.RegisterMessage(MultiDiscrete) 707 | 708 | Tuple = _reflection.GeneratedProtocolMessageType('Tuple', (_message.Message,), { 709 | 'DESCRIPTOR' : _TUPLE, 710 | '__module__' : 'veinsgym_pb2' 711 | # @@protoc_insertion_point(class_scope:veinsgym.proto.Tuple) 712 | }) 713 | _sym_db.RegisterMessage(Tuple) 714 | 715 | 716 | # @@protoc_insertion_point(module_scope) 717 | --------------------------------------------------------------------------------