这是indexloc提供的服务,不要输入任何密码
Skip to content

Set Attributes in Vector Environments #473

@Markus28

Description

@Markus28
  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • documentation request (i.e. "X is missing from the documentation.")
    • new feature request
  • I have visited the source website
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:

Operating System: Ubuntu Linux; Version: Commit c198761

Hey,

I am using tianshou as a submodule in a different project. There I use ShmemVectorEnv to simulate an environment. During training I would like to dynamically manipulate the environments by setting certain attributes to some values. Looking at the current code, this operation does not seem to be supported by the vector environments, is that correct? Is there some reason why BaseVectorEnv and the workers cannot implement a __setattr__ method?
Is there possibly some other solution to this problem or could such methods be implemented (I'd be happy to have a crack at it and raise a pull request)? Although I have not yet performed any benchmarks, I expect the cost of instantiating a new ShmemVectorEnv whenever I want to modify an attribute to be prohibitive.
Thanks for your help!

Best,
Markus

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature that is not a new algorithm or an algorithm enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions