Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Netlogo 问题在于一定数量的海龟具有特定的属性_Netlogo - Fatal编程技术网

Netlogo 问题在于一定数量的海龟具有特定的属性

Netlogo 问题在于一定数量的海龟具有特定的属性,netlogo,Netlogo,我的NetLogo模型遇到问题。当我试图给一定数量的海龟(这里是“Akteure”)一个特定的值,我想先将该值设置为1(其中之一),然后用滑块控制该值时,我只查看随机数,通常高于我在下面代码中设置的限制值 clear-all reset-ticks set radius max-pxcor - 2 create-ordered-Akteure number-of-Akteure[ fd max-pxcor - 5 rt 90 set size 3 set sha

我的NetLogo模型遇到问题。当我试图给一定数量的海龟(这里是“Akteure”)一个特定的值,我想先将该值设置为1(其中之一),然后用滑块控制该值时,我只查看随机数,通常高于我在下面代码中设置的限制值

  clear-all
  reset-ticks
  set radius max-pxcor - 2
  create-ordered-Akteure number-of-Akteure[
  fd max-pxcor - 5
  rt  90
  set size 3
  set shape "person"
  set color white
  set Information1 false
  set Information2 false
  set Macht_neutral true
  ask one-of Akteure [set information1 true] 
      if Information1 [set color green]
  ask one-of Akteure [set Information2 true]
      if Information2 [set Color Red]
  ask one-of Akteure [set shape "kings"]
    if shape = "Kings" [set Macht_hoch true]
  ask one-of Akteure [set shape "Bauer"]
    if shape = "Bauer" [set Macht_gering true] 
   ]```


What am I ignoring, where is my mistake?

Jan

我认为一个问题是,您在
create ordered Akteure
块中设置这些值,以便
number of Akteure
-乘以一个随机Akteur将被设置,例如设置为Bauer。只需在
询问其中一个之前关闭块,然后加入设置的代码块:

  create-ordered-Akteure number-of-Akteure
  [
    fd max-pxcor - 5
    rt  90
    set size 3
    set shape "person"
    set color white
    set Information1 false
    set Information2 false
    set Macht_neutral true
  ]
  ask one-of Akteure 
  [
    set information1 true
    set color green
  ]
  ask one-of Akteure 
  [
    set Information2 true
    set Color Red
  ]
  ask one-of Akteure 
  [
    set shape "kings"
    set Macht_hoch true
  ]
  ask one-of Akteure 
  [
    set shape "Bauer"
    set Macht_gering true
  ] 
我更喜欢在新行中打开一个块,这样我就可以很容易地看到哪个块是闭合的,但这可能只是一个风格问题