при установке случайного движения узла в 0 выдает ошибку: "ошибка при вызове класса $ cls: $ args" $ ... " - PullRequest
0 голосов
/ 31 декабря 2018

Это проводная сеть с row*col номером nodes.Поскольку он статический, я пытаюсь установить random-motion на 0. Но когда я запускаю ns wired.tcl 3 3 5 0.01, я получаю ошибку ниже.здесь параметры cmd

нс <filename> <no of rows> <no of col> <links> <cbr_interval>

      (_o10 cmd line 1)
        invoked from within
    "_o10 cmd random-motion 0"
        invoked from within
    "catch "$self cmd $args" ret"
        invoked from within
    "if [catch "$self cmd $args" ret] {
    set cls [$self info class]
    global errorInfo
    set savedInfo $errorInfo
    error "error when calling class $cls: $args" $..."
        (procedure "_o10" line 2)
        (SplitObject unknown line 2)
        invoked from within
    "$node_($i) random-motion 0"
        ("for" body line 3)
        invoked from within
    "for {set i 0} {$i < [expr $num_row*$num_col]} {incr i} {
        set node_($i) [$ns node]
        $node_($i) random-motion 0
    }"
        (file "rough.tcl" line 34)

Я работаю ubuntu-18.04 иns-allinone-2.35 а это wired.tcl файл

    set ns [new Simulator]
    $ns multicast
    set start_time 0.5
    set cbr_interval [lindex $argv 3]
    set num_row [lindex $argv 0]
    set num_col [lindex $argv 1]
    set x_dim 100
    set y_dim 100
    set grid 0

    set k 6
    set num_random_flow [lindex $argv 2]

    set traceFile [open wired.tr w]
    $ns trace-all $traceFile

    set nf [open out.nam w]
    $ns namtrace-all $nf

    #create-god [expr $num_row * $num_col ]

    proc  finish {} \
    {
        puts "finishing simulation"
        global ns nf traceFile
        $ns flush-trace
        close $traceFile
        close $nf
        #exec nam out.nam &
        exit 0
    }

    puts "start node creation"
    for {set i 0} {$i < [expr $num_row*$num_col]} {incr i} {
        set node_($i) [$ns node]
        $node_($i) random-motion 0; #problem
    }


    $ns at 5.0 "finish"
    puts "starting simulation"
    $ns run
...