moptipy.tests package¶
Code for testing of implementations of different parts of the moptipy API.
In this package, we provide code that can be used to test different parts of the moptipy API and implementation. These are not unit tests, but rather code that can be used to build unit tests. If you want to use moptipy in your code, then likely you will implement own algorithms and operators. If you want to test whether they comply with the moptipy specifications, then the functions here will be helpful. Functions that can be used to test algorithm implementations. Check whether an algorithm follows the moptipy API specification. algorithm ( solution_space ( objective ( search_space ( encoding ( max_fes ( required_result ( uses_all_fes_if_goal_not_reached ( is_encoding_deterministic ( post ( ValueError – if algorithm does not behave like it should Functions that can be used to test component implementations. Functions that can be used to test encodings. Check whether an object is a proper moptipy encoding. encoding ( search_space ( make_search_space_element_valid ( solution_space ( is_deterministic ( ValueError – if encoding is not a valid TypeError – if encoding is of the wrong type or a wrong type is encountered Test fitness assignment processes. Functions that can be used to test multi-objective algorithms. Check whether a multi-objective algorithm follows the moptipy API. algorithm ( solution_space ( problem ( search_space ( encoding ( max_fes ( is_encoding_deterministic ( TypeError – if algorithm is not a ValueError – if algorithm does not behave like it should Functions for testing multi-objective archive pruners. Check whether an object is a moptipy multi-objective optimization pruner. This method checks whether the class is correct and whether the pruning follows the general contract: Interesting records in the list to be pruned are moved to the front, the ones to discard are moved to the back. No record is lost and none is duplicated. pruner_factory ( dtypes ( ValueError – if mo_problem is not a valid TypeError – if values of the wrong types are encountered Functions for testing multi-objective optimization problems. Check whether an object is a moptipy multi-objective optimization problem. mo_problem ( solution_space ( make_solution_space_element_valid ( is_deterministic (bool) – is the objective function deterministic? lower_bound_threshold ( upper_bound_threshold ( must_be_equal_to ( ValueError – if mo_problem is not a valid TypeError – if values of the wrong types are encountered Functions that can be used to test objective functions. Check whether an object is a moptipy objective function. objective ( solution_space ( make_solution_space_element_valid ( is_deterministic (bool) – is the objective function deterministic? lower_bound_threshold ( upper_bound_threshold ( must_be_equal_to ( ValueError – if objective is not a valid TypeError – if values of the wrong types are encountered Test stuff on bit strings. Get a sequence of bit strings for tests. the sequence of BitStrings Check the validity of a black-box algorithm on a bit strings problem. algorithm ( objective ( dimension ( max_fes ( required_result ( uses_all_fes_if_goal_not_reached ( post ( Check the validity of a black-box algorithm on LeadingOnes. Check the validity of a black-box algorithm on OneMax. Validate a fitness assignment process on bit strings. fitness ( class_needed ( prepare_objective ( Check the validity of a black-box algorithm on OneMax and ZeroMax. algorithm ( Check the validity of an algorithm on OneMax, ZeroMax, and Ising1d. algorithm ( Check a black-box multi-objective algorithm on a bit strings problem. algorithm ( problem ( dimension ( max_fes ( Validate the unary operator on one bit strings instance. op0 ( search_space ( number_of_samples ( min_unique_samples ( Validate the unary operator on several BitStrings instances. Validate the unary operator on one BitStrings instance. op1 ( search_space ( number_of_samples ( min_unique_samples ( Validate the unary operator on several BitStrings instances. Validate the step-sized unary operator on one BitStrings instance. op1 ( search_space ( number_of_samples ( min_unique_samples ( step_sizes ( get_step_size ( Validate the unary operator on several BitStrings instances. op1 ( number_of_samples ( min_unique_samples ( step_sizes ( get_step_size ( Validate the binary operator on one BitStrings instance. op2 ( search_space ( number_of_samples ( min_unique_samples ( Validate the binary operator on several BitStrings instances. Perform tests on the Job Shop Scheduling Problem. Get a sequence of JSSP instances to test on. Make a function that creates valid Gantt charts. Check the validity of a black-box algorithm on the JSSP. algorithm ( instance ( max_fes ( required_result ( post ( Validate an algorithm on a set of JSSP instances. algorithm ( max_fes ( post ( Check the validity of a black-box multi-objective algorithm on the JSSP. algorithm ( instance ( max_fes ( Validate a multi-objective algorithm on a set of JSSP instances. algorithm ( Validate an objective function on 1 JSSP instance. Test stuff on ordered choices-based spaces. Get a sequence of ordered choices for tests. choice_filter ( the sequence of ordered choices Create a function that can make ordered choices valid. choices ( the function Validate the nullary operator on one OrderedChoices instance. op0 ( search_space ( number_of_samples ( min_unique_samples ( Validate the nullary operator on several OrderedChoices instances. op0 ( number_of_samples ( min_unique_samples ( choice_filter ( Test stuff on permutations with repetitions. Create a function that can make permutations with repetitions valid. pwr ( the function Get a sequence of permutations for tests. perm_filter ( the sequence of Permutations Validate the nullary operator on one Permutations instance. op0 ( search_space ( number_of_samples ( min_unique_samples ( Validate the nullary operator on several Permutations instances. op0 ( number_of_samples ( min_unique_samples ( perm_filter ( Validate the unary operator on one Permutations instance. op1 ( search_space ( number_of_samples ( min_unique_samples ( Validate the unary operator on several Permutations instances. op1 ( number_of_samples ( min_unique_samples ( perm_filter ( Validate the step-sized unary operator on one Permutations instance. op1 ( search_space ( number_of_samples ( min_unique_samples ( step_sizes ( get_step_size ( Validate the unary operator on several Permutations instances. op1 ( number_of_samples ( min_unique_samples ( step_sizes ( get_step_size ( perm_filter ( Validate the binary operator on one Permutations instance. op2 ( search_space ( number_of_samples ( min_unique_samples ( Validate the binary operator on several Permutations instances. op2 ( number_of_samples ( min_unique_samples ( perm_filter ( Test stuff on signed permutations with repetitions. Create a function that can make permutations with repetitions valid. pwr ( the function Get a sequence of permutations for tests. perm_filter ( the sequence of SignedPermutations Validate the nullary operator on one SignedPermutations instance. op0 ( search_space ( number_of_samples ( min_unique_samples ( Validate the nullary operator on several SignedPermutations instances. op0 ( number_of_samples ( min_unique_samples ( perm_filter ( Validate the unary operator on one SignedPermutations instance. op1 ( search_space ( number_of_samples ( min_unique_samples ( Validate the unary operator on several SignedPermutations instances. op1 ( number_of_samples ( min_unique_samples ( perm_filter ( Test stuff on real vectors. The dimensions for tests Create a function that can make a vector space element valid. space ( the function Check the validity of a black-box algorithm on Ackley’s function. algorithm ( uses_all_fes_if_goal_not_reached ( dims ( post ( Check the validity of a black-box algorithm on vector problems. algorithm ( objective ( max_fes ( uses_all_fes_if_goal_not_reached (default: dims ( post ( Validate the nullary operator on one VectorSpace instance. op0 ( search_space ( number_of_samples ( min_unique_samples ( Validate the nullary operator on default VectorSpace instance. op0 ( number_of_samples ( min_unique_samples ( Functions that can be used to test nullary search operators. Check whether an object is a valid moptipy nullary operator. op0 ( search_space ( make_search_space_element_valid ( number_of_samples ( min_unique_samples ( ValueError – if op0 is not a valid instance of TypeError – if invalid types are encountered Functions that can be used to test unary search operators. Compute the default number of minimum unique samples. Check whether an object is a valid moptipy unary operator. op1 ( search_space ( make_search_space_element_valid ( number_of_samples ( min_unique_samples ( ValueError – if op1 is not a valid instance of TypeError – if incorrect types are encountered Functions for testing unary search operators with step size. Check whether an object is a valid moptipy unary operator with step size. op1 ( search_space ( make_search_space_element_valid ( number_of_samples ( min_unique_samples ( step_sizes ( get_step_size ( ValueError – if op1 is not a valid instance of TypeError – if incorrect types are encountered Functions that can be used to test binary search operators. Check whether an object is valid a moptipy binary operator. op2 ( search_space ( make_search_space_element_valid ( number_of_samples ( min_unique_samples ( ValueError – if op2 is not a valid instance of TypeError – if incorrect types are encountered Validate selection algorithms. Validate a selection algorithm. selection ( without_replacement ( lower_source_size_limit ( upper_source_size_limit ( Functions that can be used to test spaces. Check whether an object is a moptipy space. space ( make_element_valid ( make_element_invalid ( ValueError – if space is not a valid instance of TypeError – if incorrect types are encounteredSubmodules¶
moptipy.tests.algorithm module¶
Algorithm
) – the algorithm to testSpace
) – the solution spaceObjective
) – the objective functionSpace
| None
, default: None
) – the optional search spaceEncoding
| None
, default: None
) – the optional encodingint
, default: 100
) – the maximum number of FEsint
| float
| None
, default: None
) – the optional required result qualitybool
, default: True
) – will the algorithm use all FEs unless it reaches the goal?bool
, default: True
) – is the encoding deterministic?Optional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parametermoptipy.tests.component module¶
moptipy.tests.encoding module¶
Encoding
) – the encoding to testSpace
| None
, default: None
) – the search spaceOptional
[Callable
[[Any
], Any
]], default: <function <lambda> at 0x7f667fecb920>
) – a method that can turn a point from the space into a valid pointSpace
| None
, default: None
) – the solution spacebool
, default: True
) – is the mapping deterministic?Encoding
moptipy.tests.fitness module¶
moptipy.tests.mo_algorithm module¶
MOAlgorithm
) – the algorithm to testSpace
) – the solution spaceMOProblem
) – the problem to solveSpace
| None
, default: None
) – the optional search spaceEncoding
| None
, default: None
) – the optional encodingint
, default: 100
) – the maximum number of FEsbool
, default: True
) – is the encoding deterministic?MOAlgorithm
instancemoptipy.tests.mo_archive_pruner module¶
Callable
[[MOProblem
], MOArchivePruner
]) – the creator for the multi-objective archive pruner to testIterable
[dtype
], default: (dtype('int8'), dtype('uint8'), dtype('int16'), dtype('uint16'), dtype('int32'), dtype('uint32'), dtype('int64'), dtype('uint64'), dtype('float64'))
) – the dtypes to test onMOProblem
moptipy.tests.mo_problem module¶
MOProblem
) – the multi-objective optimization problem to testSpace
| None
, default: None
) – the solution spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667f82ee80>
) – a function that makes an element from the solution space validint
| float
, default: -inf
) – the threshold for the lower boundint
| float
, default: inf
) – the threshold for the upper boundOptional
[Callable
[[Any
], int
| float
]], default: None
) – an optional function that should return the exactly same values as the objective functionMOProblem
moptipy.tests.objective module¶
Objective
) – the objective function to testSpace
| None
, default: None
) – the solution spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667fecaf20>
) – a function that makes an element from the solution space validint
| float
, default: -inf
) – the threshold for the lower boundint
| float
, default: inf
) – the threshold for the upper boundOptional
[Callable
[[Any
], int
| float
]], default: None
) – an optional function that should return the exactly same values as the objective functionObjective
moptipy.tests.on_bitstrings module¶
Union
[Algorithm
, Callable
[[BitStrings
, Objective
], Algorithm
]]) – the algorithm or algorithm factoryUnion
[Objective
, Callable
[[int
], Objective
]]) – the objective function or function factoryint
, default: 5
) – the dimension of the problemint
, default: 100
) – the maximum number of FEsUnion
[int
, Callable
[[int
, int
], int
], None
], default: None
) – the optional required result qualitybool
, default: True
) – will the algorithm use all FEs unless it reaches the goal?Optional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parameterUnion
[Fitness
, Callable
[[Objective
], Fitness
]]) – the fitness assignment process, or a callable creating itstr
| type
, default: <class 'moptipy.algorithms.so.fitness.Fitness'>
) – the required classCallable
[[Objective
], Objective
], default: <function <lambda> at 0x7f667f96ccc0>
) – prepare the objective functionUnion
[MOAlgorithm
, Callable
[[BitStrings
, MOProblem
], MOAlgorithm
]]) – the algorithm or algorithm factoryUnion
[MOAlgorithm
, Callable
[[BitStrings
, MOProblem
], MOAlgorithm
]]) – the algorithm or algorithm factoryUnion
[MOAlgorithm
, Callable
[[BitStrings
, MOProblem
], MOAlgorithm
]]) – the algorithm or algorithm factoryUnion
[MOProblem
, Callable
[[int
], MOProblem
]]) – the multi-objective optimization problem or factoryint
, default: 5
) – the dimension of the problemint
, default: 100
) – the maximum number of FEsUnion
[Op0
, Callable
[[BitStrings
], Op0
]]) – the operator or operator factoryBitStrings
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, BitStrings
], int
], None
], default: None
) – the optional unique samplesUnion
[Op1
, Callable
[[BitStrings
], Op1
]]) – the operator or operator factoryBitStrings
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, BitStrings
], int
], None
], default: None
) – the optional unique samplesUnion
[Op1WithStepSize
, Callable
[[BitStrings
], Op1WithStepSize
]]) – the operator or operator factoryBitStrings
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, BitStrings
], int
], None
], default: None
) – the optional unique samplesUnion
[Iterable
[float
], Callable
[[BitStrings
], Iterable
[float
]]], default: ()
) – the step sizes to testOptional
[Callable
[[BitStrings
, ndarray
, ndarray
], float
| None
]], default: None
) – try to get the step size from two space elementsUnion
[Op1WithStepSize
, Callable
[[BitStrings
], Op1WithStepSize
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, BitStrings
], int
], None
], default: None
) – the optional unique samplesUnion
[Iterable
[float
], Callable
[[BitStrings
], Iterable
[float
]]], default: ()
) – the step sizes to testOptional
[Callable
[[BitStrings
, ndarray
, ndarray
], float
| None
]], default: None
) – try to get the step size from two space elementsUnion
[Op2
, Callable
[[BitStrings
], Op2
]]) – the operator or operator factoryBitStrings
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, BitStrings
], int
], None
], default: None
) – the optional unique samplesmoptipy.tests.on_jssp module¶
Union
[Algorithm
, Callable
[[Instance
, Permutations
, Objective
], Algorithm
]]) – the algorithm or algorithm factorystr
| None
, default: None
) – the instance name, or None to randomly pick oneint
, default: 100
) – the maximum number of FEsint
| None
, default: None
) – the optional required result qualityOptional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parameterCallable
[[Instance
, Permutations
, Objective
], Algorithm
]) – the algorithm factoryint
, default: 100
) – the maximum FEsOptional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parameterUnion
[MOAlgorithm
, Callable
[[Instance
, Permutations
, MOProblem
], MOAlgorithm
]]) – the algorithm or algorithm factorystr
| None
, default: None
) – the instance name, or None to randomly pick oneint
, default: 100
) – the maximum number of FEsCallable
[[Instance
, Permutations
, MOProblem
], MOAlgorithm
]) – the algorithm factorymoptipy.tests.on_ordered_choices module¶
Optional
[Callable
[[OrderedChoices
], bool
]], default: None
) – an optional filter to sort out ordered choices we cannot use for testingOrderedChoices
) – the ordered choicesUnion
[Op0
, Callable
[[OrderedChoices
], Op0
]]) – the operator or operator factoryOrderedChoices
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, OrderedChoices
], int
], None
], default: None
) – the optional unique samplesUnion
[Op0
, Callable
[[OrderedChoices
], Op0
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, OrderedChoices
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[OrderedChoices
], bool
]], default: None
) – an optional filter to sort out ordered choices we cannot use for testingmoptipy.tests.on_permutations module¶
Permutations
) – the permutationsOptional
[Callable
[[Permutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op0
, Callable
[[Permutations
], Op0
]]) – the operator or operator factoryPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Op0
, Callable
[[Permutations
], Op0
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[Permutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op1
, Callable
[[Permutations
], Op1
]]) – the operator or operator factoryPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Op1
, Callable
[[Permutations
], Op1
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[Permutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op1WithStepSize
, Callable
[[Permutations
], Op1WithStepSize
]]) – the operator or operator factoryPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Iterable
[float
], Callable
[[Permutations
], Iterable
[float
]]], default: ()
) – the step sizes to testOptional
[Callable
[[Permutations
, ndarray
, ndarray
], float
| None
]], default: None
) – try to get the step size from two space elementsUnion
[Op1WithStepSize
, Callable
[[Permutations
], Op1WithStepSize
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Iterable
[float
], Callable
[[Permutations
], Iterable
[float
]]], default: ()
) – the step sizes to testOptional
[Callable
[[Permutations
, ndarray
, ndarray
], float
| None
]], default: None
) – try to get the step size from two space elementsOptional
[Callable
[[Permutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op2
, Callable
[[Permutations
], Op2
]]) – the operator or operator factoryPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Op2
, Callable
[[Permutations
], Op2
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, Permutations
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[Permutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingmoptipy.tests.on_signed_permutations module¶
SignedPermutations
) – the permutationsOptional
[Callable
[[SignedPermutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op0
, Callable
[[SignedPermutations
], Op0
]]) – the operator or operator factorySignedPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, SignedPermutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Op0
, Callable
[[SignedPermutations
], Op0
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, SignedPermutations
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[SignedPermutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingUnion
[Op1
, Callable
[[SignedPermutations
], Op1
]]) – the operator or operator factorySignedPermutations
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, SignedPermutations
], int
], None
], default: None
) – the optional unique samplesUnion
[Op1
, Callable
[[SignedPermutations
], Op1
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, SignedPermutations
], int
], None
], default: None
) – the optional unique samplesOptional
[Callable
[[SignedPermutations
], bool
]], default: None
) – an optional filter to sort out permutations we cannot use for testingmoptipy.tests.on_vectors module¶
VectorSpace
) – the vector spaceUnion
[Algorithm
, Callable
[[VectorSpace
, Objective
], Algorithm
]]) – the algorithm or algorithm factorybool
, default: True
) – will the algorithm use all FEs unless it reaches the goal?Iterable
[int
], default: (1, 2, 3, 4, 5, 10)
) – the dimensionsOptional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parameterUnion
[Algorithm
, Callable
[[VectorSpace
, Objective
], Algorithm
]]) – the algorithm or algorithm factoryUnion
[Objective
, Callable
[[VectorSpace
], Objective
]]) – the objective function or function factoryint
, default: 100
) – the maximum number of FEsTrue
) – will the algorithm use all FEs unless it reaches the goal?Iterable
[int
], default: (1, 2, 3, 4, 5, 10)
) – the dimensionsOptional
[Callable
[[Algorithm
, int
], Any
]], default: None
) – a check to run after each execution of the algorithm, receiving the algorithm and the number of consumed FEs as parameterUnion
[Op0
, Callable
[[VectorSpace
], Op0
]]) – the operator or operator factoryVectorSpace
) – the search spaceint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, VectorSpace
], int
], None
], default: <function <lambda> at 0x7f668521ed40>
) – the optional unique samplesUnion
[Op0
, Callable
[[VectorSpace
], Op0
]]) – the operator or operator factoryint
| None
, default: None
) – the optional number of samplesUnion
[int
, Callable
[[int
, VectorSpace
], int
], None
], default: <function <lambda> at 0x7f668521c9a0>
) – the optional unique samplesmoptipy.tests.op0 module¶
Op0
) – the operatorSpace
| None
, default: None
) – the search spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667fd3c540>
) – make a point in the search space validint
, default: 100
) – the number of times to invoke the operatorUnion
[int
, Callable
[[int
, Space
], int
]], default: <function <lambda> at 0x7f667fd3c400>
) – a lambda for computing the numberOp0
moptipy.tests.op1 module¶
Op1
) – the operatorSpace
| None
, default: None
) – the search spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667fd3c720>
) – make a point in the search space validint
, default: 100
) – the number of times to invoke the operatorUnion
[int
, Callable
[[int
, Space
], int
]], default: <function default_min_unique_samples at 0x7f667fd3c5e0>
) – a lambda for computing the numberOp1
moptipy.tests.op1_with_step_size module¶
Op1WithStepSize
) – the operatorSpace
| None
, default: None
) – the search spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667fd3c900>
) – make a point in the search space validint
, default: 100
) – the number of times to invoke the operatorUnion
[int
, Callable
[[int
, Space
], int
]], default: <function default_min_unique_samples at 0x7f667fd3c5e0>
) – a lambda for computing the numberIterable
[float
], default: ()
) – the step sizes to testOptional
[Callable
[[Space
, Any
, Any
], float
| None
]], default: None
) – try to get the step size difference from two space elementsOp1
moptipy.tests.op2 module¶
Op2
) – the operatorSpace
| None
, default: None
) – the search spaceOptional
[Callable
[[Generator
, Any
], Any
]], default: <function <lambda> at 0x7f667fd3ca40>
) – make a point in the search space validint
, default: 100
) – the number of times to invoke the operatorUnion
[int
, Callable
[[int
, Space
], int
]], default: <function <lambda> at 0x7f667fd3e2a0>
) – a lambda for computing the numberOp2
moptipy.tests.selection module¶
Selection
) – the selection algorithmbool
, default: False
) – is this selection algorithm without replacement, i.e., can it select each element at most once?int
, default: 0
) – the lower limit of the source sizeint
, default: 999999
) – the upper limit for the source sizemoptipy.tests.space module¶
Space
) – the space to testOptional
[Callable
[[Any
], Any
]], default: <function <lambda> at 0x7f667fec91c0>
) – a method that can turn a point from the space into a valid pointOptional
[Callable
[[Any
], Any
]], default: None
) – a method can a valid point from the space into an invalid oneSpace