randomTrue(0.5) 是什么意思
randomTrue定义变量为真的可能性(0.5表示50%的可能性)
randomTrue(0.5)?Color.red:Color.black 或 randomTrue(0.5)?red:black
fillRectangle(x,y,width,height,color) 填充
.getC() 获得列数
.getR() 获得行数
this 当前智能体
Agent[] neighbors=getNeighbors(); 得到智能体的邻居们
mapCanvas.clearRectangle(x,y,width,height) 画布.清空
jumpToRandomEmptyCell();跳转到一个随机的空的位置 这个位置不是画布上的 是本来离散的位置