英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论