[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: change the color of a link
Yes, they should be equivalent. Currently they are not due to a nam
initialization bug. It can be fixed by the enclosed patch. It'll be in
tonight's snapshot.
- Haobo
--- ns-namsupp.tcl~ 1999/01/26 18:30:46
+++ ns-namsupp.tcl 1999/02/16 20:07:32
@@ -148,7 +148,7 @@
set delay [$link_ set delay_]
$ns puts-nam-config \
- "l -t * -s [$fromNode_ id] -d [$toNode_ id] -S UP -r $bw -D $delay -o $attr_(ORIENTATION)"
+ "l -t * -s [$fromNode_ id] -d [$toNode_ id] -S UP -r $bw -D $delay -o $attr_(ORIENTATION) -c $attr_(COLOR)"
}
Link instproc dump-nam-queueconfig {} {
@@ -160,7 +160,7 @@
set ns [Simulator instance]
if [info exists attr_(QUEUE_POS)] {
- $ns puts-nam-config "q -t * -s [$fromNode_ id] -d [$toNode_ id] -a $attr_(QUEUE_POS)"
+ $ns puts-nam-config "q -t * -s [$fromNode_ id] -d [$toNode_ id] -a $attr_(QUEUE_POS) -c $attr_(COLOR)"
} else {
set attr_(QUEUE_POS) ""
}
> Er, shouldn't the two be logically equivalent? As in:
>
> $ns at 0.0 "$ns duplex-link-op $n(3) $n(4) color \"green\""
>
> should be equivalent to:
>
> $ns duplex-link-op $n(3) $n(4) color "green"
>
> and produce the same results, since in both cases you're setting
> initial conditions? At least, that's how the naive OTcl programmer
> (namely, me) would perceive it.
>
> I'm tried setting the initial colour of links via:
>
> $ns $linktype $n($node1) $n($node2) $bandwidth $propdelay $queuemethod
> $ns $linktype-op $n($node1) $n($node2) color "blue"
>
> or even:
>
> $ns $linktype $n($node1) $n($node2) $bandwidth $propdelay $queuemethod color "blue"
>
> when I build the initial topology, and all I ever get is boring black.
>
> thanks,
>
> L.