Page 1 of 1

State symmetry

Posted: June 14th, 2010, 7:23 pm
by Keiji
I was just thinking about the possibility of implementing some kind of "state symmetry" in the ruletable format.

Basically, it would allow you to have a single state which would have "varieties" for north, south, east or west if it were fourfold, or horizontal and vertical if it were twofold. Then a transition could be defined from one state to another if there was a certain variety of a certain state in a certain point in the neighborhood.

For example, take von Neumann, with 29 states. The 16 directional states could be replaced with 4 fourfold states. However, the construction method would have to change: there would be one code for constructing an arrow in the same direction, another for a left turn, another for a right turn, and another for backwards. A tentative ruletable for this would look as follows (I'm only showing the rules for construction here and no others, just to show the difference produced by having state symmetry):

Code: Select all

# 1: sensitised
# 2: sensitised transmission
# 3: sensitised transmission normal
# 4: sensitised transmission special
# 5: sensitised transmission normal straight
# 6: sensitised transmission normal turn
# 7: sensitised transmission special straight
# 8: sensitised transmission special turn
# 9: transmission normal inactive
# 10: transmission normal active
# 11: transmission special inactive
# 12: transmission special active
# 13: confluent quiescent
# 14: confluent excited
# 15: confluent quiescent active
# 16: confluent excited active

# C,N,E,S,W,C'
n_states:17
neighborhood:vonNeumann
symmetries:rotate4

statesym,1-12:4

var a={0,1,2,3}
var b={10,12}

0,b.a,0,0,0,1.a

1.a,0,0,0,0,13
1.a,b.a,0,0,0,2.a
2.a,0,0,0,0,3.a
2.a,b.a,0,0,0,4.a
3.a,0,0,0,0,5.a
3.a,b.a,0,0,0,6.a
4.a,0,0,0,0,7.a
4.a,b.a,0,0,0,8.a
5.a,0,0,0,0,9.a
5.a,b.a,0,0,0,9.a+2
6.a,0,0,0,0,9.a+1
6.a,b.a,0,0,0,9.a+3
7.a,0,0,0,0,11.a
7.a,b.a,0,0,0,11.a+2
8.a,0,0,0,0,11.a+1
8.a,b.a,0,0,0,11.a+3
The statesym line says states 1 to 12 all have fourfold symmetry, variable a is used bound for the direction of any signal which is inherited by the cell being constructed. I've used . to indicate a variation of a state, and + to indicate addition modulo 4 to the variation itself. So as you can see this allows the inputs 10 for confluent, 11000 for normal straight, 11001 for normal reverse, 11010 for normal left turn (assuming addition goes counterclockwise), 11011 for normal right turn, 11100 for special straight and so forth.

Hopefully you'll understand what I'm getting at here, and perhaps it will be of some use - the most annoying thing IMO about JvN is that you cannot just rotate a region and expect it to work, as not only are the states different but the construction codes are also different. Using state symmetry, Golly will be able to "rotate" the cells as well as the arrangements of the cells for you, and the orientation is not of any concern to the user.

Re: State symmetry

Posted: June 14th, 2010, 10:58 pm
by Axaj
The idea is sound, but would most likely be better done by using a python script that changes the states to their appropriate rotated form; a more efficient approach would to just have a line in the rule table/tree with the name of the python script that changes the states to match the rotation, but I don't think that's possible by the way rule tables are processed. There could be an option in the Golly preferences that you would use in the same fashion; name the python script and the rule table/tree and it can process it when you rotate.

Re: State symmetry

Posted: June 14th, 2010, 11:58 pm
by Keiji
Well yes, it would be far simpler for the Golly team to just add an option to run a script when you rotate an area. However, doing the full state-symmetry idea would also let you cut down on the size and complexity of the ruletable.

Re: State symmetry

Posted: June 15th, 2010, 2:28 am
by apg
there would be one code for constructing an arrow in the same direction, another for a left turn, another for a right turn, and another for backwards.
Yes, it's called Hutton32.

Re: State symmetry

Posted: June 15th, 2010, 5:13 am
by Keiji
Oh! Well, thank you for that piece of information. I'm glad someone thought to implement that. It'd still be nice to rotate directional states in Golly, though.