MulticastTree extends NetworkElement { public double getTreeAveragePathLengthInKm () { checkAttachedToNetPlanObject(); double accum = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) for (Link e : seqLinks) accum += e.getLengthInKm(); return accum / demand.egressNodes.size(); } MulticastTree(NetPlan netPlan , long id , int index,  MulticastDemand demand , Set<Link> links , AttributeMap attributes); Set<Link> getInitialLinkSet(); void revertToInitialSetOfLinks(); boolean isUpTheInitialLinkSet(); NetworkLayer getLayer(); Set<SharedRiskGroup> getSRGs(); MulticastDemand getMulticastDemand(); Node getIngressNode(); Set<Node> getEgressNodesReached(); boolean isReachedEgressNode(Node n); boolean isReachinAllDemandEgressNodes(); List<Link> getSeqLinksToEgressNode(Node egressNode); void setLinks(Set<Link> newLinkSet); Set<Link> getLinkSet(); boolean isDown(); boolean isTraversingZeroCapLinks(); Set<Node> getNodeSet(); Link getIngressLinkOfNode(Node n); Set<Link> getOutputLinkOfNode(Node n); double getTreeTotalLengthInKm(); double getTreeMaximumPathLengthInKm(); double getTreeAveragePathLengthInKm(); double getTreeMaximumPropagationDelayInMs(); double getTreeAveragePropagationDelayInMs(); int getTreeMaximumPathLengthInHops(); double getTreeAveragePathLengthInHops(); int getTreeNumberOfLinks(); double getCarriedTraffic(); double getOccupiedLinkCapacity(); double getCarriedTrafficInNoFailureState(); double getOccupiedLinkCapacityInNoFailureState(); void setCarriedTraffic(double newCarriedTraffic , double newOccupiedLinkCapacity); void remove(); @Override String toString();  }
@Test public void testGetTreeAveragePathLengthInKm() { assertEquals(t123.getTreeAveragePathLengthInKm() , 150 , 0.0); assertEquals(tStar.getTreeAveragePathLengthInKm() , 100 , 0.0); }