我怎样才能每 30 个滴答声做一个精确的程序?我已经在“to go”中写了这个程序。我试着这样写:
'to go
if count population with [underPovertyLine] = count population or
count firms = 0 [stop]
ask population [
set min-indiv-cost-of-living runresult [max-indiv-cost-of-living]
]
if ticks mod 30 = 0 [
ask population with [employed = false and color = grey] [
set mymoneyOnBankOfGrey runresult [moneyOnBankOfGrey - min-indiv-
cost-of-living]
if mymoneyOnBankOfGrey < 0 [die]
]
ask population with [employed = false and color = blue ] [
set mymoneyOnBankOfBlue runresult[ moneyOnBankOfBlue - min-indiv-cost-
of-living]
if mymoneyOnBankOfBlue < 0 [die]
]
ask population with [employed = false and color = red] [
set mymoneyOnBankOfRed runresult [ moneyOnBankOfRed - min-indiv-cost-
of-living]
if mymoneyOnBankOfRed < 0 [die]
]
ask population with [employed = true and color = grey] [
set mymoneyOnBankOfGrey runresult[ moneyOnBankOfGrey + wage - min-
indiv-cost-of-living]
if mymoneyOnBankOfGrey < 0 [die]
]
ask population with [employed = true and color = blue] [
set mymoneyOnBankOfBlue runresult [ moneyOnBankOfBlue + wage - min-
indiv-cost-of-living]
if mymoneyOnBankOfBlue < 0 [die]
]
ask population with [employed = true and color = red ] [
set mymoneyOnBankOfRed runresult [ moneyOnBankOfRed + wage - min-indiv-
cost-of-living]
if mymoneyOnBankOfRed < 0 [die]
]
]
tick
end'
我希望该程序每 30 个滴答声发生一次,但它在第 30 个滴答声时仅发生 1 次,它会停止并且不会更新。我该如何解决?谢谢!!