Home

Advertisement

wondering
# attach a new Agent/MessagePassing/Flooding to each node on port $MESSAGE_PORT
for {set i 0} {$i < $num_nodes} {incr i} {
    set a($i) [new Agent/MessagePassing/Flooding]
    $n($i) attach  $a($i) $MESSAGE_PORT
    $a($i) set messages_seen {}

    set if_($i) [$n($i) set netif_(0)]

}

# then you can set the transmission power for each node individually :
for {set i 0} {$i < 10} {incr i} {

    if { $i < 5} {
        # transmission range: 40m
        $if_($i) set Pt_ 8.5872e-4   
    } else {
        # transmission range: 100m
        $if_($i) set Pt_ 7.214e-3   
    }
}