-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] Decouple Task enums from task classes #175
base: main
Are you sure you want to change the base?
Conversation
return self.update_config(config) | ||
return self.get_task(config=config) | ||
|
||
def supports_continuous_actions(self) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these two functions be here? wouldnt it be possible for the config of a task to modify whether or not it supports a discrete action?
return obj | ||
|
||
def __init__(self, config: Dict[str, Any]): | ||
class TaskClass(abc.ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could add doc along the lines of:
Represents a specific environment that is to be constructed.
The environment is fully defined by its constructor (TaskClass.get_env_fun) and its parameterization (TaskClass.config).
Note that there could be a many-to-one mapping between TaskClasses and environments. For example:
- A single TaskClass may allow construction of all environments of `PettingZoo`
- A single TaskClass may allow construction of environments of `PettingZoo` that only have discrete actions
- A single TaskClass may allow construction of just a specific `PettingZoo` environment.
Here is the concept.
Tasks are enum like before, but now they are decoupled from their class.
This is similar to the way that
ModelConfig
->Model
works (one class for config and one class for component)(same for algos)
Now this is the case also for tasks: you have an enum that holds the config and you can call
get_task()
to lock the config into a task class.