SeleneComponent

class selene_core.plugin.SeleneComponent(random_seed: int | None = None)

An abstract base class for plugins.

We assert that every plugin may be provided with a random seed, and any random behaviour should be reproducible given the same seed.

__abstractmethods__ = frozenset({'library_file'})
__eq__(other)

Return self==value.

__hash__ = None
__init__(random_seed: int | None = None) None
__repr__()

Return repr(self).

get_init_args() list[str]

This function should return a list of strings that will be passed to the plugin through those additional arguments. They should be in the format expected by the plugin; if it demands –long=form –arguments, this function should return [”–long=form”, “–arguments”]. If it demands short flags, this function should return e.g. [“-sho”, “-rt”, “form args”].

abstract property library_file: Path

Plugins are made possible by implementing a dynamic library that provides the necessary functions for the simulator to interact with the plugin. This method should provide the path to the shared object file to be processed by selene.

property library_search_dirs: list[Path]

Some plugins may require additional dynamic libraries to be made available, away from the standard system paths. Provide their paths through this function if necessary. The default implementation will return an empty list.

Each path provided by this property will be added to the environment that the selene emulator runs in when this plugin is used. This is done by appending to PATH on Windows, LD_LIBRARY_PATH on Linux, and DYLD_LIBRARY_PATH on MacOS.

random_seed: int | None = None