[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proc create-base-station-node {address}



Hi,

I don't understand this part of code found in ~ns/tcl/mobility/com.tcl :

proc create-base-station-node {address } {
    global topo tracefd opt node node_ ns_
    set ns_ [Simulator instance]
    if [Simulator set mobile_ip_] {
        Simulator set node_factory_ MobileNode/MIPBS
    } else {
        Simulator set node_factory_ Node/MobileNode/BaseStationNode
    }
    #set ns_ $ns
    set node [$ns_ node $address]
    set id [$node id]
    #set node_($id) $node    ;#XXX does wireless code use this global
array?
        
    $node random-motion 0               ;# disable random motion
    $node topography $topo

It seems that node is instanciated as a Node : 
set node [$ns_ node $address]
but it is used as a MobileNode (the two last lines)

If node is a Node, where are defined the two lasr methods used.
If it is a MobileNode, what is the mechanism to instanciate it in this
code.

Thanks,
 
-- 
Vera Mickael Stagiaire