[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change the color of a link



On Tue, 16 Feb 1999, Haobo Yu wrote:

> Just to make sure, what I meant by "after ns started" is something like
> "$ns at 10 ..."

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.


> Can you add the following line into your tcl/ex/nam-example.tcl to see if
> it works:
> 
>   $ns at 4.5 "$ns duplex-link-op $n(3) $n(4) color \"green\""
> 
> You can put it anywhere after the topology creation and "$ns run". It
> worked for me; please let me know if it works for you. 
> 
> - Haobo
> 
> BTW, I recommend that you update your nam to snapshot if you are running
> ns snapshot because of bug fixes and recent addition to nam trace format.
> 
> On Tue, 16 Feb 1999, Shuqian Yan wrote:
> 
> > I did a verification on example script tcl/ex/newmcast/mcast5.tcl, add the
> > color change line after $ns run, it is still not working to set the color
> > correctly, although it could accept the trace perfectly. I also try to
> > change color of individual nodes and different type of pkts, they're
> > all working properly. if it is able to change color of nodes/pkts, why not
> > links then?

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>