[jboss-svn-commits] JBL Code SVN: r11006 - labs/jbossrules/trunk/drools-examples/src/main/rules/org/drools/examples/conway.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Apr 16 09:46:43 EDT 2007


Author: mark.proctor at jboss.com
Date: 2007-04-16 09:46:43 -0400 (Mon, 16 Apr 2007)
New Revision: 11006

Modified:
   labs/jbossrules/trunk/drools-examples/src/main/rules/org/drools/examples/conway/conway.drl
Log:
JBRULES-800 Move conways game of life to a stateful example
-removed some uneeded attributes, and changed to no-loop where possible

Modified: labs/jbossrules/trunk/drools-examples/src/main/rules/org/drools/examples/conway/conway.drl
===================================================================
--- labs/jbossrules/trunk/drools-examples/src/main/rules/org/drools/examples/conway/conway.drl	2007-04-16 13:37:20 UTC (rev 11005)
+++ labs/jbossrules/trunk/drools-examples/src/main/rules/org/drools/examples/conway/conway.drl	2007-04-16 13:46:43 UTC (rev 11006)
@@ -53,9 +53,8 @@
 end
 
 rule "Kill The Lonely"
-	salience 10
-	agenda-group "evaluate"	
-	lock-on-active	
+	agenda-group "evaluate"
+	no-loop
 when
 #	A live cell has fewer than 2 live neighbors
 	theCell: Cell(liveNeighbors < 2, cellState == CellState.LIVE, phase == Phase.EVALUATE)
@@ -65,9 +64,8 @@
 end
 
 rule "Kill The Overcrowded"
-	salience 10
 	agenda-group "evaluate"
-	lock-on-active	
+	no-loop
 when
 #	A live cell has more than 3 live neighbors
 	theCell: Cell(liveNeighbors > 3, cellState == CellState.LIVE, phase == Phase.EVALUATE)
@@ -77,9 +75,8 @@
 end
 
 rule "Give Birth"
-	salience 10
 	agenda-group "evaluate"
-	lock-on-active	
+	no-loop
 when
 #	A dead cell has 3 live neighbors
 	theCell: Cell(liveNeighbors == 3, cellState == CellState.DEAD, phase == Phase.EVALUATE)
@@ -98,7 +95,7 @@
 
 rule "kill"
 	agenda-group "kill"
-	lock-on-active	
+	no-loop
 when
 	theCell: Cell(phase == Phase.KILL)
 then
@@ -109,7 +106,7 @@
  
 rule "birth"
 	agenda-group "birth"
-	lock-on-active	
+	no-loop
 when
 	theCell: Cell(phase == Phase.BIRTH)
 then
@@ -119,8 +116,8 @@
 end	
 
 rule "Calculate Live"
-	lock-on-active
 	agenda-group "calculate"
+	lock-on-active	
 when
 	theCell: Cell(cellState == CellState.LIVE)
 	Neighbor(cell == theCell, $neighbor : neighbor)	
@@ -131,8 +128,8 @@
 end	
 
 rule "Calculate Dead"
-	lock-on-active
 	agenda-group "calculate"
+	lock-on-active	
 when
 	theCell: Cell(cellState == CellState.DEAD)
     Neighbor(cell == theCell, $neighbor : neighbor )
@@ -143,9 +140,8 @@
 end	
 
 rule "Kill All"
-	salience 10
 	agenda-group "kill all"	
-	lock-on-active	
+	no-loop
 when
 	theCell: Cell(cellState == CellState.LIVE)
 then




More information about the jboss-svn-commits mailing list