sweetpea.sampling_strategies.uniform_combinatoric module¶
- class sweetpea.sampling_strategies.uniform_combinatoric.UniformCombinatoricSamplingStrategy¶
Bases:
sweetpea.sampling_strategies.base.SamplingStrategy
This strategy represents the ideal. Valid sequences are uniformly sampled via a bijection from natural numbers to valid trial sequences.
Right now, the intent is that this will only work for designs without complex windows. Once we get that far, we can think about what steps are needed to support complex windows. (
Transition
, etc.)This also doesn’t quite work yet for
_KInARow
constraints, which represent a similar obstacle as the complex windows. However, it will still accept designs with constraints. When such designs are given, it will do rejection sampling to ensure that only valid sequences are returned. The metrics dictionary will include data pertaining to the number of samples rejected for each final sample, as well as an average. (On average, how many samples need to be generated before one is found that is satisfactory?)- static sample(block, sample_count)¶
- Parameters
block (sweetpea.blocks.Block) –
sample_count (int) –
- Return type
- class sweetpea.sampling_strategies.uniform_combinatoric.UCSolutionEnumerator(block)¶
Bases:
object
- Parameters
block (sweetpea.blocks.FullyCrossBlock) –
- Return type
- solution_count()¶
- generate_random_sample(sample_array)¶