Universal Rule Table
Posted: 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:
What do you think?
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>