Fixing tree topology simulator to chose proper edge-ports for host attachment.
Change-Id: I9ab9a26dbe1491068e61df611edb6e41302afa5b
Showing
2 changed files
with
2 additions
and
3 deletions
... | @@ -387,7 +387,7 @@ public abstract class TopologySimulator { | ... | @@ -387,7 +387,7 @@ public abstract class TopologySimulator { |
387 | */ | 387 | */ |
388 | protected List<PortDescription> buildPorts(int portCount) { | 388 | protected List<PortDescription> buildPorts(int portCount) { |
389 | List<PortDescription> ports = Lists.newArrayList(); | 389 | List<PortDescription> ports = Lists.newArrayList(); |
390 | - for (int i = 0; i < portCount; i++) { | 390 | + for (int i = 1; i <= portCount; i++) { |
391 | ports.add(new DefaultPortDescription(PortNumber.portNumber(i), true, | 391 | ports.add(new DefaultPortDescription(PortNumber.portNumber(i), true, |
392 | Port.Type.COPPER, 0)); | 392 | Port.Type.COPPER, 0)); |
393 | } | 393 | } | ... | ... |
... | @@ -55,7 +55,6 @@ public class TreeTopologySimulator extends TopologySimulator { | ... | @@ -55,7 +55,6 @@ public class TreeTopologySimulator extends TopologySimulator { |
55 | 55 | ||
56 | @Override | 56 | @Override |
57 | protected void createLinks() { | 57 | protected void createLinks() { |
58 | - | ||
59 | int portOffset = 1; | 58 | int portOffset = 1; |
60 | for (int t = 1; t < tierOffset.length; t++) { | 59 | for (int t = 1; t < tierOffset.length; t++) { |
61 | int child = tierOffset[t]; | 60 | int child = tierOffset[t]; |
... | @@ -72,7 +71,7 @@ public class TreeTopologySimulator extends TopologySimulator { | ... | @@ -72,7 +71,7 @@ public class TreeTopologySimulator extends TopologySimulator { |
72 | @Override | 71 | @Override |
73 | protected void createHosts() { | 72 | protected void createHosts() { |
74 | for (int i = tierOffset[tierOffset.length - 1]; i < deviceCount; i++) { | 73 | for (int i = tierOffset[tierOffset.length - 1]; i < deviceCount; i++) { |
75 | - createHosts(deviceIds.get(i), hostCount); | 74 | + createHosts(deviceIds.get(i), 2); |
76 | } | 75 | } |
77 | } | 76 | } |
78 | } | 77 | } | ... | ... |
-
Please register or login to post a comment