Code - breeds
[clnl] / src / test / modeltests.lisp
index 6202c51e2df1a752041bc8f154803590b0300b54..79ebc4ba261614016a578dd439c870a25c936286 100644 (file)
@@ -61,3 +61,50 @@ to go
 end"
  "setup go"
  "F8A2BFD71A8A064C37DDB744217AB07CDB0686EB")
+
+(defmodelcommandtest "patches-own 1"
+ "patches-own [a]
+to setup
+  ask patches [
+    set a 2
+  ]
+end"
+ "setup"
+ "73FE87B52A2DAB0EC02DB23F26DB3B5336A61679")
+
+(defmodelcommandtest "patches-own 2"
+ "patches-own [a b]
+to setup
+  ask patches [
+    set a 2
+    set b a + 1
+  ]
+end
+
+to go
+  ask patches [ set pcolor b ]
+end"
+ "setup go"
+ "2972B3EC1285BDA17656401001E1AE667FA7F5AF")
+
+(defmodelcommandtest "breeds 1"
+ "breed [wolves wolf]
+
+to setup
+  create-turtles 50
+  create-turtles 50 [ fd 1 ]
+  create-wolves 50
+  set-default-shape wolves \"sheep\"
+  create-wolves 50 [ fd 1 ]
+end
+
+to go
+  ask turtles [ fd 1 ]
+  ask wolves [ fd 1 ]
+  ask turtles [ if 1 < count turtles-here [ fd 1 ] ]
+  ask wolves [ if 1 < count turtles-here [ fd 1 ] ]
+  ask turtles [ if 1 < count wolves-here [ fd 1 ] ]
+  ask wolves [ if 1 < count wolves-here [ fd 1 ] ]
+end"
+ "setup go"
+ "2614B99F64ACFA2BD64D66B129C0A17F2150FADD")