Page 1 of 1

Bipolar rule family, with code for Golly, LifeViewer, SquareCell and CAViewer

Posted: May 6th, 2020, 11:18 am
by martin.novy
EDIT: big thanks for the Golly ruletable implementation ...
bubblegum wrote: May 11th, 2020, 1:38 am

Code: Select all

x = 4, y = 12, rule = bipolar00
.3A$.B.A$AB.A$.2A5$.3B$.A.B$BA.B$.2B!
Screenshot from 2020-05-06 1535.png
Screenshot from 2020-05-06 1535.png (62.84 KiB) Viewed 4146 times
In theory, my bipolar rules need cell states -1 , 0, +1

In practice, they can be simulated by 1, 0, 2

Then the bipolar rules become a subfamily of SquareCell rule_table rules ... generalized multistate weighted outer totalistic with ranges 1 and 2


bipolar rules need special "transformed values" (called "state weights" in SquareCell)
for states 0,1,2:

in theory, transformed values should be 0,-1,1

in practice, I added +1
to each of them, so values are: 1,0,2
and then I added +9 to my thresholds

File bipolar00.sqc for SquareCell is at
https://conwaylife.com/forums/viewtopic ... 214#p96214


File bipolar00/transFunc.py for CAViewer is at
https://conwaylife.com/forums/viewtopic ... 214#p96219

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 7th, 2020, 12:45 pm
by bubblegum
Could you please explain this a bit better for people who don't understand Square Cell and can't get Python 3.x to work (or one of its dependencies)?
All I'm getting is that there are 3 states because the Rule Table part of Square Cell counts as modern art

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 7th, 2020, 1:08 pm
by martin.novy
bubblegum wrote: May 7th, 2020, 12:45 pm Could you please explain this a bit better for people who don't understand Square Cell and can't get Python 3.x to work (or one of its dependencies)?
All I'm getting is that there are 3 states because the Rule Table part of Square Cell ...
Thanks for asking.


> can't get Python 3.x to work (or one of its dependencies)

What happened? We can probably help.


> the Rule Table part of Square Cell ...

#Counts = 19
... when 9 cells 0..2 are summed, the sum is 0..18

#SW 1,0,2
... "state weights" ... "values" for states 0, 1, 2

#NW 0,0,0,0,0
#NW 0,1,1,1,0
#NW 0,1,1,1,0
#NW 0,1,1,1,0
#NW 0,0,0,0,0
... neighborhood weights

#RT 0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0
#RT 0,0,0,0,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0
#RT 0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,0,0,0,0
... rule_table

#L .3A$.B.A$AB.A$.2A
... a pattern in RLE

> for people who don't understand Square Cell

(there is some documentation viewtopic.php?f=11&t=4377 )

----

(and, by the way, Primordia rules seem more interesting than Bipolar rules ...
https://conwaylife.com/forums/viewtopic ... 327#p96327 )

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 7th, 2020, 1:44 pm
by bubblegum
martin,novy wrote: May 7th, 2020, 1:08 pm > can't get Python 3.x to work (or one of its dependencies)

What happened? We can probably help.
What happened? Well most people use 2.x, that's what happened (but I'm not complaining to you)
i'm fine with 3.x myself though

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 7th, 2020, 8:59 pm
by lemon41625
If you can't get Python 3.x to work you could also install CAViewer here:
https://github.com/jedlimlx/Cellular-Automaton-Viewer

I comes with a WinPython Installation. Once downloaded, you can just run Main.bat and the program will start.
There is no need to install Python 3.x.
(I am assuming you use Windows)

As for the SQC ruletable,
Let's say I have the following neighbourhood weights:
1 2 3 2 1
2 4 6 4 2
3 6 9 6 3
2 4 6 4 2
1 2 3 2 1

I also have the following state weights,
0, -1, 1

Now, let's say I have cells in this configuration:
0 0 0 1 0
0 0 1 0 0
0 0 2 0 0
0 2 0 0 2
0 0 0 0 0

The neighbourhood sum would be -1 * 2 + -1 * 6 + 1 * 9 + 1 * 4 + 2 * 2 = -2 + -6 + 9 + 4 + 2 = 7
Now, looking at the following ruletable
0,0,0,0,1,0,0,0
1,1,2,1,1,2,1,1
2,2,2,2,2,2,1,1

A neighbourhood count of 7 would mean the new cell's state is 1 (the row number is the current state of the cell, the column number is the neighbourhood sum, both 0-indexed).

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 10th, 2020, 10:37 pm
by bprentice
Martin,

Your 3 state square cell rule specified in this dialog:

rd.png
rd.png (111.46 KiB) Viewed 4013 times

generates patterns with interesting behavior. If a pattern is modified by changing all state 2 cells to state 3 and all state 3 cells to state 2, the resulting pattern will behave the same as the original pattern. For example this picture shows two 2c/4 orthogonal ships:

s.png
s.png (427.92 KiB) Viewed 4013 times

Randomly changing the Rule Table while keeping the same State Weights and Neighbor Weights produces many interesting rules. However, these rules do not share the same reversible property that your rule has.

Please explain.


Brian Prentice

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 11th, 2020, 1:38 am
by bubblegum
lemon4l625 wrote: May 7th, 2020, 8:59 pm If you can't get Python 3.x to work you could also install CAViewer here:
https://github.com/jedlimlx/Cellular-Automaton-Viewer

I comes with a WinPython Installation. Once downloaded, you can just run Main.bat and the program will start.
There is no need to install Python 3.x.
(I am assuming you use Windows)
-snip-
...Wait, are you talking to me?
ah. I can use 3.x fine. 2.x is a different story.
(however, if i am something pretty much nobody else is going to be the same)

omg thank you for the sqc explanation i should try it out

Checking out this bipolar rule (subset of 3sr1mca) it seems to be B304152/M405162/S20303141425253/B031425/M041526/S02031314242535 which makes it clear why it's 1-2 reversible: each configuration, when 1-2-inverted, becomes the same in one generation as if the original configuration was run for one generation and then 1-2-inverted.
Other rules with this property:
B2130/M/S02031112202130/B0312/M/S02031112202130 (Immigration)
B2130/M/S2030/B0312/M/S0203 (DeadlyEnemies)
B30/M/S2030ll-0/B03/M/S0203l-0l (Symbiosis)

(EDIT2: I believe any 3-state rule where the transitions have reflectional symmetry over the middle column or line but the colours are inverted and whose alive transitions are offset by a row have this property)

Explanation of (B/M/S)*2 notation:
Each transition is a group of two numbers. These represent the count of state-1 cells, then state-2.
The first B/M/S set describes birth, mutation (alive -> other alive) and survival conditions for state 1, and the second set for state 2.
l is a special character meaning "all", so par exemple Bl2 = B02122232425262, Ml-31 = M01112141516171 and S2l-4-534 = S202122232634 (note that the extra minus signs are necessary to prevent ambiguity).
If you think this is confusing, this is one of the best ways for conciseness and uniqueness so like Brian's Brain (/2/3 or B2l/Mll/S/B/M/S) doesn't have to be expressed like this:
B20212223242526/M000102030405060708101112131415161720212223242526303132333435404142434450515253606162707180/S/B/M/S

and for people who can't get either to work here is the golly ruletable:

Code: Select all

@RULE bipolar00

@TABLE
n_states:3
neighborhood:Moore
symmetries:permute

var aa={0,1,2}
var ab=aa
var ac=aa
var ad=aa
var ae=aa
var af=aa
var ag=aa
var ah=aa
var ba={0,2}
var bb={0,1}
var c={1,2}

0,c,c,c,0,0,0,0,0,c
0,1,1,1,1,2,0,0,0,1
0,1,1,1,1,1,2,2,0,1
0,2,2,2,2,1,0,0,0,2
0,2,2,2,2,2,1,1,0,2

1,1,1,1,1,0,0,0,0,2
1,1,1,1,1,1,2,0,0,2
1,1,1,1,1,1,1,2,2,0
2,2,2,2,2,0,0,0,0,1
2,2,2,2,2,2,1,0,0,1
2,2,2,2,2,2,2,1,1,1

c,c,c,0,0,0,0,0,0,c
1,1,1,1,ba,0,0,0,0,1
1,1,1,1,1,2,ba,0,0,1
1,1,1,1,1,1,2,2,ba,1
2,2,2,2,bb,0,0,0,0,2
2,2,2,2,2,1,bb,0,0,2
2,2,2,2,2,2,1,1,bb,2

c,aa,ab,ac,ad,ae,af,ag,ah,0
EDIT: aand i forgot the death transitions

Code: Select all

x = 4, y = 12, rule = bipolar00
.3A$.B.A$AB.A$.2A5$.3B$.A.B$BA.B$.2B!

Re: Bipolar rules ... a new(?) rule family, with natural spaceships, with code for SquareCell and CAViewer

Posted: May 11th, 2020, 6:04 am
by FWKnightship
P5,P6,P8:

Code: Select all

x = 39, y = 20, rule = bipolar00
7.2B10.A10.A4.A$2B5.2B9.3A7.3A4.3A$2B.3A10.A3.A8.A2.2A2.A$7.A8.3A$2.A
4.A9.A$2.A4.A$2.A$4.3A.2B$.2B5.2B21.3B$.2B2$32.A.A$27.B2.2A2.A$27.B7.
A2.B$27.B2.A7.B$31.A2.2A2.B$31.A.A3$31.3B!

Re: Bipolar rule family, with code for Golly, LifeViewer, SquareCell and CAViewer

Posted: May 11th, 2020, 12:19 pm
by bprentice
bubblegum,

Please read this:

viewtopic.php?f=11&t=3479&p=62281#p62281

Here are some recent examples that use Square Cell's 'Rule Table' :

New Rules.zip
(695.15 KiB) Downloaded 179 times

Rules 002, 132, 136, 140 and 141 also contain Golly patterns. Rule 002 is an omniperiodic variant of 'Wire World'.

Brian Prentice

Re: Bipolar rule family, with code for Golly, LifeViewer, SquareCell and CAViewer

Posted: July 5th, 2020, 12:01 am
by Yoel
Just a few days ago, I invented a "bipolar" symmetrical rule Twolives:

viewtopic.php?f=11&t=4580#p99994