第7回岩尾俊兵研究会NetLogo

今回は、「Dining Philosophers」というモデルのコードの読み合わせをしました。
http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Computer%20Science/Dining%20Philosophers.nlogo' target='blank'>http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Computer%20Science/Dining%20Philosophers.nlogo' target='blank'>http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Computer%20Science/Dining%20Philosophers.nlogo'>http://www.netlogoweb.org/launch#http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Computer%20Science/Dining%20Philosophers.nlogo

このコードは、命名と定義をひたすら繰り返している点が特徴的でした。
プロシージャ内でいったん仮の命名をして、あとからその定義を書き足していくというスタイルです。プロシージャは簡潔にまとまっており読みやすかった一方、定義のコードがどこにあるのか見失う場面もありました。自分で書くときは迷子にならないよう、また、定義のし忘れがないよう、注意する必要がありそうです。

関連記事