- Timestamp:
- May 19, 2010 7:21:24 AM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 4b68c58
- Parents:
- 966c620
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
r966c620 rdf3179c 716 716 for idx, s in enumerate(t.substrates): 717 717 loss = s.get_attribute('loss') 718 if s.latency: 719 delay = s.latency.time 720 else: 721 delay = 0 718 if s.latency: delay = s.latency.time 719 else: delay = 0 720 721 if s.capacity: rate = s.capacity.rate 722 else: rate = 100000 722 723 name = to_tcl_name(s.name or "sub%d" % idx) 723 724 … … 727 728 for i in s.interfaces] 728 729 out += 'set %s [$ns make-lan "%s" %fkb %fms ]\n' % \ 729 (name, " ".join(members), s.capacity.rate, delay)730 (name, " ".join(members), rate, delay) 730 731 if loss: 731 732 "tb-set-lan-loss ${%s} %f\n" % (name, float(loss)) … … 737 738 out += "tb-set-ip-lan ${%s} ${%s} %s\n" % \ 738 739 (to_tcl_name(e.name), name, ip) 739 if i.capacity and i.capacity.rate != s.capacity.rate:740 if i.capacity and i.capacity.rate != rate: 740 741 out += "tb-set-node-lan-bandwidth ${%s} ${%s} %fkb\n" % \ 741 742 (to_tcl_name(e.name), name, i.capacity.rate) … … 754 755 out += "set %s [$ns duplex-link ${%s} ${%s} %fkb %fms DropTail]\n" %\ 755 756 (name, to_tcl_name(f.element.name), 756 to_tcl_name(t.element.name), 757 s.capacity.rate, delay) 757 to_tcl_name(t.element.name), rate, delay) 758 758 if loss: 759 759 out += "tb-set-link-loss ${%s} %f\n" % (name, float(loss)) … … 762 762 lloss = i.get_attribute("loss") 763 763 cap_override = i.capacity and \ 764 i.capacity.rate != s.capacity.rate764 i.capacity.rate != rate 765 765 delay_override = i.latency and \ 766 766 i.latency.time != delay … … 768 768 if cap_override or delay_override or loss_override: 769 769 if i.capacity: cap = i.capacity.rate 770 else: cap = s.capacity.rate770 else: cap = rate 771 771 772 772 if i.latency: delay = i.latency.time
Note: See TracChangeset
for help on using the changeset viewer.