Skip to content

Commit

Permalink
Add RandomProperty mockup (#41, #39)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Mar 7, 2019
1 parent e6024b1 commit 965c39e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions xentica/core/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,3 +509,16 @@ def is_born(self, num_neighbors):
"""
return (self >> (num_neighbors + self._num_neighbors + 1)) & 1


class RandomProperty(Property):
"""A property yielding random value each time."""

def __init__(self):
self._buf_num = 0
super(RandomProperty, self).__init__()
raise NotImplementedError

def calc_bit_width(self):
"""Really dirty 16-bit PRNG."""
return 16

0 comments on commit 965c39e

Please sign in to comment.