Skip to content

Instantly share code, notes, and snippets.

@abrahamjso
Created April 30, 2013 19:39
Show Gist options
  • Save abrahamjso/5491324 to your computer and use it in GitHub Desktop.
Save abrahamjso/5491324 to your computer and use it in GitHub Desktop.
set INCREMENT 0.2
set PacketSize_ 1024
proc check {} {
global cbr1 cbr0 ns nf
global INCREMENT
set cbrBW1 [$cbr0 set ack_]
set cbrBW0 [$cbr1 set ack_]
set now [$ns now]
set d [expr $now - 0.1]
set resultado [expr $cbrBW1/$d * 8 * [$tcp1 set packetSize_]/1024]
set r2 [expr $cbrBW0/$d * 8 * [$tcp3 set packetSize_]/1024]
puts "$now $resultado $r2"
puts $nf "$now $resultado $r2"
$ns at [expr $now + $INCREMENT] "check"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment