Universal Rule Table

For discussion of other cellular automata.
Post Reply
User avatar
ssaamm
Posts: 125
Joined: June 4th, 2010, 9:43 pm

Universal Rule Table

Post by ssaamm » November 5th, 2010, 6:42 pm

Well, I think it's about time we brought together every format into an agreeable, deep, and effective rule table. It will be very difficult, but I have a list of all the things we need to specify in one of these tables. I believe the best way is XML, Like this:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>
<ruletable>
    <neighborhoods>
        <neighborhood name="moore_totalistic">
            <report id="1">
                <value>1+2+3+4+5+6+7+8</value>
                <neighbor id="1">
                    <x>0</x>
                    <y>1</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="2">
                    <x>1</x>
                    <y>1</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="3">
                    <x>1</x>
                    <y>0</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="4">
                    <x>1</x>
                    <y>-1</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="5">
                    <x>0</x>
                    <y>-1</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="6">
                    <x>-1</x>
                    <y>-1</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="7">
                    <x>-1</x>
                    <y>0</y>
                    <weight>1</weight>
                </neighbor>
                <neighbor id="8">
                    <x>-1</x>
                    <y>1</y>
                    <weight>1</weight>
                </neighbor>
            </report>
        </neighborhood>
    </neighborhoods>
    <rules>
        <variables>
            <variable name="a">
                <free>0</free>
                <states>0,1,4,5,6,7,8</states>
            </variable>
        </variables>
        <rule neighborhood="moore_totalistic">
            <from state="0">
                <to state="1">
                    <condition>3</condition>
                </to>
            </from>
            <from state="1">
                <to state="0">
                    <condition>a</condition>
                </to>
            </from>
        </rule>
    </rules>
</ruletable>
What do you think?

ebcube
Posts: 124
Joined: February 27th, 2010, 2:11 pm

Re: Universal Rule Table

Post by ebcube » November 6th, 2010, 9:58 am

ssaamm wrote:Well, I think it's about time we brought together every format into an agreeable, deep, and effective rule table. It will be very difficult, but I have a list of all the things we need to specify in one of these tables. I believe the best way is XML, Like this:

What do you think?
There is absolutely no need for such a complex format. XML is not always the right way to do things. It's too bulky.

That said, we need an easier way to define complex ruletables. Maybe a RuleTree-like approach, but without having to create a RuleTree from it.

User avatar
Tim Hutton
Posts: 64
Joined: May 20th, 2010, 7:30 am
Contact:

Re: Universal Rule Table

Post by Tim Hutton » November 6th, 2010, 6:25 pm

It would be nice to have one final format for all rules. Rule tables fill a niche but have shortcomings: many complex rules seem to be better expressed in high-level languages like Python, C++ and Java. (Golly supports Python rules (see make-ruletree.py) but only for rules with few enough states and neighbors that we can iterate over all input combinations.)

Before working on a new format though, be sure to check out existing ones like cellang and CDL, as listed here: http://code.google.com/p/ruletablerepos ... /TheFormat
Any new format would have to have some advantage over those.

ebcube
Posts: 124
Joined: February 27th, 2010, 2:11 pm

Re: Universal Rule Table

Post by ebcube » November 6th, 2010, 9:22 pm

Tim Hutton wrote:(Golly supports Python rules (see make-ruletree.py) but only for rules with few enough states and neighbors that we can iterate over all input combinations.)
Exactly! Now, if we could just run the code directly, those limitations on states and neighbours would go away. Of course, letting anyone plug their own Python code into Golly is probably not a good idea.

User avatar
ssaamm
Posts: 125
Joined: June 4th, 2010, 9:43 pm

Re: Universal Rule Table

Post by ssaamm » November 6th, 2010, 9:41 pm

Hmm...

Well, would there be a better way to incorporate custom neighborhoods based by state into the current rule table format?
Also, would it be possible to have the .colors file be part of the rule table?

Keiji
Posts: 58
Joined: May 11th, 2010, 5:32 pm

Re: Universal Rule Table

Post by Keiji » November 8th, 2010, 1:54 am

ebcube wrote:
Tim Hutton wrote:(Golly supports Python rules (see make-ruletree.py) but only for rules with few enough states and neighbors that we can iterate over all input combinations.)
Exactly! Now, if we could just run the code directly, those limitations on states and neighbours would go away. Of course, letting anyone plug their own Python code into Golly is probably not a good idea.
Err, no. I don't believe that will help at all. No matter how the code is run it still has to be iterated over, running native code would only make it faster by some constant factor which would not be nearly enough.

Essentially, what we need is a cut-down scripting language which Golly can analytically compile into a ruletree.
Image
This is why signature character limits are pointless.

User avatar
ssaamm
Posts: 125
Joined: June 4th, 2010, 9:43 pm

Re: Universal Rule Table

Post by ssaamm » November 8th, 2010, 7:15 pm

sounds good to me, but how easy would this be to manipulate?
I know xml isn't very convenient...

Post Reply