A tripartite evolutionary game model

A tripartite evolutionary game model preview image

1 collaborator

Default-person Chen Sheeran (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.4.0 • Viewed 50 times • Downloaded 0 times • Run 0 times
Download the 'A tripartite evolutionary game model' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;为方便代码编写,界面及程序中部分变量与论文中所用符号不同,其中cstg代表论文中的cg,cstp代表cp,cstc代表ce,bilp代表bp,bilc1代表be1,bilc2代表be2,rate代表θ。
;time为模型运行的时长

breed [govs gov]
breed [plats plat]
breed [corps corp]

govs-own [gselect1 gselect2 ggain1 ggain2]  ;每个政府上一轮的选择用0/1表示在gselect2,之前的选择储存在gselect1,政府之前博弈获得的收益储存在ggain1中,上一轮收益储存在ggain2中
plats-own [pselect1 pselect2 pgain1 pgain2]
corps-own [cselect1 cselect2 cgain1 cgain2]

globals [
  ng np nc  ;选择监管/监督/实施绿色物流的企业数量
  bg0 bg1 bp0 bp1 bc0 bc1  ;政府/平台/企业不同策略的收益
  x11 x12 x13 x21 x22 x23 x31 x32 x33 x41 x42 x43 x51 x52 x53 x61 x62 x63 x71 x72 x73 x81 x82 x83  ;对应特征值表的数值
  i k stablet z temp
]

to setup
  clear-all
  set temp 0
  set z 0
  create-govs 1000  ;假设每类主体均有1000个个体
  create-plats 1000
  create-corps 1000
  printeigenvalue
  set ng x0 * 1000
  set np y0 * 1000
  set nc z0 * 1000
  setquantity
  reset-ticks
end 

to printeigenvalue
  set x11 0 - cstg + A + G
  set x21 0 - cstg - bilc1
  set x31 0 - cstg - bilp + A + G
  set x41 0 - cstg - bilp - bilc1
  set x51 0 - x11
  set x61 0 - x21
  set x71 0 - x31
  set x81 0 - x41
  set x12 0 - cstp + P
  set x22 0 - cstp - bilc2
  set x32 0 - x12
  set x42 0 - x22
  set x52 0 - cstp + bilp + P
  set x62 0 - cstp + bilp - bilc2
  set x72 0 - x52
  set x82 0 - x62
  set x13 0 - cstc + ( 1 - rate ) * ( t + L )
  set x23 0 - x13
  set x33 0 - cstc + bilc2 + ( 1 - rate ) * ( t + L )
  set x43 0 - x33
  set x53 0 - cstc + bilc1 + A + ( 1 - rate ) * ( t + L )
  set x63 0 - x53
  set x73 0 - cstc + bilc1 + A + bilc2 + ( 1 - rate ) * ( t + L )
  set x83 0 - x73
end 

to setquantity ;初始化三类主体的决策
  set i 1
  ask govs [
    set gselect1 0
    set gselect2 0
    if i <= ng [
      set gselect1 1
      set gselect2 1
      set i i + 1
    ]
  ]
  set i 1
  ask plats [
    set pselect1 0
    set pselect2 0
    if i <= np [
      set pselect1 1
      set pselect2 1
      set i i + 1
    ]
  ]
  set i 1
  ask corps [
    set cselect1 0
    set cselect2 0
    if i <= nc [
      set cselect1 1
      set cselect2 1
      set i i + 1
    ]
  ]
end 

to go
  every 0.01 [
    if ticks >= time [ stop ]
    gchoose
    pchoose
    cchoose
    countn
    tick
  ]
end 

to gchoose  ;政府进行新一轮决策
  set bg1 0 - cstg - np * bilp / 1000 - nc * bilc1 / 1000 + nc * E / 1000 + A - nc * A
  set bg0 nc * E / 1000 - G + nc * G / 1000
  ask govs [
    set k 0
    if gselect2 = 0 [
      set ggain2 bg0
      if ggain2 < ggain1 and gselect1 = 1 [ set k 1 ]
      if ggain2 >= ggain1 and gselect1 = 1 [ set gselect1 gselect2 ]
    ]
    if gselect2 = 1 [
      set ggain2 bg1
      if ggain2 < ggain1 and gselect1 = 0 [ set k 1 ]
      if ggain2 >= ggain1 and gselect1 = 0 [ set gselect1 gselect2 ]
    ]
    if k = 1 [
      if gselect2 = 0 [ set gselect2 1 set temp 1]
      if gselect2 = 1 and temp = 0 [ set gselect2 0 ]
      set temp 0
    ]
    if random 100 < 1 [
      if gselect2 = 0 [ set gselect2 1 set temp 1]
      if gselect2 = 1 and temp = 0 [ set gselect2 0 ]
      set temp 0
    ]
    set ggain1 ggain2
  ]
end 

to pchoose
  set bp1 0 - cstp + ng * bilp / 1000 - nc * bilc2 / 1000 + nc * S / 1000
  set bp0 nc * S / 1000 - P + nc * P / 1000
  ask plats [
    set k 0
    if pselect2 = 0 [
      set pgain2 bp0
      if pgain2 < pgain1 and pselect1 = 1 [ set k 1 ]
      if pgain2 >= pgain1 and pselect1 = 1 [ set pselect1 pselect2 ]
    ]
    if pselect2 = 1 [
      set pgain2 bp1
      if pgain2 < pgain1 and pselect1 = 0 [ set k 1 ]
      if pgain2 >= pgain1 and pselect1 = 0 [ set pselect1 pselect2 ]
    ]
    if k = 1 [
      if pselect2 = 0 [ set pselect2 1 set temp 1]
      if pselect2 = 1 and temp = 0 [ set pselect2 0 ]
      set temp 0
    ]
    if random 100 < 2 [
      if pselect2 = 0 [ set pselect2 1 set temp 1]
      if pselect2 = 1 and temp = 0 [ set pselect2 0 ]
      set temp 0
    ]
    set pgain1 pgain2
  ]
end 

to cchoose
  set bc1 0 - cstc + ng * bilc1 / 1000 + np * bilc2 / 1000 + t
  set bc0 0 - ng * A / 1000 + rate * t - ( 1 - rate ) * L
  ask corps [
    set k 0
    if cselect2 = 0 [
      set cgain2 bc0
      if cgain2 < cgain1 and cselect1 = 1 [ set k 1 ]
      if cgain2 >= cgain1 and cselect1 = 1 [ set cselect1 cselect2 ]
    ]
    if cselect2 = 1 [
      set cgain2 bc1
      if cgain2 < cgain1 and cselect1 = 0 [ set k 1 ]
      if cgain2 >= cgain1 and cselect1 = 0 [ set cselect1 cselect2 ]
    ]
    if k = 1 [
      if cselect2 = 0 [ set cselect2 1 set temp 1]
      if cselect2 = 1 and temp = 0 [ set cselect2 0 ]
      set temp 0
    ]
    if random 100 < 2 [
      if cselect2 = 0 [ set cselect2 1 set temp 1]
      if cselect2 = 1 and temp = 0 [ set cselect2 0 ]
      set temp 0
    ]
    set cgain1 cgain2
  ]
end 

to countn  ;清点本轮决策结束后三类主体的决策情况
  set ng 0
  set np 0
  set nc 0
  ask govs [ if gselect2 = 1 [ set ng ng + 1 ] ]
  ask plats [ if pselect2 = 1 [ set np np + 1 ] ]
  ask corps [ if cselect2 = 1 [ set nc nc + 1 ] ]
  if nc >= 950 [ set z z + 1 ]
  if nc < 950 and z > 1 and z < 10 [ set z 0 ]
  if z = 10 [ set stablet ticks set z z + 1]  ;记录连续10轮博弈物流企业执行率均大于95%的时间
end 

There is only one version of this model, created 3 months ago by Chen Sheeran.

Attached files

File Type Description Last updated
A tripartite evolutionary game model.png preview Preview for 'A tripartite evolutionary game model' 3 months ago, by Chen Sheeran Download

This model does not have any ancestors.

This model does not have any descendants.