Reversible Wireless World

For discussion of other cellular automata.
bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 21st, 2014, 10:01 am

Alexander,

I would like to code a reversible rule family using your design, but would like to completely understand the specifications before starting. There seems to be an inconsistency. Your code here:

Code: Select all

    int adjacentCount =
      (squareCell.getNeighbor(r - 1, c    ) % 2) +
      (squareCell.getNeighbor(r + 1, c    ) % 2) +
      (squareCell.getNeighbor(r    , c - 1) % 2) +
      (squareCell.getNeighbor(r    , c + 1) % 2);
    int diagonalCount =
      (squareCell.getNeighbor(r - 1, c - 1) % 2) +
      (squareCell.getNeighbor(r - 1, c + 1) % 2) +
      (squareCell.getNeighbor(r + 1, c + 1) % 2) +
      (squareCell.getNeighbor(r + 1, c - 1) % 2);
    int cell = squareCell.getNeighbor(r, c);
    int cond = ruleTable[cell % 2][adjacentCount][diagonalCount];
seems to require a 2x5x5 rule table. Also, the rule table for WIAnt-2 here:

Code: Select all

0 1 0
0 2 0
0 3 0
0 4 0
1 1 0
1 2 0
1 3 0
1 4 0
contains 4's which also seems to be inconsistent with a 2x4x4 rule table.

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 21st, 2014, 10:16 am

bprentice wrote:Alexander,

I would like to code a reversible rule family using your design, but would like to completely understand the specifications before starting. There seems to be an inconsistency. Your code here:

...
seems to require a 2x5x5 rule table. Also, the rule table for WIAnt-2 here:

...
contains 4's which also seems to be inconsistent with a 2x4x4 rule table.

Brian
Sorry, of course you right - 2x5x5 table (4 was upper bound of zero based array :( )

Alex

PS. For checking below is last "Ant+Anti-Ant" rule in old Golly *.tree format (WlAntAnti-2.tree)

Code: Select all

num_states=4
num_neighbors=8
num_nodes=26
1 0 2 1 3
1 1 3 0 2
2 0 1 0 1
2 1 1 1 1
2 0 0 0 0
2 1 0 1 0
3 2 3 2 3
3 3 3 3 3
3 4 4 4 4
3 3 5 3 5
4 6 7 6 7
4 7 7 7 7
4 8 8 8 8
4 7 9 7 9
5 10 11 10 11
5 12 12 12 12
5 11 13 11 13
6 14 15 14 15
6 15 15 15 15
6 15 16 15 16
7 17 18 17 18
7 18 18 18 18
7 18 19 18 19
8 20 21 20 21
8 21 22 21 22
9 23 24 23 24
Here is pattern form last picture

Code: Select all

x = 56, y = 24, rule = WlAntAnti-2
56C$56C$2C23.24C2.5C$2C6.2C6.2C7.22C4.C2.2C$2C5.3C6.3C6.22C2.3C2.2C$
2C2.2C.2C8.2C6.31C$2C2.2C19.22C2.3C2.2C$2C23.22C2.3C2.2C$2C.2C7.2C4.
2C5.31C$2C.2C7.2C4.3C4.31C$2C2.2C13.2C4.31C$2C2.2C19.31C$2C5.2C16.31C
$2C5.3C2.2C11.31C$2C6.2C2.2C11.31C$2C25.29C$2C9.2C6.BCA5.29C$2C9.2C
14.25C2.2C$2C10.2C.2C8.26C3.2C$2C10.2C.2C8.26C2.3C$2C23.31C$2C23.31C$
56C$56C!

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 21st, 2014, 12:15 pm

Maybe to talk about many different CA in a single thread is not a very good idea. Let's return to our ants :) .
I want to continue example with binary adder using WlAnt rule. I already mentioned switch gate and
problem with extra garbage due to two such gates. The problem may be resolved by joining the gates
into single double switch gate:

Code: Select all

# Double switch gate
x = 49, y = 15, rule = WlAnt
36.2C6.2C$18.4C13.3C6.3C$18.4C13.2C8.4C$19.2C26.2C$BCA$40.2C$24.2C8.
2C2.6C$6.2C2.2C2.2C8.2C8.2C2.2C2.2C$6.6C2.2C8.2C$8.2C$BCA$29.2C16.2C$
3.2C8.2C13.4C14.3C$3.3C6.3C13.4C14.2C$4.2C6.2C!
Half adder with such a gate provides less garbage

Code: Select all

# Half adder using double-switch gate
# First and second input line for bits
# First and second output lines for sum and carry
x = 140, y = 28, rule = WlAnt
85.2C22.4C14.2C$84.3C22.4C14.3C$84.2C24.2C16.2C3$96.2C6.2C9.4C4.2C$
78.4C13.3C6.3C8.4C4.2C4.2C$78.4C13.2C8.3C8.2C10.3C$79.2C25.2C2.2C16.
2C$30.BCA27.BCA47.2C$100.2C8.3C8.2C$84.2C8.2C3.4C9.2C6.3C$67.4C3.2C8.
2C8.2C3.4C9.3C4.3C13.2C$67.4C3.2C8.2C27.3C3.2C14.2C$68.2C44.3C16.2C$B
CA57.BCA44.2C6.2C9.2C4.3C$89.2C15.4C6.2C7.3C4.2C$63.2C8.2C13.4C13.6C
5.2C7.2C$63.3C6.3C5.2C6.4C13.2C2.3C$64.2C6.2C5.3C6.3C19.3C$79.2C8.2C
20.2C25.2C$113.2C22.3C$113.2C22.2C3$74.2C8.2C39.2C$74.3C6.4C37.3C$75.
2C6.4C37.2C!
and may be used for construction of full 1-bit adder

Code: Select all

# Full adder from half adders using double-switch gates
# First three input lines for bits and input carry
# First and second output lines for sum and output cary
x = 427, y = 56, rule = WlAnt
244.2C8.4C6.4C6.4C6.4C6.4C14.2C26.2C22.4C14.2C15.2C9.4C9.2C$243.3C8.
4C6.4C6.4C6.4C6.4C14.3C24.3C22.4C14.3C13.3C9.4C9.3C$243.2C10.2C8.2C8.
2C8.2C8.2C16.2C24.2C24.2C16.2C13.2C11.2C11.2C3$250.2C8.2C8.2C8.2C8.2C
8.2C49.2C6.2C9.4C4.2C$250.3C6.4C2.2C2.4C6.4C6.4C6.3C5.2C24.4C13.3C6.
3C8.4C4.2C4.2C$251.2C6.4C.3C2.4C6.4C6.4C6.2C6.3C23.4C13.2C8.3C8.2C10.
3C20.2C8.2C$264.2C24.2C16.2C24.2C25.2C2.2C16.2C21.3C6.3C$BCA77.BCA77.
BCA77.BCA122.2C40.2C6.2C$248.2C105.2C8.3C8.2C25.2C14.2C$247.3C26.2C6.
2C9.4C4.2C4.2C28.2C8.2C3.4C9.2C6.3C24.3C14.3C$247.2C9.4C13.3C6.3C8.4C
4.2C4.2C11.4C3.2C8.2C8.2C3.4C9.3C4.3C13.2C10.2C16.3C$258.4C13.2C8.3C
8.2C10.3C11.4C3.2C8.2C27.3C3.2C14.2C28.3C$259.2C25.2C2.2C16.2C13.2C
44.3C16.2C30.2C$40.BCA37.BCA117.BCA37.BCA47.2C70.2C6.2C9.2C4.3C17.4C
4.2C$280.2C8.3C8.2C41.2C15.4C6.2C7.3C4.2C18.4C4.2C$264.2C8.2C3.4C9.2C
6.3C15.2C8.2C13.4C13.6C5.2C7.2C26.2C$247.4C3.2C8.2C8.2C3.4C9.3C4.3C
13.2C.3C6.3C5.2C6.4C13.2C2.3C27.2C6.2C$247.4C3.2C8.2C27.3C3.2C14.2C2.
2C6.2C5.3C6.3C19.3C26.2C6.2C$248.2C44.3C16.2C8.2C9.2C8.2C20.2C25.2C8.
2C8.2C$120.BCA37.BCA37.BCA37.BCA44.2C6.2C9.2C4.3C8.2C43.2C22.3C8.3C6.
3C$269.2C15.4C6.2C7.3C4.2C54.2C22.2C10.2C5.3C$243.2C8.2C13.4C13.6C5.
2C7.2C104.2C$243.3C6.3C5.2C6.4C13.2C2.3C133.2C$244.2C6.2C5.3C6.3C19.
3C36.2C8.2C39.2C36.2C4.3C$259.2C8.2C20.2C25.2C9.3C6.4C6.4C6.4C6.2C9.
3C35.3C4.2C$293.2C22.3C9.3C6.4C6.4C6.4C6.3C8.2C36.2C$293.2C22.2C10.2C
8.2C8.2C8.2C8.2C$398.2C17.2C$398.3C15.3C$254.2C8.2C39.2C11.2C14.2C8.
2C8.2C8.2C32.3C15.2C$254.3C6.4C37.3C11.3C12.4C6.4C6.4C6.4C30.3C$255.
2C6.4C37.2C13.2C12.4C6.4C6.4C6.4C30.2C8$411.2C$411.3C$412.2C4$374.2C$
374.3C$375.2C4$299.2C$299.3C$300.2C!

twinb7
Posts: 190
Joined: February 11th, 2014, 8:08 pm
Location: Ames, Iowa

Re: Reversible Wireless World

Post by twinb7 » February 21st, 2014, 12:31 pm

This looks really cool. All I can say right now is that I'll look into it ASAP! :D

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 21st, 2014, 1:17 pm

twinb7 wrote:This looks really cool.
Thank you. I just want to say in relation with question about stability in yet another thread -
there is Slow Ants (SlAnt) automata modification that uses 6 states to make speed 1/2 and reduce
amount of noise (e.g. single cell do not cause diamond-like growing with unit speed and so improper
collisions have less chances to produce background waves blocking all processes), but I indeed do not
want to flood the thread with much different automata during short period of time without finishing
even with this one (WlAnt) and may be to talk about SlAnt in some future after proper preparation.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 22nd, 2014, 2:56 pm

A reversible rule family based on the design discussed above has been added to the archive "Wireless Ant World.zip" here:

http://bprentice.webenet.net/Java%20Square%20Cell/

It is called Reversible Square Cell and is implemented appropriately in the three files AlexanderVlasovRule.java, AlexanderVlasovDialog.java and AlexanderVlasovOptionsDialog.java.

The five rules WlAnt, WlAnt-2, WlAnt-3, Anti-Ants and Ants-Anti-Ants are supported and simple example patterns are included for each, the beautiful period 108 ocillator in Ants-Anti-Ants being one of them.

New members of the rule family can be specified in two ways. First, the rule can be specified in a rule table using the rule parameter dialog. And second, a random rule can be generated by depressing the N key.

Patterns can be reversed by depressing the V key.

As Alexander said, the randomly generated rules don't look very promising, but there are clearly some that are. This one for example:

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

I expect to add more example patterns from time to time.

Brian Prentice
Last edited by bprentice on February 22nd, 2014, 4:37 pm, edited 1 time in total.

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 22nd, 2014, 3:37 pm

Brian

I just have seen the program, thank you! (BTW, Surname: Vlasov, not Viasov)
I also have tested your new rule (it is indeed funny, but it does not look random). I also have generated
ruletree file if someone would want to check that in Golly:

Code: Select all

num_states=4
num_neighbors=8
num_nodes=44
1 0 2 1 3
1 1 2 0 3
1 0 3 1 2
1 1 3 0 2
2 0 0 0 0
2 0 1 0 1
2 1 2 1 2
2 2 0 2 0
2 0 3 0 3
2 3 0 3 0
2 0 2 0 2
2 2 1 2 1
2 1 0 1 0
3 4 4 4 4
3 5 6 5 6
3 6 7 6 7
3 7 4 7 4
3 4 8 4 8
3 8 9 8 9
3 9 4 9 4
3 4 10 4 10
3 10 11 10 11
3 11 12 11 12
4 13 13 13 13
4 14 15 14 15
4 15 16 15 16
4 17 18 17 18
4 18 19 18 19
4 20 21 20 21
4 21 22 21 22
5 23 23 23 23
5 24 25 24 25
5 26 27 26 27
5 28 29 28 29
6 30 31 30 31
6 31 32 31 32
6 32 33 32 33
6 33 30 33 30
7 34 35 34 35
7 35 36 35 36
7 36 37 36 37
8 38 39 38 39
8 39 40 39 40
9 41 42 41 42
Alexander

PS. Yes, it's something ...

Code: Select all

x = 6, y = 4, rule = bprentice
.A.A.A$BABABA$BABABA$.A.A.A!
Last edited by alexv on February 22nd, 2014, 4:42 pm, edited 1 time in total.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 22nd, 2014, 4:39 pm

Alexander,
alexv wrote:BTW, Surname: Vlasov, not Viasov
I've corrected that error, sorry.

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 22nd, 2014, 5:37 pm

bprentice wrote:
I've corrected that error, sorry.
O'K. I would suggest to get rid of "if/else" and rewrite step in a way illustrating idea of "second-order":

Code: Select all

public int step(int r, int c)
  {
    int adjacentCount =
      (squareCell.getNeighbor(r - 1, c    ) % 2) +
      (squareCell.getNeighbor(r + 1, c    ) % 2) +
      (squareCell.getNeighbor(r    , c - 1) % 2) +
      (squareCell.getNeighbor(r    , c + 1) % 2);
    int diagonalCount =
      (squareCell.getNeighbor(r - 1, c - 1) % 2) +
      (squareCell.getNeighbor(r - 1, c + 1) % 2) +
      (squareCell.getNeighbor(r + 1, c + 1) % 2) +
      (squareCell.getNeighbor(r + 1, c - 1) % 2);
    int cell = squareCell.getNeighbor(r, c);
    int cond = ruleTable[cell % 2][adjacentCount][diagonalCount];
    int newcell = (cond^(cell>>1)) | ((cell & 1) << 1);
    return newcell;
  } 

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 23rd, 2014, 2:57 pm

I wrote earlier, WlAnt, WlAnt-2, WlAnt-3, WlAnt-4 are almost the same. Yet the simple "mail" pattern
below illustrates difference of the rules in quite nontrivial way

Code: Select all

# Cross-gun with four ants streams shaping ~ 01110....
x = 9, y = 9, rule = WlAnt
.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C!

Code: Select all

# Oscillator period = 4
x = 9, y = 9, rule = WlAnt-2
.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C!

Code: Select all

# Oscillator period = 12
x = 9, y = 9, rule = WlAnt-3
.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C!

Code: Select all

# Cross-gun with four ants streams shaping ~ 1111....
x = 9, y = 9, rule = WlAnt-4
.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C$C3.C3.C$C3.C3.C$C3.C3.C$.3C.3C!
PS. May be I am doing something not properly, but Golly after paste does not set necessary rule
and I have to use Set Rule menu :(

Sphenocorona
Posts: 549
Joined: April 9th, 2013, 11:03 pm

Re: Reversible Wireless World

Post by Sphenocorona » February 23rd, 2014, 4:18 pm

There's an option in the Preferences menu where you an set what to do when you paste in a pattern from a different rule - the default is not to change rules ever, but most people here as far as I know set that to "Change rule only when universe is empty".

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 23rd, 2014, 4:28 pm

Sphenocorona wrote:There's an option in the Preferences menu where you an set what to do when you paste in a pattern from a different rule - the default is not to change rules ever, but most people here as far as I know set that to "Change rule only when universe is empty".
Thank you, after the change all works as supposed

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 24th, 2014, 9:58 am

Maybe I should explain "why reversible CA", but finally find a link about reversible computation that
includes many things I should to write in such an explanation
http://strangepaths.com/reversible-comp ... /01/20/en/

I only need to say about some important gate that may not be implemented with billiard balls, but
may be made with ants simply because number of input and output ants may be different in WlAnt CA.
The most important case is Controlled NOT gate: (A,B) -> (A, A XOR B). I found an implementation
Image

Code: Select all

# C-Not from double-switch, swap and inverted double-switch
x = 156, y = 29, rule = WlAnt
67.2C23.4C36.2C$66.3C23.4C36.3C$66.2C25.2C38.2C4$78.2C6.2C25.2C6.2C$
60.4C13.3C6.3C9.2C10.5C6.3C13.4C$60.4C13.2C8.3C8.2C10.4C8.2C13.4C$61.
2C25.2C21.2C25.2C$BCA37.BCA46.2C5.2C$82.2C5.2C5.3C18.2C$66.2C8.2C3.4C
12.2C17.4C3.2C8.2C$49.4C3.2C8.2C8.2C3.4C31.4C3.2C8.2C8.2C3.4C$49.4C3.
2C8.2C38.2C25.2C8.2C3.4C$50.2C54.3C40.2C$20.BCA17.BCA64.2C$71.2C15.2C
21.2C15.2C$45.2C8.2C13.4C13.3C13.2C6.3C13.4C13.2C8.2C$45.3C6.3C13.4C
13.2C14.2C7.2C13.4C13.3C6.3C$46.2C6.2C89.2C6.2C$102.2C$56.2C34.2C7.3C
39.2C$56.3C32.3C7.2C39.3C$57.2C32.2C49.2C2$92.2C13.2C$92.3C11.3C$93.
2C11.2C!
Yet I still doubt about optimality: after all it uses double-switch gate (already
mentioned earlier in last example with half-adder) that itself is already compound
Image

Alexander

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 24th, 2014, 2:53 pm

My previous comment was unfinished a bit. I wanted to mention yet another gate. After all,
C-NOT gate is not universal. Reversible universal gate changing amount of units (ants) is
Toffoli gate (A,B,C) -> (A,B,C XOR (A AND B)).
It also may be implemented using C-NOT and double switch gates.
Image

Code: Select all

x = 250, y = 60, rule = WlAnt
51.2C36.4C6.4C6.4C6.4C6.4C6.4C6.4C6.4C35.2C$50.3C36.4C6.4C6.4C6.4C6.
4C6.4C6.4C6.4C35.3C$50.2C38.2C8.2C8.2C8.2C8.2C8.2C8.2C8.2C37.2C$43.2C
161.2C$42.3C161.3C$42.2C41.2C8.2C8.2C8.2C8.2C8.2C8.2C8.2C8.2C40.2C$
85.3C6.4C6.4C6.4C6.4C6.4C6.4C6.4C6.3C$55.2C29.2C4.6C6.4C6.7C3.4C6.4C
6.4C6.5C5.2C28.2C$54.3C34.3C23.4C36.3C34.3C$54.2C35.2C25.2C38.2C35.2C
$54.2C6.2C123.2C6.2C$13.2C21.4C13.3C6.3C121.3C6.3C13.4C20.2C$12.3C21.
4C13.2C8.3C119.3C8.2C13.4C20.3C$12.2C23.2C25.2C37.2C6.2C25.2C6.2C37.
2C25.2C22.2C$15.BCA67.4C13.3C6.3C9.2C10.5C6.3C13.4C$58.2C25.4C13.2C8.
3C8.2C10.4C8.2C13.4C25.2C$42.2C8.2C3.4C25.2C25.2C21.2C25.2C25.4C3.2C
8.2C$7.2C16.4C3.2C8.2C8.2C3.4C53.2C5.2C67.4C3.2C8.2C8.2C3.4C15.2C$6.
3C16.4C3.2C8.2C63.2C5.2C5.3C18.2C63.2C8.2C3.4C15.3C$6.2C18.2C63.2C8.
2C3.4C12.2C17.4C3.2C8.2C63.2C17.2C$15.BCA47.2C7.4C3.2C8.2C8.2C3.4C31.
4C3.2C8.2C8.2C3.4C7.2C$47.2C15.3C7.4C3.2C8.2C38.2C25.2C8.2C3.4C7.3C
15.2C$21.2C8.2C13.4C13.3C9.2C54.3C40.2C9.3C13.4C13.2C8.2C$.2C18.3C6.
3C13.4C13.2C67.2C52.2C13.4C13.3C6.3C17.2C$3C19.4C4.2C9.4C6.2C43.2C15.
2C21.2C15.2C43.2C6.4C9.2C4.4C18.3C$2C21.3C15.4C6.3C16.2C8.2C13.4C13.
3C13.2C6.3C13.4C13.2C8.2C16.3C6.4C15.3C20.2C$15.BCA5.2C17.2C8.2C16.3C
6.3C13.4C13.2C14.2C7.2C13.4C13.3C6.3C16.2C8.2C17.2C$71.2C6.2C89.2C6.
2C$127.2C$18.2C8.2C7.2C8.2C20.2C10.2C34.2C7.3C39.2C10.2C20.2C8.2C7.2C
8.2C$18.3C6.3C7.3C6.4C18.3C10.3C32.3C7.2C39.3C10.3C18.4C6.3C7.3C6.3C$
9.A5.A3.2C6.2C9.2C6.4C18.2C12.2C32.2C49.2C12.2C18.4C6.2C9.2C6.2C$9.C
5.C$9.B5.B101.2C13.2C$117.3C11.3C$85.2C6.4C6.4C6.7C3.4C4.6C6.4C6.4C6.
2C$84.3C6.4C6.4C6.4C6.4C6.4C6.4C6.4C6.3C$84.2C8.2C8.2C8.2C8.2C8.2C8.
2C8.2C8.2C3$32.2C55.2C8.2C8.2C8.2C8.2C8.2C8.2C8.2C56.2C$32.3C53.4C6.
4C6.4C6.4C6.4C6.4C6.4C6.4C54.3C$33.2C53.4C6.4C6.4C6.4C6.4C6.4C6.4C6.
4C54.2C2$9.ACB37.ACB37.ACB$2C246.2C$3C244.3C$.2C244.2C3$49.ACB17.ACB$
6.2C7.A226.2C$6.3C6.C225.3C$7.2C6.B225.2C3$29.ACB$12.2C222.2C$12.3C
220.3C$13.2C220.2C!
Alexander

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 25th, 2014, 9:44 am

Alexander,

Here is an example pattern:

Code: Select all

#Rule = Alexander Vlasov Rule
#RT 0,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,1
#RT 0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,1
#Rows = 129
#Columns = 134
#L A130.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.
#L B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A
#L .A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B
#L $A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.
#L A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$
#L A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A
#L $.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A
#L .A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$
#L .B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$A.A128.A.A$.B130.B$2.
#L A128.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.B$131.A.A$132.
#L B$131.A.A$132.B$131.A.A$132.B$133.A
It can be run on "Reversible Square Cell" here:

http://bprentice.webenet.net/Java%20Squ ... 0World.zip

The rule supports many fascinating oscillators, including those with very large periods.

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 10:18 am

Brian,

I checked your program with the pattern - It's some abstract art with resizing rectangles. :lol:

A few comments:
1) I made change in step function suggested in
viewtopic.php?f=11&t=1293&p=10941#p10880
(i.e. wrote ... (cond^(cell>>1)) | ((cell & 1) << 1); ... instead of else/if). All works O'K after that.

2) There is some strange thing with opening files (program may not work after that
until Ctrl - Left-Mouse is clicked)

3) More general point: finding oscillator period is a bit simpler for reversible CA.
Below is a script for Golly (period.py) for clarification

Code: Select all

# Find period, based on oscar by Andrew Trevorrow (andrew@trevorrow.com)

import golly as g
from glife import rect, pattern
from time import time


# --------------------------------------------------------------------

def fit_if_not_visible():
   # fit pattern in viewport if not empty and not completely visible
   r = rect(g.getrect())
   if (not r.empty) and (not r.visible()): g.fit()

# --------------------------------------------------------------------

g.show("Finding period... (hit escape to abort)")

h0 = g.hash(g.getrect())
p0 = int(g.getpop())
h = h0+1
p = p0+1
g.setgen("0")

oldsecs = time()
while not ((h == h0) and (p == p0)):
   g.run(1)
   h = g.hash(g.getrect())
   p = int(g.getpop())
   newsecs = time()
   if newsecs - oldsecs >= 1.0:     # show pattern every second
      oldsecs = newsecs
      fit_if_not_visible()
      g.update()

fit_if_not_visible()
g.show("Period = " + g.getgen())
Alexander

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 25th, 2014, 10:48 am

Alexander,

A group of cells may be selected by clicking the display with the control key depressed, The first click marks a corner of the selection area and the second click marks the diagonally opposite corner. A third click clears the selection. When selected a group of cells may be manipulated by several of the toolbar buttons. Selections may be rotated, flipped, written to a file, set to a random state and moved or copied by dragging. The inside or outside of a selection may also be cleared.

Selected cells do not participate when the simulation is run and thus selections may be used for temporary storage and pattern synchronization.

When a pattern is loaded it is selected and centered. To run the pattern, first clear the selection by clicking the display with the control key depressed.

To determine the speed and period of ships or the period of oscillators, click the button with the hint "show ship, oscillator or still life characteristics" .

I wrote the Java CA Programs for my own use so the interface is implemented just the way I like it.

Reversible Square Cell has been modified to include your new recommended step function and that version will be included in the next update of my website.

Could you please post a Golly rule table of the new rule and the program that you use to generate it.

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 11:02 am

Brian,

It's O'K, my own program is even less user friendly and I so even did not try to show that
before some improvement and the tree converter is inside this big program. I think
it is more realistic to use standard C code included in Golly distribution to write
rule table converter for this rule family.
Could you wrote your rule in form of list I mentioned as you did with previous one ?
0 1 1
0 2 2
0 3 3
1 2 1
1 2 2
1 2 3
- then I could convert that immediately (I called such format *.tb3)

Alexander

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 11:24 am

Brian,

I am attaching an example of making table for WlAnt. For whole family function
slowcalc_ir should be changed to use values from 2 x 5 x 5 ruleTable filled from
some file or so. Rule tables based on such idea are not very optimal and maybe
for the family may be designed a special algorithm

Alexander
Attachments
make-reversible-ants-ruletable.zip
Example of making rule table for WlAnt
(6.13 KiB) Downloaded 245 times

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 25th, 2014, 1:31 pm

Alexander,

Here are pictures of the Reversible Square Cell rule parameter dialog displaying the rule table:
RT0.png
RT0.png (12.99 KiB) Viewed 14201 times
RT1.png
RT1.png (12.87 KiB) Viewed 14201 times
and here is the table generated by hand with hopefully no errors:

Code: Select all

0 1 4
0 2 0
0 3 2
0 4 1
0 4 3
0 4 4
1 0 2
1 0 4
1 1 1
1 1 4
1 4 3
1 4 4
Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 1:40 pm

Brian,

I've seen the table in your program, but was not sure about corner and side values. Above is tree from your
new table ( :?: a bit strange, it also has 44 nodes, try to check on some pattern)

Code: Select all

num_states=4
num_neighbors=8
num_nodes=44
1 0 2 1 3
1 1 2 0 3
1 0 3 1 2
1 1 3 0 2
2 0 0 0 0
2 0 1 0 1
2 1 0 1 0
2 0 2 0 2
2 2 0 2 0
2 0 3 0 3
2 2 3 2 3
2 3 0 3 0
3 4 5 4 5
3 5 6 5 6
3 6 4 6 4
3 7 8 7 8
3 8 4 8 4
3 4 4 4 4
3 4 9 4 9
3 10 11 10 11
3 11 4 11 4
4 12 13 12 13
4 13 14 13 14
4 15 16 15 16
4 16 12 16 12
4 17 17 17 17
4 17 18 17 18
4 19 20 19 20
4 20 18 20 18
5 21 22 21 22
5 23 24 23 24
5 24 21 24 21
5 25 26 25 26
5 27 28 27 28
6 29 30 29 30
6 30 31 30 31
6 31 32 31 32
6 32 33 32 33
7 34 35 34 35
7 35 36 35 36
7 36 37 36 37
8 38 39 38 39
8 39 40 39 40
9 41 42 41 42
Alexander

UPDATE: I think, list should be altered

Code: Select all

0 4 1
0 0 2
0 2 3
0 1 4
0 3 4
0 4 4
1 2 0
1 4 0
1 1 1
1 4 1
1 3 4
1 4 4
In such a case tree has 47 nodes and displays behavior similar with simple test I've checked

Code: Select all

num_states=4
num_neighbors=8
num_nodes=47
1 0 2 1 3
1 0 3 1 2
1 1 3 0 2
1 1 2 0 3
2 0 0 0 0
2 0 1 0 1
2 1 0 1 0
2 0 2 0 2
2 3 0 3 0
2 0 3 0 3
2 2 2 2 2
3 4 5 4 5
3 5 6 5 6
3 6 5 6 5
3 6 4 6 4
3 4 7 4 7
3 8 4 8 4
3 4 4 4 4
3 4 9 4 9
3 9 8 9 8
3 8 7 8 7
3 7 10 7 10
4 11 12 11 12
4 12 13 12 13
4 12 14 12 14
4 14 15 14 15
4 16 17 16 17
4 17 17 17 17
4 18 19 18 19
4 19 16 19 16
4 19 20 19 20
4 20 21 20 21
5 22 23 22 23
5 24 25 24 25
5 26 27 26 27
5 28 29 28 29
5 30 31 30 31
6 32 33 32 33
6 33 34 33 34
6 34 35 34 35
6 35 36 35 36
7 37 38 37 38
7 38 39 38 39
7 39 40 39 40
8 41 42 41 42
8 42 43 42 43
9 44 45 44 45

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 25th, 2014, 2:24 pm

Alexander,

The first rule I posted was converted in the same way. It should be:

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

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 2:41 pm

bprentice wrote:Alexander,

The first rule I posted was converted in the same way.

Brian
I always supposed triples order: cell, # side, # corner. Did you use an alternative one?
The rule table for corrected list you just send should be

Code: Select all

num_states=4
num_neighbors=8
num_nodes=39
1 0 2 1 3
1 1 2 0 3
1 0 3 1 2
1 1 3 0 2
2 0 0 0 0
2 0 1 0 1
2 1 0 1 0
2 0 2 0 2
2 2 3 2 3
2 3 2 3 2
2 2 0 2 0
3 4 4 4 4
3 5 6 5 6
3 6 4 6 4
3 7 8 7 8
3 8 9 8 9
3 9 10 9 10
3 4 5 4 5
4 11 11 11 11
4 12 13 12 13
4 13 11 13 11
4 14 15 14 15
4 15 16 15 16
4 11 17 11 17
4 17 12 17 12
5 18 18 18 18
5 19 20 19 20
5 21 22 21 22
5 23 24 23 24
6 25 26 25 26
6 26 27 26 27
6 27 28 27 28
6 28 25 28 25
7 29 30 29 30
7 30 31 30 31
7 31 32 31 32
8 33 34 33 34
8 34 35 34 35
9 36 37 36 37
Alexander

PS. Have you seen *.cpp program in zip?
PPS. I remember, the program worked rather slow.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Reversible Wireless World

Post by bprentice » February 25th, 2014, 3:28 pm

Alexander,

Thank you for your help and patience. Everything seems to be working correctly now. It is interesting that your example pattern for rule bprentice worked correctly using both the incorrect and correct Golly rule tree files.

Here is a period 488 oscillator that typifies the behavior of rule bprentice2:

Code: Select all

x = 15, y = 13, rule = bprentice2
13.B$14.A2$14.A$13.B$12.A$11.B2$9.B$A7.A$7.B$A$5.B!
I had seen the cpp file but have not used it yet.

Brian

User avatar
alexv
Posts: 136
Joined: February 3rd, 2014, 11:14 am

Re: Reversible Wireless World

Post by alexv » February 25th, 2014, 3:49 pm

I found difference also for first rule using a simple pattern:

Code: Select all

x = 3, y = 2, rule = bprentice:T4,4
2.A$3A!
Old variant has period 10, a new one - 8

Post Reply