$ ns-lar vanet-DSDV-dream_2.tcl > vanet-dsdv-dream_2_result.txt
// the result is attached
$ nam brad &
# =====================================================================
# DREAM options
# =====================================================================
# This is the earliest time a location packet might be sent
set locationStartTime 1.1
# Location packets will be started uniform randomly between $locationStartTime
# and $locationStartTime + $locationStartOffset
set locationStartOffset 5
# Set the seed of the default random number generator.
#ns-random 538474442L
# This is the random variable that determines when the location
# information will start sending.
set randomVar [new RandomVariable/Uniform]
$randomVar set min_ $locationStartTime
$randomVar set max_ [expr $locationStartTime + $locationStartOffset]
# =====================================================================
# =====================================================================================
# Create dream agents and attach them to the nodes
# =====================================================================================
for {set i 0} {$i < $val(nn)} {incr i} {
set d($i) [new Agent/Dream]
$node_($i) attach $d($i) 253
# need to tell the geocast agents about their link layers
set ll($i) [$node_($i) set ll_(0)]
$ns_ at 0.0 "$d($i) set-ll $ll($i)"
# need to tell the geocast agents which nodes they're on also
$ns_ at 0.0 "$d($i) set-node $node_($i)"
# This is the number of short location packets per long packet
$ns_ at 0.0 "$d($i) set-freqOfLongLocationPackets 13"
# This is the transmission distance of the node, so that the
# dream agent can make the right size circle.
$ns_ at 0.0 "$d($i) set-neighborDistance 100"
# This is the distance that a short location packet will travel.
# If set to -1 the packet will travel the whole screen and if set to
# 0 then only one packet will be sent per locaiton packet except
# if there are two nodes in the exact same place.
# 100 for old way
$ns_ at 0.0 "$d($i) set-shortLocationPacketDistance 0"
#$ns_ at 0.0 "$d($i) set-shortLocationPacketDistance 0"
# This is the transmission distance of the long location packets
# this is set to -1 for and infinite transmission distance (entire net)
$ns_ at 0.0 "$d($i) set-longLocationPacketDistance -1"
# This is the number of seconds that location time is considered good
$ns_ at 0.0 "$d($i) set-locationGoodTime 46"
# This is the number of seconds that a dream agent will wait for an ack
# packet for a data packet before it resorts to the recovery method
$ns_ at 0.0 "$d($i) set-maxPacketTimeout 1"
$ns_ at 0.0 "$d($i) set-bradsDreamFactor 10"
$ns_ at 0.0 "$d($i) set-bradsDreamLongTime 23"
# This is the maximum node velocity in grid units per second
# We do not need this line if we are not using a global max node velocity.
# Add 1 to speed of mobility file for this
#$ns_ at 0.0 "$d($i) set-maxNodeVelocity 0"
# This is the debug value, set to -1 for no output
$ns_ at 0.0 "$d($i) set-debugLevel -1"
}
puts "Scheduling the location events"
# This sets the time when the location packets start being sent.
for {set i 0} {$i < $val(nn) } {incr i} {
set locationStart_($i) [$randomVar value]
#puts "Location Start Time for node($i) = $locationStart_($i)"
}
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $locationStart_($i) "$d($i) startLocationService"
}
puts "Scheduling the send events"
#$ns_ at 2.5 "$d(2) sendData 10"
#$ns_ at 2.5 "$d(5) sendData 14"
#$ns_ at 2.5 "$d(8) sendData 18"
# doesn't work right away
#$ns_ at 2.5 "$d(10) sendData 2"
#$ns_ at 2.5 "$d(14) sendData 2"
#source $opt(tf)
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at $val(stop) "$d($i) printLocationTable"
}
# =====================================================================
$ grep "// " dream.cc | wc -l
--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-users/2899ad27-6826-46af-b5d6-472d06384e54%40googlegroups.com.