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 ภาค Energy Model ตอน เปิด source code (work around)

virtual void DecrTxEnergy(double txtime, double P_tx);
virtual void DecrRcvEnergy(double rcvtime, double P_rcv);
virtual void DecrIdleEnergy(double idletime, double P_idle);

double dEng = P_tx * txtime;
if (energy_ <= dEng)
energy_ = 0.0;
else
energy_ = energy_ - dEng;
if (energy_ <= 0.0)
God::instance()->ComputeRoute();

จาก function 3 functionsข้างต้นที่เคยดู เมื่อพิจารณาดูแล้วพบว่า สามารถประยุกต์เข้ากับ reserved-oriented ได้
เนื่องจากมีการตรวจสอบก่อนว่า energy_ มีเพียงพอไหม ถ้ามีเพียงพอจึงค่อยหักออก แต่ถ้าไม่พอก็จะให้ GOD คำนวนเส้นทางใหม่

และจากการพิจารณาลงลึกไปอีกพบว่ามีตัวแปร(และ functions) ที่น่าสนใจอีกมากมายได้แก่

NodeList ซึ่งนำไปสู่การประเมิน Nodestate
int sleep_mode_; // = 1: radio is turned off
float total_sleeptime_; // total time of radio in off mode
float total_rcvtime_; // total time in receiving data
float total_sndtime_; // total time in sending data
int powersavingflag_; // Is BECA activated ?
float last_time_gosleep; // time when radio is turned off
float max_inroute_time_; // maximum time that a node can remaining active
int maxttl_;// how long a node can keep its neighbor list. For AFECA only.
int state_; // used for AFECA state
float state_start_time_; // starting time of one AFECA state
int adaptivefidelity_; // Is AFECA activated ?
AdaptiveFidelityEntity *afe_;
bool node_on_; // on-off status of this node -- Chalermek

มาถึงตรงนี้ก็มั่นใจว่าต้องเขียนได้แน่ๆ แต่ต้องใช้เวลาในการเชื่อมโยง class ต่างเข้าด้วยกัน
ต่อไป จะไปสนใจสิ่งที่ยังทำไม่ได้บน NS2 คือการหาค่าเฉลี่ยต่างๆ การหาอัตราส่วนปริมาณข้อมูลที่ต้องส่งและปริมาณที่ส่งได้จริง รวมทั้งศึกษาพฤติกรรมของ traffic แบบต่างๆ


Create Date : 23 พฤษภาคม 2548
Last Update : 23 พฤษภาคม 2548 23:17:21 น. 2 comments
Counter : 428 Pageviews.

 
เห็นแล้วปวดกบาลกับ sourcecode เหอะๆ


โดย: panumas05 วันที่: 23 พฤษภาคม 2548 เวลา:23:42:21 น.  

 
พี่คับผมจะทำโปรเจค Wireless LAN Simulator อ่ะคับ
ควรจะใช้ภาษาอะไรเขียนดีครับ ควรจะทำยังงัยมั่งคับ
ขอความกรุณาด้วยคับ
ขอบคุณคับผม


โดย: Au IP: 61.7.140.222 วันที่: 21 ธันวาคม 2548 เวลา:17:17:12 น.  

ชื่อ :
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.