gameanalysis.collect module

class gameanalysis.collect.BitSet[source]

Bases: object

Set of bitmasks

A bitmask is in the set if all of the true bits have been added

add(bitmask)[source]
clear()[source]
class gameanalysis.collect.DynamicArray(item_shape, dtype=None, initial_room=8, grow_fraction=2)[source]

Bases: object

A object with a backed array that also allows adding data

append(array)[source]

Append an array

compact()[source]

Trim underlying storage to hold only valid data

data

A view of all of the data

ensure_capacity(new_capacity)[source]

Make sure the array has a least new_capacity

pop(num=None)[source]

Pop one or several arrays

class gameanalysis.collect.MixtureSet(tolerance)[source]

Bases: object

A set of mixtures

Elements are only kept if the norm of their difference is greater than the tolerance.

add(mixture)[source]
clear()[source]
class gameanalysis.collect.WeightedSimilaritySet(is_similar)[source]

Bases: object

A set of non-similar elements prioritized by weight

Allows adding a bunch of weighted elements, and when iterated, only iterates over dissimilar elements with the lowest weights. Adding new elements that are similar to the existing set, but with higher weights won’t change the set returned.

add(item, weight)[source]
clear()[source]