我試圖創建一個patch-set
,而不必單獨定義列表中的每個修補程序。但是,爲了做到這一點,我需要從另一箇中減去一個patch-set
。在我的模型中,patches own
O2。我有一些選定的補丁,其O2值不應改變。我想爲pxcor = max-pxcor
的修補程序創建patch-set
,但排除應該保持O2恆定的這些修補程序。我曾嘗試減去補丁集,但得到了一條錯誤消息,說-expected this input to be a number, but got a patch agentset instead.
我也嘗試將補丁集設置爲列表,然後使用remove
命令修改列表。但是,這然後出現問題,當我ask
列表執行的東西,我得到錯誤ASK expected an agent or agentset, but got a list instead
。NetLogo:從另一個減去一個修補程序集
下面是相關的代碼,我嘗試建立補丁集:
set NS1 (patch-set patch -8 -5 6 patch -8 -5 -5 patch -8 6 6 patch -8 6 -5 patch 8 -5 6 patch 8 -5 -5 patch 8 6 6 patch 8 6 -5)
set NS2 (patch-set patch -8 0 6 patch -8 0 -5 patch 8 0 6 patch 8 0 -5 )
set NS3 (patch-set patch -4 -5 6 patch -4 -5 -5 patch 4 -5 6 patch 4 -5 -5 patch -4 6 6 patch -4 6 -5 patch 4 6 6 patch 4 6 -5)
set NS4 (patch-set patch -4 0 6 patch -4 0 -5 patch 4 0 6 patch 4 0 -5)
set NS5 (patch-set patch -8 0 0 patch 8 0 0)
set NS6 (patch-set patch -8 -5 0 patch -8 6 0 patch 8 -5 0 patch 8 6 0)
set NS7 (patch-set patch -4 -5 0 patch -4 6 0 patch 4 -5 0 patch 4 6 0 )
set NS8 (patch-set patch 0 0 6 patch 0 0 -5)
set NS9 (patch-set patch 0 -5 6 patch 0 -5 -5 patch 0 6 6 patch 0 6 -5)
set NS10 (patch-set patch 0 -5 0 patch 0 6 0)
set NS11 patch 0 0 0
set NS12 (patch-set patch -4 0 0 patch 4 0 0)
set FEMnodes (sentence NS1 NS2 NS3 NS4 NS5 NS6 NS7 NS8 NS9 NS10 NS11 NS12)
set Xmaxmin (list (patch-set patches with [ pxcor = min-pxcor] patches with [ pxcor = max-pxcor]))
set lateral remove FEMnodes Xmaxmin
set Ymaxmin (list (patch-set patches with [ pycor = min-pycor ] patches with [ pycor = max-pycor ]))
set FB remove FEMnodes Ymaxmin
set Zmaxmin (list (patch-set patches with [ pzcor = min-pzcor ] patches with [ pzcor = max-pzcor ]))
set TP remove FEMnodes Zmaxmin