我开发了一个通用的Environment
类,它在Agent
文件中使用通用的generic.py
类。现在我想创建一个在SpecificEnvironment
文件中使用SpecificAgent
的specific.py
。
到目前为止,我必须指定(具体)Environment
与以下内容:
from generic import Environment
class SpecificEnvironment(Environment):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
如何让SpecificEnvironment
使用SpecificAgent
子类,而不是Agent
?
随意提出一些读数,以便我可以自学。我是面向对象编程的新手。