command module
Define the base class from which all commands will inherit.
- class Command(line, dat_idx=None, **kwargs)[source]
Bases:
InstructionA generic Command class.
- Parameters:
- set_influenced_elements(instructions, **kwargs)[source]
Determine the index of the elements concerned by
apply().- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type:
- abstractmethod apply(instructions, **kwargs)[source]
Apply the command.
- Parameters:
instructions (
list[Instruction])kwargs (
float)
- Return type:
- concerns_one_of(dat_indexes)[source]
Tell if
selfconcerns an element, whichdat_idxis given.Internally, we convert the
self.influencedfrom asetto alistobject and check intersections withdat_indexes.
- _indexes_between_this_command_and(instructions_after_self, *stop_types)[source]
Determine the indexes of the instructions affected by an instruction.
We return the indexes of instructions between the first of
instructionsand the first instruction which type is instop_types.- Parameters:
instructions_after_self (
Sequence[Instruction]) – All instructions afterself(selfnot included).stop_types (
type) – Type(s) of commands after whichselfhas no influence. If not provided, we set it to the type ofself. In other words, aFREQinfluences every element up to the followingFREQ.
- Return type:
- Returns:
All the indexes of the instrutions that will be affected by self.
- increment_dat_position(increment=1)[source]
Increment dat_index and indexes of elements concerned by command.
- _abc_impl = <_abc._abc_data object at 0x7318fb34c680>