在 netlogo 中绘制品种形状

plotting shape of breed in netlogo

在我的模型中,我有 2 个品种的司机和骑自行车的人。根据天气的不同,它们会变成自行车或汽车。这是我的 go 函数的摘录:

ask drivers
 [
   ifelse temperature < 5
  [set shape "car"]
  [ move-drivers ]
 ifelse temperature > 5
  [set shape "bike"]
  [ move-drivers ]
]

我想在模型中的给定刻度处绘制汽车和自行车的数量,但我不确定在绘图的 Pen 更新命令部分写什么。我该如何绘制?

基本上算汽车或自行车形状的司机:

count drivers with [shape = "car" or shape = "bike"]

由于有 2 个品种可以随时变成自行车或汽车,因此有效的笔更新命令是:

绘制 [shape = "car"] 的驾驶员数 + shape = "car"]

的骑车人数

使用 [shape = "bike ] + count bikers with [ shape = "bike"]

的 plot count 司机