Coverage for moptipy / spaces / __init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.12.0, created at 2025-11-24 08:49 +0000

1""" 

2In this package, some pre-defined search and solution spaces are provided. 

3 

4These spaces implement the base class :class:`~moptipy.api.space.Space`, which 

5defines the API for creating, copying, storing, and comparing (for equality) 

6of data structures that can be used to represent either points in the search 

7space or candidate solutions in the solution space. 

8 

9The following pre-defined spaces are currently available: 

10 

11- :class:`~moptipy.spaces.bitstrings.BitStrings`, the space of `n`-dimensional 

12 bit strings 

13- :class:`~moptipy.spaces.intspace.IntSpace`, a space of `n`-dimensional 

14 integer strings, where each element is between (and including) a minimum 

15 and a maximum value (inclusive) 

16- :class:`~moptipy.spaces.permutations.Permutations` is a special version of 

17 the :class:`~moptipy.spaces.intspace.IntSpace` where all elements are 

18 permutations of a base string 

19 :attr:`~moptipy.spaces.permutations.Permutations.blueprint`. This means that 

20 it can represent permutations both with and without repetitions. Depending 

21 on the base string, each element may occur an element-specific number of 

22 times. For the base string `(-1, -1, 2, 7, 7, 7)`, for example, `-1` may 

23 occur twice, `2` can occur once, and `7` three times. 

24- :class:`~moptipy.spaces.ordered_choices.OrderedChoices` is a combination of 

25 permutations and combinations. There are `n` choices of one or multiple 

26 different values each. The choices are either disjoint or identical. An 

27 element from the space picks one value per choice. The order of the elements 

28 matters. 

29- :class:`~moptipy.spaces.vectorspace.VectorSpace` is the space of 

30 `n`-dimensional floating point number vectors 

31"""