# inicjalizacja load ./q3.so source symul_graf_lib.tcl # budujemy drzewo set liczbaWierz 0 array unset sasiedzi G::sciezka2 0 10 G::gwiazda2 10 15 0 G::gwiazda2 15 20 1 G::gwiazda2 20 25 2 G::gwiazda2 25 30 3 G::gwiazda2 30 35 4 G::gwiazda2 35 40 5 G::gwiazda2 40 45 6 G::gwiazda2 45 50 7 # rysujemy graf w odpowiedniej kolejności G::rysujGraf -zero 1 # sposób na konfig. połączeń na podstawie ID i nr_połączenia proc tc_pol {id pol} { global sasiedzi set l1 "$id [lindex $sasiedzi($id) $pol]" set l1 [lsort -integer $l1] return "[lindex $l1 0]->[lindex $l1 1]" } # ustawiamy grubość krawędzi .t.c itemconf 1$tc_edge([tc_pol 0 0]) -width 5 .t.c itemconf 1$tc_edge([tc_pol 1 0]) -width 5 .t.c itemconf 1$tc_edge([tc_pol 2 0]) -width 5 .t.c itemconf 1$tc_edge([tc_pol 3 0]) -width 5 # kolorujemy .t.c itemconf 1$tc_node(5) -fill yellow .t.c itemconf 1$tc_node(10) -fill red .t.c itemconf 1$tc_node(15) -fill yellow .t.c itemconf 1$tc_node(20) -fill red