如何在Netlogo的代码中设置用于笔大小的滑块 [英] How to setup a slider for pen size into the code in Netlogo

查看:263
本文介绍了如何在Netlogo的代码中设置用于笔大小的滑块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码,我需要适合滑子,以便我编辑笔的大小,我的全局变量是乌龟笔大小

this is my code , i need to fit the slider so i edit the pen size my global variable is turtle-pen-size

 to setup
      clear-all
      ask patches [ set pcolor sky ]
      setup-turtles

    end

    to setup-turtles
      create-turtles turtles-to-create 
      [ set color lime setxy random-xcor random-ycor set size size-of-turtle]  
      set-default-shape turtles "circle"
    end

    to go 

     ask turtles[
         ifelse pen-down? [ pen-down ] [ pen-up ]
         fd 1
   ]

end

推荐答案

您可以将pen-size设置为向每只海龟询问pen-down

You could set pen-size where you are asking each turtle to pen-down

这篇关于如何在Netlogo的代码中设置用于笔大小的滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆