API Reference
ambiegen
executors
abstract_executor
AbstractExecutor
AbstractExecutor(
generator, results_path=None, min_fitness=0.0
)
Bases: ABC
AbstractExecutor is an abstract base class for evaluating the fitness of test scenarios.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
execute_test |
Executes a test scenario, evaluates its fitness, and returns the fitness score and additional information. Handles test validity, execution timing, and error logging. |
_execute |
Abstract method to be implemented by subclasses, defining how a test is executed and its fitness is computed. This method should be implemented for a specific system under test. |
name -> int |
Property returning the name identifier of the executor. |
Source code in ambiegen/executors/abstract_executor.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
name
property
name
Size of the phenotype.
| Returns: |
|
|---|
execute_test
execute_test(test)
Executes a given test, evaluates its fitness, and logs execution details.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
- Converts the genotype to phenotype using the generator.
- Validates the test before execution; if invalid, returns a fitness of 0.
- If an exception occurs during execution, logs the error and updates the test info accordingly.
Source code in ambiegen/executors/abstract_executor.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
ambiegen_uav_executor
AmbieGenUAVExecutor
AmbieGenUAVExecutor(generator)
Bases: AbstractExecutor
AmbieGenUAVExecutor executes UAV test scenarios using the RRT (Rapidly-exploring Random Tree) algorithm to evaluate test fitness. This executor integrates with a generator to define the environment and obstacles, runs the RRT path planning algorithm, and computes a fitness score based on the path length and simulation results. If the RRT fails to find a path or the fitness is below a threshold, it executes the test in simulation, evaluates the minimum distance to obstacles, and applies additional fitness bonuses or penalties. The outcome and metrics are logged for each execution.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_execute |
Executes the test scenario using RRT, evaluates the path, and computes the fitness value. |
Source code in ambiegen/executors/ambiegen_uav_executor.py
23 24 25 26 27 | |
fake_executor
FakeExecutor
FakeExecutor(generator)
Bases: AbstractExecutor
A fake executor class for testing purposes, inheriting from AbstractExecutor. It generates a fitness value of 0 for any test executed, simulating the behavior of an executor without actual execution logic.
| Attributes: |
|
|---|
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
_execute |
Simulates the execution of a test and returns a fitness value (always 0 in this fake implementation). |
Source code in ambiegen/executors/fake_executor.py
21 22 23 | |
obstacle_scene_executor
ObstacleSceneExecutor
ObstacleSceneExecutor(generator, min_fitness=0.0)
Bases: AbstractExecutor
Executes obstacle scene tests using a provided generator and evaluates their fitness. This executor runs UAV (Unmanned Aerial Vehicle) simulation tests, tracks their outcomes, and computes a fitness score based on the minimum distance to obstacles encountered during the test. It maintains dictionaries to store test results and statistics, such as the number of simulation evaluations and failures.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_execute |
Executes a single test, records its results, and returns a fitness value. The fitness is calculated as the negative inverse of the minimum distance to obstacles. Handles exceptions during test execution and logs errors. |
Source code in ambiegen/executors/obstacle_scene_executor.py
26 27 28 29 30 | |
rrt_executor
RRTExecutor
RRTExecutor(generator, min_fitness=25.0)
Bases: AbstractExecutor
RRTExecutor executes test scenarios using the Rapidly-exploring Random Tree (RRT) algorithm to evaluate their fitness. This executor interfaces with a generator to obtain environment boundaries and obstacles, then attempts to find a path from a fixed start position to a goal using RRT. The fitness of a test scenario is determined by the length of the path found (shorter paths yield higher fitness), or zero if no path is found.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_execute |
Executes the RRT algorithm on the provided test scenario and returns its fitness value. |
Source code in ambiegen/executors/rrt_executor.py
23 24 25 26 27 | |
generators
abstract_generator
AbstractGenerator
AbstractGenerator(name='AbstractGenerator')
Bases: ABC
Abstract base class for genotype-phenotype generators. This class defines the interface for generators that map between genotype and phenotype representations, provide bounds for genotypes, generate random samples, validate tests, and visualize them. Subclasses must implement all abstract properties and methods. In other words, when adding a new generator, you should implement all the abstract methods defined in this class
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
cmp_func |
List[float], test2: List[float]) -> float: Compare two tests and return -1, 0, or 1. |
genotype2phenotype |
List[float]) -> List[float]: Convert a genotype to its phenotype representation. |
generate_random_test |
Generate a random valid test (genotype). |
is_valid |
List[float]) -> bool: Check if a test is valid. |
visualize_test |
List[float], save_path: str = None): Visualize a test. |
phenotype2genotype |
List[float]) -> List[float]: Convert a phenotype to its genotype representation. |
Initialize the generator.
| Parameters: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
35 36 37 38 39 40 41 42 43 | |
lower_bound
abstractmethod
property
lower_bound
Lower bound of the genotype.
This is the minimum value for each element in the genotype.
| Returns: |
|
|---|
name
property
name
Get the name of the generator.
| Returns: |
|
|---|
size
abstractmethod
property
size
Size of the genotype representation.
The genotype is the internal representation used by the optimization algorithm. This is typically a list/array of floating-point values.
| Returns: |
|
|---|
upper_bound
abstractmethod
property
upper_bound
Upper bound of the genotype.
This is the maximum value for each element in the genotype.
| Returns: |
|
|---|
__str__
__str__()
String representation of the generator.
Source code in ambiegen/generators/abstract_generator.py
162 163 164 | |
cmp_func
abstractmethod
cmp_func(test1, test2)
Compare two tests.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
97 98 99 100 101 102 103 104 105 106 107 108 | |
generate_random_test
abstractmethod
generate_random_test()
Generate samples from the generator
| Returns: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
133 134 135 136 137 138 139 140 | |
genotype2phenotype
abstractmethod
genotype2phenotype(genotype)
Convert a genotype to a phenotype.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
121 122 123 124 125 126 127 128 129 130 131 | |
is_valid
abstractmethod
is_valid(test)
Check if a test is valid.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
141 142 143 144 145 146 147 148 149 150 151 | |
phenotype2genotype
phenotype2genotype(phenotype)
Convert a phenotype to a genotype.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
110 111 112 113 114 115 116 117 118 119 | |
visualize_test
abstractmethod
visualize_test(test, save_path=None)
Visualize a test.
| Parameters: |
|
|---|
Source code in ambiegen/generators/abstract_generator.py
153 154 155 156 157 158 159 160 | |
obstacle_generator
ObstacleGenerator
ObstacleGenerator(case_study_file, max_box_num=3)
Bases: AbstractGenerator
ObstacleGenerator is a generator class for creating and manipulating obstacle configurations for drone test cases. This class provides methods to randomly generate, normalize, denormalize, and validate obstacle test cases within specified bounds. It supports conversion between phenotype (test case with obstacles) and genotype (flattened, normalized representation), as well as visualization of generated test cases.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
cmp_func |
Computes the cosine similarity difference between two vectors. |
get_bounds |
Returns the lower and upper bounds for the genotype vector. |
flatten_test_case |
Flattens a nested test case structure into a 1D numpy array. |
generate_random_test |
Generates a random, valid obstacle test case and returns its genotype. |
normalize_flattened_test |
Normalizes a flattened test case using min and max bounds. |
denormalize_flattened_test |
Denormalizes a normalized test case back to original scale. |
phenotype2genotype |
Converts a phenotype (TestCase) to a normalized genotype vector. |
genotype2phenotype |
Converts a genotype vector back to a phenotype (TestCase). |
resize_test |
Reshapes a flattened test case into the expected structure. |
is_valid |
Checks if a given test case is valid (no overlaps, within bounds). |
obstacles_fit |
Checks if a list of obstacles fit within the defined area and do not overlap. |
get_random_box_vals |
Generates random values for a single obstacle's parameters. |
visualize_test |
Visualizes a test case and saves the plot to a file. |
Initialize the generator.
| Parameters: |
|
|---|
Source code in ambiegen/generators/obstacle_generator.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
denormalize_flattened_test
denormalize_flattened_test(norm_test)
Use min and max values to denormalize the test case. Args: norm_test (list): Flattened normalized test case to denormalize.
Source code in ambiegen/generators/obstacle_generator.py
158 159 160 161 162 163 164 165 166 167 168 | |
is_valid
is_valid(test)
Check if the given test is valid.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/obstacle_generator.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
normalize_flattened_test
normalize_flattened_test(test)
Use min and max values to normalize the test case. Args: test (list): Flattened test case to normalize.
Source code in ambiegen/generators/obstacle_generator.py
150 151 152 153 154 155 156 | |
obstacles_fit
obstacles_fit(box_list)
Check if the boxes in the given list fit within the defined bounds.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/generators/obstacle_generator.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
mutation
abstract_mutation
AbstractMutation
AbstractMutation(mut_prob=0.4)
Bases: Mutation, ABC
Abstract base class for mutation operators in evolutionary algorithms.
This class defines the interface and basic behavior for mutation operations,
including a mutation rate and the mechanism to apply mutation to a population.
Subclasses must implement the _do_mutation method to specify the mutation logic.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_do |
Applies mutation to each individual in the population X with probability |
_do_mutation |
Abstract method to perform mutation on a single individual. Must be implemented by subclasses. |
Args: mut_rate (float, optional): Mutation rate, probability of mutating an individual. Defaults to 0.4.
Source code in ambiegen/mutation/abstract_mutation.py
27 28 29 | |
do_mutation
abstractmethod
do_mutation(x)
Apply a mutation operation to the input array.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in ambiegen/mutation/abstract_mutation.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
obstacle_mutation
ObstacleMutation
ObstacleMutation(mut_prob=0.4, generator=None)
Bases: AbstractMutation
ObstacleMutation applies mutation operations to obstacle-based test configurations. This class provides mutation strategies for modifying, adding, or removing obstacles in a test configuration. It is designed to work with a generator that supplies obstacle parameters and normalization/denormalization methods for the test representation.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
do_mutation |
Applies a random mutation (modification, addition, or removal of an obstacle) to the input solution |
_random_modification |
Randomly modifies three parameters of a randomly selected obstacle in the test configuration. |
_add_obstacle |
Adds a new randomly generated obstacle to the test configuration, if the maximum number is not exceeded. |
_remove_obstacle |
Removes a randomly selected obstacle from the test configuration, if more than one obstacle exists. |
Source code in ambiegen/mutation/obstacle_mutation.py
30 31 32 | |
do_mutation
do_mutation(x)
Applies a random mutation to the given solution x and returns the mutated solution if it is valid.
The mutation is selected randomly from the following options:
- Random modification of the solution.
- Addition of an obstacle.
- Removal of an obstacle.
If the mutated solution is not valid according to the validator, the original solution is returned.
Args:
x: The solution to be mutated.
Returns:
np.ndarray: The mutated solution if valid, otherwise the original solution.
Source code in ambiegen/mutation/obstacle_mutation.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
uniform_mutation
UniformMutation
UniformMutation(mut_prob=0.4)
Bases: AbstractMutation
UniformMutation applies uniform mutation to individuals in an evolutionary algorithm.
This mutation operator randomly selects genes in the input array and replaces them with new values
sampled uniformly within the allowed bounds for each gene. The probability of mutation for each gene
is controlled by un_mut_rate.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_do_mutation |
Applies the mutation operator to the input array |
_uniform_modification |
Performs uniform mutation on the input array |
Source code in ambiegen/mutation/uniform_mutation.py
27 28 | |
problems
abstract_problem
AbstractProblem
AbstractProblem(
executor_list,
generator,
n_var=10,
xl=None,
xu=None,
name="AbstractProblem",
)
Bases: ElementwiseProblem, ABC
AbstractProblem is a base class for defining optimization problems that evaluate solutions using a set of executors and a generator.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
_evaluate |
Evaluates the given solution(s) using all executors and stores the results in the output dictionary. |
name |
Returns the name of the problem. |
Source code in ambiegen/problems/abstract_problem.py
34 35 36 37 38 39 40 41 42 43 44 45 | |
name
property
name
Size of the phenotype.
| Returns: |
|
|---|
sampling
abstract_sampling
AbstractSampling
AbstractSampling(generator)
Bases: Sampling, ABC
Abstract base class for sampling strategies using a provided generator. This the basic class to be use used for sampling strategies in the evolutionary based search.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
_do |
Generates a specified number of samples using the generator. |
Source code in ambiegen/sampling/abstract_sampling.py
20 21 22 | |
greedy_sampling
GreedySampling
GreedySampling(generator, greedy_executor)
Bases: AbstractSampling
GreedySampling implements a sampling strategy that selects the best candidate out of k randomly generated tests based on their fitness, using a greedy approach.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
_do |
Generates |
_select_best_of_k |
Generates k random test cases and selects the one with the best (lowest) fitness value. |
Source code in ambiegen/sampling/greedy_sampling.py
20 21 22 | |
lhs_sampling
LHSSampling
LHSSampling(generator)
Bases: Sampling, ABC
LHSSampling implements a Latin Hypercube Sampling (LHS) strategy with additional validity checking. This class generates samples using LHS and filters them through a user-provided generator's validity function. Only samples that are considered valid by the generator are retained.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
_do |
Generates up to |
Source code in ambiegen/sampling/lhs_sampling.py
23 24 25 | |
testers
abstract_bayes_opt_tester
AbstractBayesOptTester
AbstractBayesOptTester(name='bayes_opt_test_generator')
Bases: AbstractTester
AbstractBayesOptTester provides a base structure for Bayesian optimization test generators. This abstract class defines the essential methods and initialization required for implementing Bayesian optimization testers. Subclasses should implement the abstract methods to specify problem initialization and executor setup.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
configure_algorithm |
Configure the optimization algorithm. To be implemented by subclasses if needed. |
initialize_parameters |
Initialize parameters for the optimization process. To be implemented by subclasses if needed. |
run_optimization |
Run the optimization process. To be implemented by subclasses if needed. |
initialize_problem |
Abstract method. Initialize the optimization problem. Must be implemented by subclasses. |
initialize_executor |
Abstract method. Initialize the executor for running the optimization. Must be implemented by subclasses. |
Source code in ambiegen/testers/abstract_bayes_opt_tester.py
31 32 | |
abstract_evolutionary_tester
AbstractEvolutionaryTester
AbstractEvolutionaryTester(
name="evlutionary_test_generator", config_file=None
)
Bases: AbstractTester
Abstract base class for evolutionary test generators.
This class provides a structure for initializing and configuring evolutionary search algorithms used in test generation.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
set_up_search_algorithm |
Initializes the search algorithm. |
initialize_parameters |
Sets up the parameters for the evolutionary algorithm. |
configure_algorithm |
Sets up the evolutionary algorithm |
initialize_problem |
Initializes the pymoo optimization problem. |
run_optimization |
Executes the optimization process using the configured algorithm. |
initialize_test_generator |
Abstract method to initialize the test generator, should be implemented specifically for the target problem. |
initialize_test_executors |
Abstract method to initialize the test executors, should be implemented specifically for the target problem. |
Source code in ambiegen/testers/abstract_evolutionary_tester.py
34 35 | |
configure_algorithm
configure_algorithm()
Configures and initializes the evolutionary algorithm with the specified crossover, mutation, and sampling strategies based on the current config file. This method also sets the DuplicateElimination strategy to remove duplicates during the optimization process. Experimentally obtained threshold should be used, 0.025 by default.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
initialize_parameters
initialize_parameters()
Initializes the parameters required for the test generation process. This method sets up the random seed, population size, algorithm, sampling method, crossover, and mutation strategy based on the provided configuration. If a seed is not specified in the configuration, a random seed is generated.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
initialize_problem
initialize_problem()
Initializes the pymoo optimization problem by creating an instance of AbstractProblem.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
101 102 103 104 105 106 107 108 109 110 111 | |
initialize_test_executors
abstractmethod
initialize_test_executors()
To be implemented specifically for your problem.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
139 140 141 142 143 | |
initialize_test_generator
abstractmethod
initialize_test_generator()
To be implemented specifically for your problem.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
132 133 134 135 136 | |
run_optimization
run_optimization()
This method initializes and executes the optimization algorithm with the provided settings,
including termination criteria, random seed, verbosity, duplicate elimination, and history saving.
The optimization result is stored in the self.res attribute.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
set_up_search_algorithm
set_up_search_algorithm()
Sets up the search algorithm by initializing parameters, configuring the algorithm, and initializing the problem.
Source code in ambiegen/testers/abstract_evolutionary_tester.py
37 38 39 40 41 42 43 44 | |
abstract_evolutionary_tester_ask_tell
AbstractEvolutionaryTesterAskTell
AbstractEvolutionaryTesterAskTell(
name="evlutionary_test_generator", config_file=None
)
Bases: AbstractEvolutionaryTester
Abstract base class for evolutionary test generators.
This class provides a structure for initializing and configuring evolutionary search algorithms used in test generation.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
set_up_search_algorithm |
Initializes the search algorithm. |
initialize_parameters |
Sets up the parameters for the evolutionary algorithm. |
configure_algorithm |
Sets up the evolutionary algorithm |
initialize_problem |
Initializes the pymoo optimization problem. |
run_optimization |
Executes the optimization process using the configured algorithm. |
initialize_test_generator |
Abstract method to initialize the test generator, should be implemented specifically for the target problem. |
initialize_test_executors |
Abstract method to initialize the test executors, should be implemented specifically for the target problem. |
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
38 39 40 41 42 | |
ask
ask()
Generates and returns a new population of candidate solutions using the underlying evolutionary method.
| Returns: |
|
|---|
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
87 88 89 90 91 92 93 94 95 96 | |
initialize_test_executors
initialize_test_executors()
To be implemented specifically for your problem.
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
129 130 131 132 | |
initialize_test_generator
abstractmethod
initialize_test_generator()
To be implemented specifically for your problem.
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
121 122 123 124 125 | |
set_up_search_algorithm
set_up_search_algorithm()
Sets up the search algorithm by initializing parameters, configuring the algorithm, and initializing the problem.
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
tell
tell(population)
Provides the test results back to the tester.
Source code in ambiegen/testers/abstract_evolutionary_tester_ask_tell.py
98 99 100 | |
abstract_fuzzing_tester
AbstractFuzzingTester
AbstractFuzzingTester(name='fuzzing_test_generator')
Bases: AbstractTester
Abstract base class for fuzzing testers, extending AbstractTester. This class provides a template for implementing fuzzing-based testing strategies. It defines the structure for configuring algorithms, initializing parameters, and running optimization routines. Subclasses must implement the abstract methods for initializing executors and test generators.
Args:
name (str): The name of the fuzzing tester instance. Defaults to "fuzzing_test_generator".
Methods:
| Name | Description |
|---|---|
configure_algorithm |
Configure the fuzzing algorithm. To be implemented by subclasses if needed. |
initialize_parameters |
Initialize parameters required for fuzzing. To be implemented by subclasses if needed. |
run_optimization |
Run the optimization process for fuzzing. To be implemented by subclasses if needed. |
initialize_executors |
Abstract method. Initialize the executors responsible for running tests. Must be implemented by subclasses. |
initialize_test_generator |
Abstract method. Initialize the test generator for producing test cases. Must be implemented by subclasses. |
Source code in ambiegen/testers/abstract_fuzzing_tester.py
35 36 | |
abstract_tester
AbstractTester
AbstractTester(
name="abstract_test_generator", config_file=None
)
Bases: ABC
Abstract base class for test generation and execution workflows. This class defines the interface for creating test generators, executors, and search algorithms, as well as running optimization processes for automated testing. Subclasses must implement the abstract methods to provide concrete functionality for initializing test generators, executors, search algorithms, and running the optimization process.
| Parameters: |
|
|---|
Methods:
| Name | Description |
|---|---|
initialize_test_generator |
Main purpose of this method is to generate random tests. Must be implemented by subclasses. |
initialize_test_executors |
This method should launch and evalute the target system or function. Must be implemented by subclasses. |
set_up_search_algorithm |
Abstract method to set up the search algorithm. Must be implemented by subclasses. |
run_optimization |
Abstract method to run the optimization process. Must be implemented by subclasses. |
start |
Orchestrates the initialization and execution of the test generation and optimization process by calling the respective methods in sequence. |
Source code in ambiegen/testers/abstract_tester.py
35 36 37 | |
get_results
get_results()
Retrieves the results of the test generation and optimization process. To be used with ask and tell interface.
Source code in ambiegen/testers/abstract_tester.py
106 107 108 109 110 | |
initialize
initialize()
Initializes the tester by setting up the necessary components. To be used with ask and tell interface.
Source code in ambiegen/testers/abstract_tester.py
97 98 99 100 101 102 103 | |
initialize_test_executors
abstractmethod
initialize_test_executors()
Initializes the test executor. This method should be implemented specifically for your problem. It should launch and evaluate the target system or function.
Source code in ambiegen/testers/abstract_tester.py
55 56 57 58 59 60 61 62 | |
initialize_test_generator
abstractmethod
initialize_test_generator()
Initializes the test generator.
This method should be implemented specifically for your your problem.
It should generate random tests, check their validity, do conversion
between genotype and phenotype representations. For more details,
refer to the AbstractGenerator class.
| Raises: |
|
|---|
Source code in ambiegen/testers/abstract_tester.py
40 41 42 43 44 45 46 47 48 49 50 51 52 | |
run_optimization
abstractmethod
run_optimization()
Runs the optimization process to generate test cases.
This method should be implemented by subclasses to execute the optimization algorithm.
Source code in ambiegen/testers/abstract_tester.py
73 74 75 76 77 78 79 80 | |
set_up_search_algorithm
abstractmethod
set_up_search_algorithm()
Initializes or configures the search algorithm to be used in the testing process.
This method should be implemented by subclasses.
Source code in ambiegen/testers/abstract_tester.py
64 65 66 67 68 69 70 71 | |
start
start()
Function to start the test generation and optimization process. To be used when evaluation happens within the optimization process.
| Returns: |
|
|---|
Source code in ambiegen/testers/abstract_tester.py
82 83 84 85 86 87 88 89 90 91 92 93 94 | |
uav_tester
UAVTester
UAVTester(config_file=None)
Bases: AbstractEvolutionaryTester
UAVTester is a specialized tester class for generating and executing UAV (Unmanned Aerial Vehicle) test datasets using obstacle scenes.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
initialize_test_generator |
Sets up the obstacle scene generator using a predefined case study and a maximum number of obstacles. |
initialize_test_executors |
Initializes the test executors for the UAV test generator, specifically using RRTExecutor. |
Source code in ambiegen/testers/uav_tester.py
26 27 28 | |
initialize_test_executors
initialize_test_executors()
Initializes the executor for the UAV test generator. The number of executors in the list corresponds to the number of search objectives. Minimum fitness is set to 25.0, which is the minimum path length for the RRT algorithm to identify to count the test as challenging
Source code in ambiegen/testers/uav_tester.py
42 43 44 45 46 47 48 | |
initialize_test_generator
initialize_test_generator()
Initializes the test generator for UAV testing.
This method sets up an ObstacleGenerator instance.
Source code in ambiegen/testers/uav_tester.py
30 31 32 33 34 35 36 37 38 39 40 | |