私の研究では、実際の作業環境を表すシミュレーションを構築しようとしています。 特に、私は人が複数のチームで働くシナリオをモデリングしています(一度に1つのプロジェクトだけで作業しますか?多くはそうしません...)。これを行うには、私はNetLogoで作業しています。エージェントまたはエージェントセットになると予想される入力をASKしてください。代わりにNOBODYを取得しました
カスタムリンクカメルセットの特定のエージェントに対するASKに問題があります。要点は、「入力がエージェントまたはエージェントセットになると思っていましたが、代わりにNOBODYがある」とエラーを報告することがありますが、エージェントが存在しない場合は「ASK」に到達してはいけません。私は間違って何をしていますか?
機能は以下の通りです:
to TeamRecruiting
;; I ask non-complete teams to...
ask teams with [ teamsize != (count membership-neighbors) ]
[
;; ... count how many individuals they have...
let actualteammembers count membership-neighbors
;; ... to save locally how many individuals they can share...
let teamoverlap overlap
;; ... their target size...
let neededsize teamsize
;; ... and their identity.
let teamwho who
;; then I ask those individuals that have not yet more things than they can handle...
ask individuals with [ indMTM != (count membership-neighbors) ]
[
;; ... to save locally who they are...
let indwho who
let createdalink 0
;; ... then if some conditions have been met ...
if(some conditions)
[
;; I create a link (of my specific type) with the team...
create-membership-with team teamwho
;; I do the following because more than one individual could join the team teamwho in the same run of the function
ask team teamwho [ set actualteammembers (actualteammembers + 1) ]
set createdalink 1
]
;; if the association occurred, ...
if(createdalink = 1)
[
;; we ask all other teams to evaluate if the new connection violates their maximum overlap constraint between the team I am considering from the beginning of the function, and all other teams, in other words...
ask teams with [ who != teamwho ]
[
let numpaths 0
let team2who who
;; I count how many individuals say that they are shared by the two teams
ask individuals
[
if((membership-neighbor? team teamwho) and (membership-neighbor? team team2who)) [ set numpaths (numpaths + 1) ]
]
;; ... and if the number of paths is more than the maximum allowed overlap...
if(numpaths > teamoverlap)
[
;; I take the connection away...
ask membership teamwho indwho [ die ]
;; and I reduce the actual number of team members
set actualteammembers (actualteammembers - 1)
]
]
]
]
]
end
あなたの貴重な助けをありがとう!
注:この問題は次の場所で発生します:ask membership teamwho indwho [die] – ValerioI