Netlogo 如何让海龟在指定的繁殖季节繁殖一次?

Netlogo 如何让海龟在指定的繁殖季节繁殖一次?,netlogo,Netlogo,在我的模型中,我有男性和女性。它们可以在每365天的特定时间相互繁殖后代 我怎样才能让成虫在繁殖后关闭繁殖能力,但在接下来的繁殖季节恢复繁殖能力 ask females [ if age > 0 and age mod 365 = 0 [ reproduce ] . . . to reproduce if count mates > 0 [ ; the number of males in a defined radius hatch f

在我的模型中,我有男性和女性。它们可以在每365天的特定时间相互繁殖后代

我怎样才能让成虫在繁殖后关闭繁殖能力,但在接下来的繁殖季节恢复繁殖能力

ask females [
    if  age > 0 and age mod 365 = 0 [
  reproduce
    ]
.
.
.
to reproduce 
    if count mates > 0   [ ; the number of males in a defined radius 
    hatch fecundity [
    set mother myself
    set father one-of [mates] of mother
]

一种创建变量的方法,该变量计算自上次繁殖以来的天数。然后在每个刻度处增加该变量。然后在雌性成功繁殖后重置它。类似(未经测试):


一种创建变量的方法,该变量计算自上次繁殖以来的天数。然后在每个刻度处增加该变量。然后在雌性成功繁殖后重置它。类似(未经测试):

females-own [days-since-child]

to go
  ...
  ask females [ set days-since-child days-since-child + 1 ]
  ask females with [days-since-child >= 365] [ reproduce ]
  tick
end

to reproduce 
  if any? mates > 0   [ ; the number of males in a defined radius
    set days-since-child 0 
    hatch fecundity [
      set mother myself
      set father one-of [mates] of mother
    ]
  ]
end