diff building.yaml @ 52:d2ac1e198ce4

implement a new agent based on Decision Tree (Decision::ParseTree)
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 20 Oct 2008 19:07:53 +0800
parents
children 2d3c394b7940
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/building.yaml	Mon Oct 20 19:07:53 2008 +0800
@@ -0,0 +1,39 @@
+---
+# 基本建設規則
+# 檢查是否被攻擊
+- is_Attacked:
+    # we are in Peace :D
+    0:
+      - is_constructing:
+         # already building something.
+         1: 
+         # let's find something to build up
+         0:
+            # 確認是否為主城
+            # 確認是否有學院
+            - is_wall_enough:
+               0: build_wall
+            - is_space_enough:
+               0: build_cityhall
+            - is_corruption:
+               1: build_governorsresidence
+            # 倉庫庫存量
+            - is_warehouse_enough:
+               0: build_warehouse
+            - is_risk:
+               1: 
+                  - is_shipyard:
+                     0: 
+                        - is_drydock_researched: 
+                           0: resaerch_drydock
+                           1: build_shipyard
+            - is_happiness:
+               0: 
+                  - is_winepress_researched:
+                     0: research_economy
+                     1: build_tavern
+                     # reduce_trvern
+            # 是主城, 可隨意建任一尚未搭建之建築
+            # 副城, 不建 ...
+    # 採取防禦措施
+    1: run_defense