fdg.control package
Submodules
fdg.control.ftn_search_strategy module
- class fdg.control.ftn_search_strategy.BFS[source]
Bases:
FunctionSearchStrategy
no need to save states
- assign_states(dk_functions: list | None = None, current_state_key: str | None = None, fwrg: FWRG_manager | None = None, states_dict: dict = {}, iteration: int = 0) list [source]
assign functions for multiple states at the same time. :param deep_functions: :param current_state_key: :param fwrg: :param states_dict: :return:
- initialize(flag_one_start_function: bool, preprocess_timeout: bool, preprocess_coverage: float, all_functions: list, fwrg_manager: FWRG_manager)[source]
- class fdg.control.ftn_search_strategy.DFS[source]
Bases:
FunctionSearchStrategy
- assign_states(dk_functions: list | None = None, states_dict: dict = {}, iteration: int = 0) list [source]
save states, push state keys to the stack select a state by poping an item from the stack assign functions to be executed on the selected state
- Parameters:
dk_functions
current_state_key
fdfg
states_dict
- Returns:
- initialize(flag_one_start_function: bool, preprocess_timeout: bool, preprocess_coverage: float, all_functions: list, fwrg_manager: FWRG_manager)[source]
- class fdg.control.ftn_search_strategy.FunctionSearchStrategy(strategy_name: str)[source]
Bases:
object
- assign_states(dk_functions: list | None = None, current_state_key: str | None = None, fdfg: FWRG_manager | None = None, states_dict: dict = {}, iteration: int = 0) list [source]
- class fdg.control.ftn_search_strategy.RandomBaseline(percent_of_functions: int, functions: list)[source]
Bases:
FunctionSearchStrategy
no need to save states
- class fdg.control.ftn_search_strategy.Seq[source]
Bases:
FunctionSearchStrategy
- assign_states(dk_functions: list | None = None, current_state_key: str | None = None, fdfg: FWRG_manager | None = None, states_dict: dict = {}, iteration: int = 0) list [source]
- Parameters:
dk_functions
current_state_key
fdfg
states_dict
- Returns:
fdg.control.function_assignment module
- class fdg.control.function_assignment.FunctionAssignment(all_functions: list, fwrg_manager: FWRG_manager, select_percent: int = 0)[source]
Bases:
object
- assign_functions(state_key: str, dk_functions: list, to_execute_functions: list = [], not_to_execute: list = [])[source]
- assign_functions_timeout(state_key: str, dk_functions: list, percent_of_functions: int = 1)[source]
- assign_functions_timeout_mine(state_key: str, dk_functions: list, randomly_selected_functions: list)[source]
- can_reach_targets(ftn: str, targets: list, max_depth: int) bool [source]
check there is a path from ftn to one of the targets the max length of such a path should be no larger than max_depth
fdg.control.guider module
- class fdg.control.guider.Guider(ftn_search_strategy: FunctionSearchStrategy, functions: list)[source]
Bases:
object
- get_start_sequence(laserEVM: LaserEVM)[source]
get the sequences used to annotate the states (world states) at the end of Phase 1
- init(start_functions: list, depth_k_functions: list, preprocess: Preprocessing)[source]
fdg.control.mine module
- class fdg.control.mine.Mine[source]
Bases:
FunctionSearchStrategy
- assign_states(dk_functions: list | None = None, states_dict: dict = {}, iteration: int = 0) list [source]
- Parameters:
dk_functions
fwrg
states_dict
- Returns:
- assign_states_normal(dk_functions: list | None = None, states_dict: dict = {}) list [source]
- Parameters:
dk_functions
fwrg
states_dict
- Returns:
a state and the functions to be executed on it
a flag indicating whether this state can be deleted or not.
- assign_states_timeout(dk_functions: list | None = None, states_dict: dict = {}, percent_of_functions: int = 1) list [source]
- Parameters:
dk_functions
fwrg
states_dict
- Returns:
- filter_states()[source]
for states generated from the same function sequence, only one is considered if two or more write the same state variables in the last step
- initialize(flag_one_start_function: bool, preprocess_timeout: bool, preprocess_coverage: float, all_functions: list, fwrg_manager: FWRG_manager)[source]
- pickup_a_state(targets: list)[source]
order states in self.queue return the first state in self.queue