如何根据给定的参数为代理赋予不同程度的色调?

时间:2019-04-22 08:45:09

标签: colors netlogo agent-based-modeling shading

我已经在一个行业(世界)中建立了公司(乌龟),并给了我一个(公司自己的)参数,称为公司自动化水平。在设置时,此参数的值介于0到0.1之间(设置为0.1到0.11,因为该值永远不能是最小-最大值之一。)每一刻,该参数都会与另一个乌龟拥有的参数(即研发投资)成比例增加。

我想给乌龟以更强的自动化度,这取决于它们所处的效率。因此,自动化水平的固定值越高,其色度就越强。我该如何实施?

breed [ firms firm ] 

firms-own [ 
  firm-level-of-automation
  r&d-investment ]    

to setup 
  ask firms [  
    set firm-level-of-automation random-between ( 0.01 ) 0.11 ] 
end

to go
  ask firms [
    set firm-level-of-automation firm-level-of-automation + ( r&d-investment * 0.05 )   ;; initially random between >0 and <1 but increases proportionally according to R&D investment
   if firm-level-of-automation = 0.99 [ stop ]   ;; 99% is the level of full automation
   set r&d-investment 0 ]   ;; no R&D investment needed anymore
end

to-report random-between [ min-num max-num ]   ;; auxiliary code
   report random-float (max-num - min-num) + min-num
end

0 个答案:

没有答案