シミュレーションの自動終了の方法がわかりません。
artisocの初心者です。 基本的な質問失礼します。 「人口社会構築指南」に記載の「アクセルロッドの文化変容モデル」において、これ以上文化変容が行われなくなったとき(文化変容が完了したとき)、自動的にシミュレーションを終了する方法が分かりません。 具体的には、「実行環境設定」の「終了条件式」に書き込むべき、イフ文の条件式が分かりません。 以下、アクセルロッドの文化変容モデルの式です。 Agt_Init{ my.trait=CStr(int(rnd()*10))&cstr(int(rnd()*10))&cstr(int(rnd()*10)) my.view=RGB(cint(mid(my.trait,1,1))*28,cint(mid(my.trait,2,1))*28,cint(mid(my.trait,3,1))*28) } Agt_Step{ dim neighbor as agtset dim one as agt dim i as integer dim s as integer s=0 makeallagtsetaroundowncell(neighbor,1,false) one=getagt(neighbor,int(rnd()*countagtset(neighbor))) for i=1 to 3 if mid(one.trait,i,1)==mid(my.trait,i,1)then s=s+1 end if next i if s==2 and rnd()*3>=1 then my.trait=one.trait my.view=one.view elseif s==1 and rnd()*3>=1 then if mid(my.trait,1,1)==mid(one.trait,1,1)then if rnd()<0.5 then my.trait=mid(my.trait,1,1)&mid(one.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(my.trait,2,1)&mid(one.trait,3,1) end if elseif mid(my.trait,2,1)==mid(one.trait,2,1)then if rnd()<0.5 then my.trait=mid(one.trait,1,1)&mid(my.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(my.trait,2,1)&mid(one.trait,3,1) end if else if rnd()<0.5 then my.trait=mid(one.trait,1,1)&mid(my.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(one.trait,2,1)&mid(my.trait,3,1) end if end if end if my.view=RGB(cint(mid(my.trait,1,1))*28,cint(mid(my.trait,2,1))*28,cint(mid(my.trait,3,1))*28) }
artisocの初心者です。 基本的な質問失礼します。 「人口社会構築指南」に記載の「アクセルロッドの文化変容モデル」において、これ以上文化変容が行われなくなったとき(文化変容が完了したとき)、自動的にシミュレーションを終了する方法が分かりません。 具体的には、「実行環境設定」の「終了条件式」に書き込むべき、イフ文の条件式が分かりません。 以下、アクセルロッドの文化変容モデルの式です。 Agt_Init{ my.trait=CStr(int(rnd()*10))&cstr(int(rnd()*10))&cstr(int(rnd()*10)) my.view=RGB(cint(mid(my.trait,1,1))*28,cint(mid(my.trait,2,1))*28,cint(mid(my.trait,3,1))*28) } Agt_Step{ dim neighbor as agtset dim one as agt dim i as integer dim s as integer s=0 makeallagtsetaroundowncell(neighbor,1,false) one=getagt(neighbor,int(rnd()*countagtset(neighbor))) for i=1 to 3 if mid(one.trait,i,1)==mid(my.trait,i,1)then s=s+1 end if next i if s==2 and rnd()*3>=1 then my.trait=one.trait my.view=one.view elseif s==1 and rnd()*3>=1 then if mid(my.trait,1,1)==mid(one.trait,1,1)then if rnd()<0.5 then my.trait=mid(my.trait,1,1)&mid(one.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(my.trait,2,1)&mid(one.trait,3,1) end if elseif mid(my.trait,2,1)==mid(one.trait,2,1)then if rnd()<0.5 then my.trait=mid(one.trait,1,1)&mid(my.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(my.trait,2,1)&mid(one.trait,3,1) end if else if rnd()<0.5 then my.trait=mid(one.trait,1,1)&mid(my.trait,2,1)&mid(my.trait,3,1) else my.trait=mid(my.trait,1,1)&mid(one.trait,2,1)&mid(my.trait,3,1) end if end if end if my.view=RGB(cint(mid(my.trait,1,1))*28,cint(mid(my.trait,2,1))*28,cint(mid(my.trait,3,1))*28) }
