Silly Computer Engineer.
Lin~Jing~Sen
Something as small as the flutter of the butterfly's wing
can ultimately cause a typoon half way around the world

Group Blog
 
All Blogs
 
NS2 ภาค shadowing ตอน ถามเพื่อนถึงความแปลกๆ

จากหัวข้อ NS2 ภาค shadowing propagation model ก็เลยโทรไปถามบอลเพื่อนรัก เด็กไฟฟ้าสื่อสาร เพิ่งจบโทจากจุฬาไม่นาน (โฆษณาเพื่อนสักน้อย) มันก็ไม่ค่อยรู้ แป๋ว เพราะมันลงลึกถึงระดับสัญญาณ พวก concept บางตัวก็ไม่ค่อยรู้ ได้คำแนะนำดังนี้ 1.วางตำแหน่งผิด ทำให้มันส่งถึงกันได้โดยตรง ซึ่งค่อนข้างมันใจว่าวางไว้ไกลพอที่จะส่งกันไม่ถึง 2.ลองตรวจสอบระดับสัญญาณที่ reciever ดู

คำแนะนำข้อ 2. นี่ในส่วนของ trace ของ NS2 เองยังหาไม่เจอว่าทำยังไง แต่ใน Header file ของ mobile/shadowing.h มีฟังก์ชั่นที่ return ระดับพลังงานที่ได้รับ ที่ inherit มาจากคลาส propagation อีกทีหนึ่ง



#ifndef shadowing_h
#define shadowing_h

#include
#include
#include
#include
#include

class Shadowing : public Propagation {
public:
Shadowing();
~Shadowing();
virtual double Pr(PacketStamp *tx, PacketStamp *rx, WirelessPhy *ifp);
virtual double getDist(double Pr, double Pt, double Gt, double Gr,
double hr, double ht, double L, double lambda) {
return DBL_MAX;
}
virtual int command(int argc, const char*const* argv);

protected:
RNG *ranVar; // random number generator for normal distribution

double pathlossExp_; // path-loss exponent
double std_db_; // shadowing deviation (dB),
double dist0_; // close-in reference distance
int seed_; // seed for random number generator
};

#endif



ถ้า trace ของ NS2 เองไม่มี option ในการตรวจสอบระดับพลังงานที่ receiver ......อาจต้องแก้ source code เพิ่มเข้าไป ซึ่งคิดว่าทำได้นะ แต่ใช้เวลาหน่อยว่าอะไรต่อกับอะไร

อีกวิธีก็คือ นั่งดู trace file ตรงช่วงที่มีเหตุการณ์แปลกๆ ซึ่งตัดออกมาได้ประมาณ 14 หน้า โอ้ว แล้วจะไปนั่งดู

ถ้ามี tool สำหรับแสดง Class hierachy ของ C++ ก็ดีจะได้ไม่ต้องเปิดดูทีละไฟล์ เหนื่อย @.@


Create Date : 17 พฤษภาคม 2548
Last Update : 17 พฤษภาคม 2548 16:30:48 น. 0 comments
Counter : 516 Pageviews.

ชื่อ :
Comment :
  *ใช้ code html ตกแต่งข้อความได้เฉพาะสมาชิก
 

nmapxp
Location :
กรุงเทพ Thailand

[Profile ทั้งหมด]

ฝากข้อความหลังไมค์
Rss Feed

ผู้ติดตามบล็อก : 1 คน [?]





Friends' blogs
[Add nmapxp's blog to your web]
Links
 

 Pantip.com | PantipMarket.com | Pantown.com | © 2004 BlogGang.com allrights reserved.