Skip to content

Instruction

Entities

instruction

Classes:

  • Instruction

    An Instruction to execute an action by a Performer.

  • InstructionFactory

    An InstructionFactory is an entity capable of generating instructions

  • InstructionPerformer

    An InstructionFactory is an entity capable of generating instructions

  • MacroInstruction

    A Macro Instruction is a collection of individual Instruction.

Instruction

Instruction(name: str, performer: InstructionPerformer, factory: InstructionFactory | None = None, delay: float = 0.0, condition: str | None = None)

An Instruction to execute an action by a Performer.
Often, the Performer is an InstructionFactory and generates the Instruction it will later execute.

Methods:

all_subclasses staticmethod

all_subclasses() -> list

Returns the list of all subclasses.

Recurses through all sub-sub classes

Returns:

  • list

    [list]: list of all subclasses

Raises:

  • ValueError

    If invalid class found in recursion (types, etc.)

InstructionFactory

An InstructionFactory is an entity capable of generating instructions
Often, the entity generates instruction it will perform.

InstructionPerformer

An InstructionFactory is an entity capable of generating instructions
Often, the entity generates instruction it will perform.

MacroInstruction

MacroInstruction(name: str, performer: InstructionPerformer, factory: InstructionFactory, instructions: dict, delay: float = 0.0, condition: str | None = None)

A Macro Instruction is a collection of individual Instruction.
Each instruction comes with its condition for execution and delay since activation.
(Could have been called Instructions (plural form))

Methods:

all_subclasses staticmethod

all_subclasses() -> list

Returns the list of all subclasses.

Recurses through all sub-sub classes

Returns:

  • list

    [list]: list of all subclasses

Raises:

  • ValueError

    If invalid class found in recursion (types, etc.)