Skip to content

environment_interface

environment_interface ¤

Classes:

Name Description
IEnvironmentPlugin

IEnvironmentPlugin is an abstract base class that defines the interface for environment plugins.

panther.plugins.environments.environment_interface.IEnvironmentPlugin ¤

IEnvironmentPlugin(env_config_to_test: EnvironmentConfig, output_dir: str, env_type: str, env_sub_type: str, event_manager: EventManager)

Bases: IPlugin

IEnvironmentPlugin is an abstract base class that defines the interface for environment plugins.

Attributes:

Name Type Description
templates_dir str

Directory path for templates specific to the environment type and subtype.

output_dir str

Directory path for output files.

env_type str

Type of the environment.

env_sub_type str

Subtype of the environment.

log_dirs str

Directory path for log files.

plugin_loader

Loader for the plugin (initially set to None).

env_config_to_test EnvironmentConfig

Configuration of the environment to be tested.

event_manager EventManager

Manager for handling events.

Methods:

Name Description
is_network_environment

Abstract method. Returns True if the plugin is a network environment.

setup_environment

Abstract method. Sets up the required environment before running experiments.

teardown_environment

Abstract method. Tears down the environment after experiments are completed.

Methods:

Name Description
is_network_environment

Returns True if the plugin is a network environment.

setup_environment

Sets up the required environment before running experiments.

teardown_environment

Tears down the environment after experiments are completed.

Source code in panther/plugins/environments/environment_interface.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def __init__(
    self,
    env_config_to_test: EnvironmentConfig,
    output_dir: str,
    env_type: str,
    env_sub_type: str,
    event_manager: EventManager,
):
    super().__init__()
    self._plugin_dir = Path(os.path.dirname(__file__))
    self.templates_dir: str = (
        f"{self._plugin_dir}/{env_type}/{env_sub_type}/templates"
    )
    self.output_dir = output_dir
    self.env_type = env_type
    self.env_sub_type = env_sub_type
    self.log_dirs = os.path.join(self.output_dir, "logs")
    self.plugin_loader = None
    self.env_config_to_test = env_config_to_test
    self.event_manager = event_manager

is_network_environment abstractmethod ¤

is_network_environment()

Returns True if the plugin is a network environment.

Source code in panther/plugins/environments/environment_interface.py
55
56
57
58
59
60
@abstractmethod
def is_network_environment(self):
    """
    Returns True if the plugin is a network environment.
    """
    pass

setup_environment abstractmethod ¤

setup_environment()

Sets up the required environment before running experiments.

Source code in panther/plugins/environments/environment_interface.py
62
63
64
65
66
67
@abstractmethod
def setup_environment(self):
    """
    Sets up the required environment before running experiments.
    """
    pass

teardown_environment abstractmethod ¤

teardown_environment()

Tears down the environment after experiments are completed.

Source code in panther/plugins/environments/environment_interface.py
69
70
71
72
73
74
@abstractmethod
def teardown_environment(self):
    """
    Tears down the environment after experiments are completed.
    """
    pass