LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Evalvid ns2.35: error Floating point exception (core dumped) (https://www.linuxquestions.org/questions/linux-software-2/evalvid-ns2-35-error-floating-point-exception-core-dumped-4175558861/)

hbenlabbes 11-14-2015 12:09 PM

Evalvid ns2.35: error Floating point exception (core dumped)
 
I try to execute the script qos.tcl in ns2. gives me the error:Floating point exception (core dumped)

user@user-HP-Pavilion-g6-Notebook-PC:~/example$ ns qos.tcl
13.433333333333334
Floating point exception (core dumped)

Could you give me some suggestions?
*
Thanks in advance!

Best regards,


qos.tcl (script source)

set ns [new Simulator]

set max_fragmented_size 1000
set packetSize 1028

set s1 [$ns node]
set r1 [$ns node]
set r2 [$ns node]
set d1 [$ns node]

$ns duplex-link $s1 $r1 10Mb 1ms DropTail
$ns simplex-link $r1 $r2 0.18Mb 10ms dsRED/core
$ns simplex-link $r2 $r2 0.18Mb 10ms DropTail
$ns duplex-link $r2 $d1 10Mb 1ms DropTail

set qr1r2 [[$ns link $r1 $r2] queue]
$qr1r2 set limit_ 10
$qr1r2 set numQueues_ 1
$qr1r2 setNumPrec 3
$qr1r2 addPHBEntry 10 0 0
$qr1r2 addPHBEntry 11 0 1
$qr1r2 addPHBEntry 12 0 2
$qr1r2 configQ 0 0 4 8 0.025
$qr1r2 configQ 0 1 2 4 0.05
$qr1r2 configQ 0 2 1 2 0.10

set udp1 [new Agent/myUDP]
$ns attach-agent $s1 $udp1
$udp1 set packetSize_ $packetSize
$udp1 set_filename sd_qos
set null1 [new Agent/myEvalvid_Sink]
$ns attach-agent $d1 $null1
$ns connect $udp1 $null1
$null1 set_filename rd_qos

set original_file_name st
set trace_file_name video1.dat
set original_file_id [open $original_file_name r]
set trace_file_id [open $trace_file_name w]

set frame_count 0
set last_time 0

while {[eof $original_file_id] == 0} {
gets $original_file_id current_line

scan $current_line "%d%s%d%s%s%s%d%s" no_ frametype_ length_ tmp1_ tmp2_ tmp3_ tmp4_ tmp5_
#puts "$no_ $frametype_ $length_ $tmp1_ $tmp2_ $tmp3_ $tmp4_ $tmp5_"

# 30 frames/sec. if one want to generate 25 frames/sec, one can use set time [expr 1000*1000/25]
set time [expr 1000 * 1000/30]

if { $frametype_ == "I" } {
set type_v 1
}

if { $frametype_ == "P" } {
set type_v 2
}

if { $frametype_ == "B" } {
set type_v 3
}

if { $frametype_ == "H" } {
set type_v 1
}

puts $trace_file_id "$time $length_ $type_v $max_fragmented_size"
incr frame_count
}

close $original_file_id
close $trace_file_id
set end_sim_time [expr 1.0 * 1000/30 * ($frame_count + 1) / 1000]
puts "$end_sim_time"

set trace_file [new Tracefile]
$trace_file filename $trace_file_name
set video1 [new Application/Traffic/myEvalvid]
$video1 attach-agent $udp1
$video1 attach-tracefile $trace_file

proc finish {} {
global ns
exit 0
}

$ns at 0.0 "$video1 start"
$ns at $end_sim_time "$video1 stop"
$ns at [expr $end_sim_time + 1.0] "$null1 closefile"
$ns at [expr $end_sim_time + 1.0] "$qr1r2 printStats"
$ns at [expr $end_sim_time + 1.0] "finish"

$ns run

user@user-HP-Pavilion-g6-Notebook-PC:~/example$ ns qos.tcl
13.433333333333334
Floating point exception (core dumped)

knudfl 11-14-2015 12:53 PM

Seems that some file(s) are missing :

Ref. line 38 : set original_file_name st
Ref. line 40 : set original_file_id [open $original_file_name r]
... The missing files can be attached as name.txt .
Attachments : The paper clip tool in the 'Advanced Editor'.
If big files : Please upload to 'Google Docs' (You get 15GB free storage.)


* Important : Code must be inside CODE Tags : [code]code text[/code]
* Please edit post #1 : The 'Edit' button in post #1.


-


All times are GMT -5. The time now is 10:48 AM.