
# this sample tcl file ONLY tells you how to set k and l parameters etc.
# you need to setup topology, flows etc.


set type1 [lindex $argv 0]

# set parameter's according to type (1=AIMD, 2=SQRT, 3=IIAD)
if {$type1==1} {
 set K_PARAMETER1 0
 set L_PARAMETER1 1
}

if {$type1==2} {
 set K_PARAMETER1 0.5
 set L_PARAMETER1 0.5
}

if {$type1==3} {
 set K_PARAMETER1 1
 set L_PARAMETER1 0
}


for {set i 0} {$i < 5} {incr i} {

  set tcp($i) [new Agent/TCP/Reno]
  $ns attach-agent $n($i) $tcp($i)
  $tcp($i) set packetSize_ 1000
  $tcp($i) set windowOption_ 6
  $tcp($i) set k_parameter_ $K_PARAMETER1
  $tcp($i) set l_parameter_ $L_PARAMETER1
#  $tcp($i) set window_ 10
  $tcp($i) set interval_ 0.0005
  $tcp($i) set ssthresh_ 20
  $tcp($i) set fid_ $i
}

for {set i 5} {$i < 10} {incr i} {

  set tcp($i) [new Agent/TCP]
  $ns attach-agent $n($i) $tcp($i)
  $tcp($i) set packetSize_ 1000
  $tcp($i) set windowOption_ 6
  $tcp($i) set k_parameter_ $K_PARAMETER2
  $tcp($i) set l_parameter_ $L_PARAMETER2
#  $tcp($i) set window_ 10
  $tcp($i) set interval_ 0.0005
  $tcp($i) set ssthresh_ 20
  $tcp($i) set fid_ $i
}

