ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Lifelib

For general discussion about Conway's Game of Life.

Lifelib

Postby calcyman » November 7th, 2018, 10:51 am

I've published the latest version 2.0.17 of python-lifelib to the Python Package Index (PyPI), and added some more documentation to the project. Of particular interest is the Quick Start guide, which explains how to install lifelib:

  • Ensure you have a Python distribution with numpy, jupyter, and pip. For Windows, Linux and Mac OS X, you can install the Anaconda distribution.
  • On Mac OS X, you additionally need to have the command-line developer tools installed. (Specifically, check that you can run g++ --version to ascertain that gcc or clang is installed.)
  • Download the lifelib installation script and run it.

Here's an example running in a Jupyter notebook (Python 3):

Screenshot from 2018-11-07 14-34-44.png
Screenshot from 2018-11-07 14-34-44.png (89.77 KiB) Viewed 1453 times


The .viewer() function displays an embedded copy of Chris Rowett's LifeViewer with the contents of the pattern:

Screenshot from 2018-11-07 14-35-00.png
Screenshot from 2018-11-07 14-35-00.png (42.56 KiB) Viewed 1453 times


You can easily get and set rectangles using the Python slice notation:

Screenshot from 2018-11-07 14-41-24.png
Screenshot from 2018-11-07 14-41-24.png (27.94 KiB) Viewed 1453 times


There are a few more example notebooks available here.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 1905
Joined: June 1st, 2009, 4:32 pm

Re: Lifelib

Postby calcyman » November 7th, 2018, 11:00 am

(Beginning new post since the forums only allow 3 attachments per post.)

Lifelib supports any of the rules supported by apgsearch, including History variants. You need to be careful to ensure that your lifetree has enough layers to accommodate the pattern:

Screenshot from 2018-11-07 14-49-20.png
Screenshot from 2018-11-07 14-49-20.png (108.51 KiB) Viewed 1448 times


To be safe, the number of layers should be 2 more than the ceiling of the base-2 logarithm of the number of states.

One of the more advanced features is 'pattern matching', which allows you to do a find-and-replace on patterns:

Screenshot from 2018-11-07 14-56-49.png
Screenshot from 2018-11-07 14-56-49.png (64.33 KiB) Viewed 1448 times


In this example, we replaced all of the eater5s (in two orientations) in the p57 loop with Sokwe's p3 catalyst.

By using Python code and the matplotlib plotting library, you can produce custom population plots:

Screenshot from 2018-11-07 15-03-39.png
Screenshot from 2018-11-07 15-03-39.png (47.42 KiB) Viewed 1447 times
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 1905
Joined: June 1st, 2009, 4:32 pm

Re: Lifelib

Postby calcyman » December 28th, 2018, 12:51 am

Lifelib 2.1.0 has been released. The main new feature is the ability to load rule files (.table / .tree / .rule) such as Langton's Loops:

Screenshot from 2018-12-28 04-19-47.png
Screenshot from 2018-12-28 04-19-47.png (59.31 KiB) Viewed 797 times


In particular, you can run:

sess = lifelib.load_rules('path/to/Langtons-Loops.table')


The rule format accepts arbitrary neighbourhoods (as lists of coordinate pairs) and symmetry groups (as lists of generators, each expressed as a list of disjoint cycles). For instance, instead of:

neighborhood:Moore
symmetries:rotate4reflect


you can write:

neighborhood:[(0,0), (0,-1), (1,-1), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,0)]
symmetries:[[(1, 3, 5, 7), (2, 4, 6, 8)], [(2, 8), (3, 7), (4, 6)]]


In particular, the neighbourhood on which a cell can depend is allowed to be an arbitrary subset of the 17x17 square centred on that cell. (Compare this with the Moore neighbourhood, which is a mere 3x3 square.) As such, each coordinate in each pair in the neighbourhood is allowed to range from -8 to 8, inclusive.

If you have Python 3.6 (or greater) with nutshell installed, then lifelib can additionally accept .ruel files; these are delegated to nutshell to be converted into Golly rule tables, whence they are processed identically.

As with Golly, rule files are limited to 256 states.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 1905
Joined: June 1st, 2009, 4:32 pm


Return to General Discussion

Who is online

Users browsing this forum: Moosey and 1 guest