freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

動(dòng)物集群運(yùn)動(dòng)行為模型系列之二-資料下載頁(yè)

2025-05-23 18:29本頁(yè)面
  

【正文】 end end if count ~= 0 center = center/count。 centerUrge(n,:) = center centerUrge(n,:)。 end end %計(jì)算velocityUrge for n = 1:agentnum count = 0。 for m = 1:agentnum if neighborArray(n,m) == 1 %用于記錄agent個(gè)數(shù) count = count + 1。 aveVelocity = aveVelocity + velocity(m,:)。 end end if count ~= 0 aveVelocity = aveVelocity/count。 velocityUrge(n,:) = aveVelocity velocityUrge(n,:)。 end end %計(jì)算spacingUrge for n = 1:agentnum for m = 1:agentnum if neighborArray(n,m) == 1 toNeighbor = sqrt((x(m)x(n))^2 + (y(m)y(n))^2)。 if toNeighbor cruiseDistance spacingUrge(n,:) = spacingUrge(n,:) + toNeighbor。 end end end end %單位化向量 for q = 1:agentnum wanderUrgeL = sqrt(wanderUrge(q,1)^2 + wanderUrge(q,2)^2)。 worldCenterUrgeL = sqrt(worldCenterUrge(q,1)^2 + worldCenterUrge(q,2)^2)。 centerUrgeL = sqrt(centerUrge(q,1)^2 + centerUrge(q,2)^2)。 velocityUrgeL = sqrt(velocityUrge(q,1)^2 + velocityUrge(q,2)^2)。 spacingUrgeL = sqrt(spacingUrge(q,1)^2 + spacingUrge(q,2)^2)。 if wanderUrgeL ~= 0 wanderUrge(q,:) = wanderUrge(q,:) / wanderUrgeL。 wanderUrge(q,:) = wanderUrge(q,:) * wanderConstant。 end if worldCenterUrgeL ~= 0 worldCenterUrge(q,:) = worldCenterUrge(q,:) / worldCenterUrgeL。 worldCenterUrge(q,:) = worldCenterUrge(q,:) * wanderConstant。 end if centerUrgeL ~= 0 centerUrge(q,:) = centerUrge(q,:) / centerUrgeL。 centerUrge(q,:) = centerUrge(q,:) * centerConstant。 end if velocityUrgeL ~= 0 velocityUrge(q,:) = velocityUrge(q,:)/velocityUrgeL。 velocityUrge(q,:) = velocityUrge(q,:) * velocityConstant。 end if spacingUrgeL ~= 0 spacingUrge(q,:) = spacingUrge(q,:)/spacingUrgeL。 spacingUrge(q,:) = spacingUrge(q,:) * spacingConstant。 end end %計(jì)算acceleration = (worldCenterUrge + centerUrge + velocityUrge + spacingUrge + wanderUrge) for p = 1:agentnum acceleration(p,:) = worldCenterUrge(p,:) + centerUrge(p,:) + velocityUrge(p,:) + spacingUrge(p,:) + wanderUrge(p,:)。 accelerationL = sqrt(acceleration(p,1)^2 + acceleration(p,2)^2)。 if accelerationL ~= 0 acceleration(p,:) = acceleration(p,:) / accelerationL。 end acceleration(p,:) = acceleration(p,:) * maxAcceleration。 end %記錄時(shí)間 time = 。 pause(time) %依據(jù)acceleration跟新各agent的速度信息, v=v+a*t. for t = 1:agentnum velocity(t,:) = velocity(t,:) + acceleration(t,:) * time。 newvelocity = sqrt(velocity(t,1)^2 + velocity(t,2)^2)。 if newvelocity maxVelocity velocity(t,:) = (velocity(t,:) / newvelocity) * maxVelocity。 end end %依據(jù)velocity跟新各agent的位置信息,x=x+v*t. for v = 1:agentnum position(v,:) = position(v,:) + velocity(v,:) * time。 end iterate = iterate+1。end25
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1