class documentation

class TaskStratSet:

View In Hierarchy

A set of strategies that perform a task, having a collection makes it easy to choose one from another

Method __call__ Call the strategy specified by 'key'
Method __getitem__ Return the strategy specified by key
Method add Add a list of strategies to the set.
Method format_description Return a formatted string of the names and descriptions of the strategies in this set.
Method get_callable Return the callable of the strategy specified by key
Method get_description Return the description of the strategy specified by key
Method get_name Return the name of the strategy specified by key
Method remove Remove a strategy specified by key
Class Variable description Undocumented
Property callables Return a tuple of the callables of all the strategies in this set
Property descriptions Return a tuple of the descriptions of all the strategies in this set
Property names Return a tuple of the names of all the strategies in this set
Method _del_item Delete the strategy specified by key
Method _get_item Return the strategy specified by key
Method _set_item Set save the passed strategy under the key value.name
Class Variable _items Undocumented
Class Variable _name_idx_map Undocumented
def __call__(self, key, *args, **kwargs) -> Any:

Call the strategy specified by 'key'

def __getitem__(self, key: int | str) -> TaskStratInfo:

Return the strategy specified by key

def add(self, *args: list[TaskStratInfo, ...]) -> Self:

Add a list of strategies to the set.

def format_description(self, indent_level: int = 0, indent: str = '\t', with_default=True):

Return a formatted string of the names and descriptions of the strategies in this set.

def get_callable(self, key: int | str) -> Callable[[...], Any]:

Return the callable of the strategy specified by key

def get_description(self, key: int | str) -> Callable[[...], Any]:

Return the description of the strategy specified by key

def get_name(self, key: int | str) -> Callable[[...], Any]:

Return the name of the strategy specified by key

def remove(self, key) -> Self:

Remove a strategy specified by key

description: str =

Undocumented

@property
callables: tuple[Callable[[...], Any]] =

Return a tuple of the callables of all the strategies in this set

@property
descriptions: tuple[str] =

Return a tuple of the descriptions of all the strategies in this set

@property
names: tuple[str] =

Return a tuple of the names of all the strategies in this set

def _del_item(self, key: int | str) -> Self:

Delete the strategy specified by key

def _get_item(self, key: int | str) -> TaskStratInfo:

Return the strategy specified by key

def _set_item(self, value: TaskStratInfo) -> Self:

Set save the passed strategy under the key value.name

_items: list[TaskStratInfo] =

Undocumented

_name_idx_map: dict[str, int] =

Undocumented