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

正文內(nèi)容

動物集群運動行為模型系列之一-預覽頁

2025-06-20 22:30 上一頁面

下一頁面
 

【正文】 避靜態(tài)障礙物原則當Agent感知到靜態(tài)障礙物時,靜態(tài)障礙物只有位置信息,沒有運動信息。分別表示的權(quán)重大小。設Agent與Agent的距離為:1. 當時,表現(xiàn)為一種排斥作用,即躲避性的體現(xiàn),防止它們出現(xiàn)碰撞沖突;2. 當時,表現(xiàn)出一種吸引作用,即向心性的體現(xiàn),確保魚群成為一個整體;3. 當時,處于一個相對平衡和穩(wěn)定的狀態(tài),與進行速度匹配,避免打破這種平衡距離或出現(xiàn)潛在沖突,即對齊性的體現(xiàn),保證魚群朝著相同的方向前進。其中:,將相關(guān)算法利用計算機語言編程,時間微量化逐次迭代就可以得到一般自由運動的魚群集群運動的模擬。Step2記錄射線集合中與障礙物邊界有且只有一個交點的射線的方向向量為、記、與的夾角分別為、。算法流程圖如下:。,K為常量,v為直線速度。基于人工魚群的自組織模型,確立相關(guān)的天敵因子,之后根據(jù)約束因子分配權(quán)重,代入迭代計算,實現(xiàn)魚群逃逸模擬。下面將這個逃逸行為模擬為:設Agent的質(zhì)量為;某遇危險時刻為;速度為逃逸時期望達到的速度為;其遇到捕食者需要旋轉(zhuǎn)的角度為;Agent逃逸期間防止碰撞的排斥力為。If then Else if then Else 式中的“”表示背離捕食者的運動方向,即捕食者在Agent左側(cè),則Agent向右轉(zhuǎn),反之亦然。動物不像人們那樣說話,因為生存和繁衍的需要,他們同樣能夠交流,動物是通過某種信號來喚起或影響其他個體行為的方式就是動物間的通訊。為方便模型建立,將交互過程定義為Agent之間的消息傳遞,我們把通信機制簡化如下::以自身質(zhì)心為中心的,半徑為最大吸引距離的球體;:位于的通信范圍內(nèi)的所有Agent;:a)當每一步運動結(jié)束位置坐標發(fā)生變化后,更新成員庫;b)傳遞位置、運動信息給所有通信對象;c)所有通信對象將它們的位置、運輸信息傳遞給 。但是,歐拉法也有一個明顯的缺點,即忽略了個體的特性。問題二中在前面模型的基礎上,引進當Agent遭遇捕食者時的集群運動模擬算法。問題三同樣是先分析動物信息傳遞方式以及信息傳遞機制建立群體信息交互模型,擴充各自的約束條件并從新賦予相應權(quán)重,迭代計算,得出結(jié)論。eigenvalue=diag(y)。w1=x(:,1)/sum(x(:,1))。3/4,3,3/2,1]。ci21=(lamda4)/3。2,1,2/3,1/2。eigenvalue=diag(y)。 w22=x(:,1)/sum(x(:,1))。clcclear allclose all = 10。 = 50。 = 0。 mov = avifile(39。 Boids_pop_red]。 red_center = Boids_get_center(Boids_pop_red)。 Boids_pop_red = new_Boids_pop_red。end %%%% Advanced shark escape %%%%%% Boid_shark_vec = shark_pos 。Y = []。end Boids_center_mass = Boids_center_mass/。% hold on。or39。% = **sin(5**pi/180)。% hold on。 Boids_pop(iBoid).pos(2)]。b39。)。.b39。2. 群聚中心函數(shù)function center = Boids_get_center(Boids_pop) center = [0 0]。 Boids_pop = []。 = [ xPos yPos] 。end4. 位置限制函數(shù)function new_Boid = Boids_limit_position(Boid, Boids_params)。endif (1) * amp。amp。 (2) 0 (2) = (2) + 。6. 位置實時更新函數(shù)function new_Boids_pop = Boids_move_all_to_new_pos(Boids_pop, Hazard, Hunter_Hunted, Boids_params)。amp。% shark_pos(2) = **sin(2**pi/180)。 v3 = Boids_rule3(Boids_pop, Boids_pop(iBoid))。 end Boid = Boids_limit_velocity(Boid, Boids_params)。 new_Boids_pop= [new_Boids_pop 。endif m_id = id_v。 = RAND() * CBox::WorldPtrGetBoxLength()/3。 // generate random velocity = RAND()。速度更新 // pute speed based on velocity m_speed = ()。 m_dist_to_nearest_flockmate = INFINITY。 m_next = m_prev = NULL。 m_perception_range = Default_Perception_Range。 m_speed = vel_vlength()。 m_num_enemies_seen = 0。ifdef BOID_DEBUG PrintData()。ifdef BOID_DEBUG實時更新位置 myprintf(\n=====\nUpdate for %d\n, m_id)。 // apply velocities. // Step 2: SeeFriends. // Determine if we can see any of our flockmates. SeeFriends (first_boid)。t see anybody) if (m_num_flockmates_seen) { // Step 4: Implement Rule 1 (Separation). // Try to maintain our desired separation distance from our nearest flockmate. AccumulateChanges (acc, KeepDistance())。re supposed to react to enemy flocks, determine // if there are any then avoid them if we can. if (ReactToEnemies) { SeeEnemies (flock_id)。 // Step 8: Constrain acceleration // If our acceleration change is more than we allow, constrain it if (() MaxChange) {ifdef BOID_DEBUG myprintf(WARNING: constraining acceleration for boid %x!\n,this)。 // save off our previous velocity // now add in the acceleration m_vel += acc。re moving faster than we39。 m_speed = MaxSpeed。ifdef BOID_DEBUG myprintf(final position = %f %f %f\n, , )。 float diff = (m_speed DesiredSpeed)/ MaxSpeed。 myprintf( m_speed = %f desired speed = %f\n,m_speed, DesiredSpeed)。 }endif // constrain the urgency level if (urgency MinUrgency) urgency = MinUrgency。 } else if (jitter ) { += MinUrgency * SIGN(diff)。endif // pute velocity change necessary to get to our desired cruising speed ((urgency * (diff 0 ? 1 : 1) ))。ifdef BOID_DEBUG myprintf(\nInside FleeEnemies\n)。ifdef BOID_DEBUG myprintf( final change vector from Cruising = %f %f %f\n, , )。endif // constrain puted ratio to our min/max Urgency levels if (ratio MinUrgency) ratio = MinUrgency。endif // too close...move away from our neighbor (ratio)。endif // in the UNLIKELY event we39。}與最近的同類保持一致// MatchHeading.// Generates a vector for a flock boid to try// to match the heading of its nearest flockmate.vector CBoid::MatchHeading (void){ // copy the heading of our nearest buddy vector change = m_nearest_flockmatem_vel。 // return change vectorifdef BOID_DEBUG myprintf( final change vector from MatchHeading = %f %f %f\n, , )。ifdef BOID_DEBUG myprintf(\nInside SeeEnemies\n)。遇到天敵翻滾 // loop over each flock and determine the closest one we can see for (int i = 0。endif // not our flock, so check it out enemy = CFlock::ListOfFlocks[i]GetFirstMember()。 m_nearest_enemy = enemy。 myprintf( nearest enemy is %x at %f\n,m_nearest_enemy,m_dist_to_nearest_enemy)。ifdef BOID_DEBUG myprintf(\nInside SeeFriends\n)。endif if ((dist = CanISee(flockmate)) != INFINITY) { // add it to the list AddToVisibleList(flockmate)。 }ifdef VISIBILITY_DEBUG myprintf(\n)。}// SteerToCenter.// Generates a vector to guide a flock boid towards// the center of mass of the flockmates he can see.vector CBoid::SteerToCenter (void){ vector center, change。 i++) { if (VisibleFriendsList[i] != NULL) center += VisibleFriendsList[i]m_pos。ifdef BOID_DEBUG myprintf( perceived center after averaging = %f %f %f\n, , )。ifdef BOID_DEBUG myprintf( final change vector from SteerToCenter = %f %f %f\n, , , )。 float maxY = CBox::Wo
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1