I run my protocol of spbm, which uses greedy & perimeter routing,
  I can compile my code,but got the error
  missing close-brace: possible unbalanced brace in comment    
while executing
"proc create-spbm-mobile-node { id args } {
    global ns ns_ chan prop topo tracefd opt node_    
set ns_ [Simulator instance]    
#if {[Simulator s..."    (file "tcl/mobility/spbm.tcl" line 87)
and the Tcl script is as shown below:
  Agent/SPBMAgent set sport_        0
Agent/SPBMAgent set dport_        0
Agent/SPBMAgent set bint_         0.5 ;# beacon interval
Agent/SPBMAgent set bdesync_      0.5 ;# beacon desync random component
Agent/SPBMAgent set bexp_         [expr 3*([Agent/SPBMAgent set 
bint_]+[Agent/SPBMAgent set bdesync_]*[Agent/SPBMAgent set bint_])] ;# beacon 
timeout interval
Agent/SPBMAgent set pint_         1.5 ;# peri probe interval
Agent/SPBMAgent set pdesync_      0.5 ;# peri probe desync random component
Agent/SPBMAgent set lpexp_        8.0 ;# peris unused timeout interval
Agent/SPBMAgent set use_mac_      0        ;# use link breakage feedback from 
Agent/SPBMAgent set use_peri_     0       ;# probe and use perimeters
Agent/SPBMAgent set verbose_      0        ;#
Agent/SPBMAgent set peri_proact_  1       ;# proactively generate peri probes
Agent/SPBMAgent set use_implicit_beacon_ 0 ;# all packets act as beacons; 
Agent/SPBMAgent set use_planar_   0        ;# planarize graph
Agent/SPBMAgent set use_loop_detect_ 0     ;# look for unexpected loops in peris
Agent/SPBMAgent set use_timed_plnrz_ 0     ;# replanarize periodically
  set opt(ragent)         Agent/SPBMAgent
  set opt(pos)  NONE   ;# Box or NONE
  if { $opt(pos) == "Box" } {
 puts "*** SPBM using Box configuration..."
  Agent instproc init args {
    eval $self next $args
  Agent/SPBMAgent instproc init args 
     eval $self next $args
 proc create-spbm-routing-agent { node id } {
     global ns_ ragent_ tracefd opt    #  Create the Routing Agent and attach 
it to port 255.
 set ragent_($id) [new $opt(ragent)]
 set ragent $ragent_($id)
    ## setup address (supports hier-addr) for spbm agent    
 ## and mobilenode
 set addr [$node node-addr]
  $ragent node $node
 if [Simulator set mobile_ip_] {
 $ragent port-dmux [$node set dmux_]
      $node addr $addr
  $node set ragent_ $ragent
  #$node attach $ragent 255
      $node attach $ragent [Node set rtagent_port_]
  $ns_ at 0.0 "$ragent_($id) start-spbm" ;   # Drop Target (always on 
regardless of other tracing)
    set drpT [cmu-trace Drop "RTR" $node]
    $ragent drop-target $drpT
    # Log Target
      set T [new Trace/Generic]
    $T target [$ns_ set nullAgent_]
    $T attach $tracefd
    $T set src_ $id
    $ragent tracetarget $T
      # ifq
    $ragent add-ifq [$node set ifq_(0)]
proc create-spbm-mobile-node { id args } {
    global ns ns_ chan prop topo tracefd opt node_
      set ns_ [Simulator instance]
      #if {[Simulator set EnableHierRt_]} {
    if [Simulator hier-addr?]
   if [Simulator set mobile_ip_]
     set node_($id) [new MobileNode/MIPMH $args]
 #    set node_($id) [new Node/MobileNode/BaseStationNode $args]
 set node_($id) [new Node/MobileNode]
    set node $node_($id)
    $node random-motion 0  ;# disable random motion
    $node topography $topo
    # XXX Activate energy model so that we can use sleep, etc. But put on
    # a very large initial energy so it'll never run out of it.
   if [info exists opt(energy)]    {
       $node addenergymodel [new $opt(energy) $node 1000 0.5 0.2]
   # This Trace Target is used to log changes in direction
 # and velocity for the mobile node. 
 #  set T [new Trace/Generic]
 $T target [$ns_ set nullAgent_]    
 $T attach $tracefd
 $T set src_ $id    
 $node log-target $T    
 if ![info exist opt(err)]    
 set opt(err) ""
 if ![info exist opt(outerr)] {
 set opt(outerr) ""
 if ![info exist opt(fec)] {
 set opt(fec) ""
 $node add-interface $chan $prop $opt(ll) $opt(mac) \   
   $opt(ifq) $opt(ifqlen) $opt(netif) $opt(ant) $topo $opt(err) $opt(outerr) 
      # Create a Routing Agent for the Node
 #  create-$opt(rp)-routing-agent $node $id   
   if { $opt(pos) == "Box" } {  # Box Configuration
 #set spacing 200  
 set maxrow 7 
 set col [expr ($id - 1) % $maxrow]  
 set row [expr ($id - 1) / $maxrow]  
 $node set X_ [expr $col * $spacing]
 $node set Y_ [expr $row * $spacing]  
 $node set Z_ 0.0
 $node set speed_ 0.0
 $ns_ at 0.0 "$node_($id) start"
 return $node
  If any one can point out the error.........then it is too good for me.........
  Reply quickly if possible.
  Thanks in advance...............

 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 

Reply via email to