如何让巨型组件模型的刻度停止一段时间?

huangapple go评论49阅读模式
英文:

How can I make the ticks stop for a certain amount of time in the Giant Component model?

问题

在探索巨型组件模型时,我正在寻找一种在达到特定分数大小(寻找0.5)后停止时钟的选项。是否有任何方法可以导入某种暂停以便检查每个节点在0.5分数大小时的连接?

英文:

While exploring the Giant Component model, i was looking for an option to stop the ticks for a certain time after they've reached a specific fraction size (looking for 0.5). Is there any way I could import some type of pause to be able to check the connection per node at 0.5 fraction size?

答案1

得分: 1

如果我理解你的意思正确,你希望模型在某个特定点停下来,以允许你检查事物,然后继续执行。让我们假设你可以在go过程中确定停止条件。发出stop命令将"解除"前进按钮,然后你可以随意查看任何你喜欢的东西。当你再次按下前进按钮时,模型将继续执行。以下是一些示例代码。

to setup
  clear-all
  create-turtles 10
  ask turtles [forward 10]
  reset-ticks
end

to go
  ask turtles [forward 1]
  wait 1
  tick
  if (ticks mod 10) = 0 [stop]
end
英文:

If I understand you correctly, you want the model to stop at a certain point to allow you to inspect things, and then continue executing. Let's assume that you can identify the stopping condition in the go procedure. Issuing the stop command will "lift" the go button, whereupon you can look at whatever you like. When you press the go button again, the model will resume. Here is some sample code.

to setup
  clear-all
  create-turtles 10
  ask turtles [forward 10]
  reset-ticks
end

to go
  ask turtles [forward 1]
  wait 1
  tick
  if (ticks mod 10) = 0 [stop]
end

huangapple
  • 本文由 发表于 2023年6月15日 21:41:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76483109.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定