[ns] about setting the mobile node color

=?gb2312?B?wrO1wsC0?= ludelai at hotmail.com
Thu Jan 24 21:20:15 PST 2008


Dear all
   Today, I want to set my mobile nodes to color
  
for {set i 0} {$i < $val(nn) } {incr i} {  set node_($i) [$ns_ node]   $node_($i) random-motion 0  $node_($i) color blue  $node_($i) label mobible }
 
here label "mobile" can turn up, but color is still black. what is the problom
I also changed the file "ns-lib.tcl", but problem still exist.
 
Simulator instproc initial_node_pos {nodep size} { $self instvar addressType_ $self instvar energyModel_ 
 if [info exists energyModel_] {    set nodeColor "green" } else {#  set nodeColor "black"# Added by delai to change the color for mobile nodes,use < $node color "color" >    set tempColor [$nodep set attr_(COLOR)]   if{$tempColor=="green"} {     puts "Green is reserved for nodes with energy model, you shall not set your node to green~~~"     set tempColor "black"     }   puts "Node color is set to $tempColor"   set nodeColor $tempColor }
 
please help me
_________________________________________________________________
MSNÊ¥µ®ÀñÎï»ðÈȵdz¡£¬Ãâ·Ñ·¢·ÅÖУ¬¿ìÀ´ÁìÈ¡°É£¡
http://im.live.cn/emoticons/?ID=18


More information about the Ns-users mailing list