private List<Triple<String,String,String>> getLayerInfoTables (NetworkLayer layer) { final DecimalFormat df = new DecimalFormat("###.##"); final NetPlan np = layer.getNetPlan(); final List<Triple<String,String,String>> res = new ArrayList <> (); final String capUnits = np.getLinkCapacityUnitsName(layer); final String trafUnits = np.getDemandTrafficUnitsName(layer); res.add(Triple.of("Layer index/id" , "Layer " + layer.getIndex() + " (id " + layer.getId() + ")", "layer" + layer.getId())); res.add(Triple.of("Name" , layer.getName().equals("")? "No name" : layer.getName(), "")); res.add(Triple.of("Description" , layer.getDescription().equals("")? "No description" : layer.getDescription(), "")); res.add(Triple.of("Demand traffic units" , trafUnits.equals("")? "Not specified" : trafUnits, "")); res.add(Triple.of("Link capacity units" , capUnits.equals("")? "Not specified" : capUnits, "")); final double totalOccupiedCap = np.getLinks(layer).stream().mapToDouble(e->e.getOccupiedCapacity()).sum(); final double totalCap = np.getLinks(layer).stream().mapToDouble(e->e.getCapacity()).sum(); final double totalOfferedTrac = np.getDemands(layer).stream().mapToDouble(e->e.getOfferedTraffic()).sum(); final double totalCarriedTrac = np.getDemands(layer).stream().mapToDouble(e->e.getCarriedTraffic()).sum(); final double totalOffMultTraffic = np.getMulticastDemands(layer).stream().mapToDouble(e->e.getOfferedTraffic()).sum(); final double totalCarMultTraffic = np.getMulticastDemands(layer).stream().mapToDouble(e->e.getCarriedTraffic()).sum(); res.add(Triple.of("# links (total occupied / capacity)", "" + np.getNumberOfLinks(layer) + " (" + df.format(totalOccupiedCap) + " / " + df.format(totalCap) + ") " + capUnits + ")" , "")); res.add(Triple.of("# demands (total carried / offered)", "" + np.getNumberOfDemands(layer) + " (" + df.format(totalCarriedTrac) + " / " + df.format(totalOfferedTrac) + ") " + trafUnits, "")); res.add(Triple.of("# routes", "" + np.getNumberOfRoutes(layer) , "")); res.add(Triple.of("# forwarding rules", "" + np.getNumberOfForwardingRules(layer) , "")); res.add(Triple.of("# multicast demands (total carried / offered)", "" + np.getNumberOfMulticastDemands(layer) + " (" + df.format(totalCarMultTraffic) + " / " + df.format(totalOffMultTraffic) + ") " + trafUnits, "")); res.add(Triple.of("# multicast trees", "" + np.getNumberOfMulticastTrees(layer) , "")); return res; } private List<Triple<String,String,String>> getNodeInfoTables (Node n , NetworkLayer layer)
private List<Triple<String,String,String>> getMulticastDemandInfoTables (MulticastDemand md) { final DecimalFormat df = new DecimalFormat("###.##"); final NetPlan np = md.getNetPlan(); final NetworkLayer layer = md.getLayer(); final List<Triple<String,String,String>> res = new ArrayList <> (); res.add(Triple.of("Demand index/id" , "M. demand " + md.getIndex() + " (id " + md.getId() + ")", "multicastDemand" + md.getId())); res.add(Triple.of("Layer" , "" + getLayerName(layer) , "layer" + layer.getId())); res.add(Triple.of("Offered traffic" , "" + df.format(md.getOfferedTraffic()) , "")); res.add(Triple.of("Carried traffic" , "" + df.format(md.getCarriedTraffic()) , "")); res.add(Triple.of("Lost traffic" , "" + df.format(md.getBlockedTraffic()) , "")); if (md.isCoupled()) { final Set<Link> coupledLinks = md.getCoupledLinks(); final NetworkLayer upperLayer = coupledLinks.iterator().next().getLayer(); res.add(Triple.of("- Upper layer coupled to", getLayerName(upperLayer) , "layer" + upperLayer.getId())); for (Link c : coupledLinks) res.add(Triple.of("- Coupled to", "Link " + c.getIndex() + " (id " + c.getId() + ")" , "link" + c.getId())); } res.add(Triple.of("Num. trees" , "" + md.getMulticastTrees().size() , "")); // for (MulticastTree t : md.getMulticastTrees()) // res.add(Triple.of("Multicast tree index/id" , "Multicast tree " + t.getIndex() + " (id " + t.getId() + ")" , "multicastTree" + t.getId())); res.add(Triple.of("Worst case e2e latency" , df.format(md.getWorseCasePropagationTimeInMs()) + " ms", "")); return res; }
private List<Triple<String,String,String>> getMulticastTreeInfoTables (MulticastTree t) { final DecimalFormat df = new DecimalFormat("###.##"); final NetPlan np = t.getNetPlan(); final List<Triple<String,String,String>> res = new ArrayList <> (); res.add(Triple.of("Tree index/id" , "Tree " + t.getIndex() + " (id " + t.getId() + ")", "multicastTre" + t.getId())); res.add(Triple.of("Layer" , "" + getLayerName(t.getLayer()) , "layer" + t.getLayer().getId())); res.add(Triple.of("Tree demand" , "Multicast demand " + t.getMulticastDemand().getIndex() + " (id " + t.getMulticastDemand().getId() + ")" , "multicastDemand" + t.getMulticastDemand().getId())); res.add(Triple.of("M. Demand offered traffic" , "" + df.format(t.getMulticastDemand().getOfferedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()) , "")); res.add(Triple.of("M. Demand carried traffic" , "" + df.format(t.getMulticastDemand().getCarriedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()) , "")); res.add(Triple.of("Tree carried traffic" , "" + df.format(t.getCarriedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()), "")); res.add(Triple.of("Is up?" , "" + !t.isDown(), "")); res.add(Triple.of("Worst link utilization" , "" + df.format(t.getLinkSet().stream().mapToDouble(e->e.getUtilization()).max().orElse(0)), "")); res.add(Triple.of("E2E num. hops (av / max)" , "" + df.format(t.getTreeAveragePathLengthInHops()) + " / " + df.format(t.getTreeMaximumPathLengthInHops()) , "")); res.add(Triple.of("E2E length in km (av / max)" , "" + df.format(t.getTreeAveragePathLengthInHops()) + " / " + df.format(t.getTreeMaximumPathLengthInKm()) + " km", "")); res.add(Triple.of("E2E length in ms (av / max)" , "" + df.format(t.getTreeAveragePropagationDelayInMs()) + " / " + df.format(t.getTreeMaximumPropagationDelayInMs()) + " ms", "")); return res; } private List<Triple<String,String,String>> getDemandInfoTables (Demand d)
@Override public List<AjtColumnInfo<MulticastDemand>> getNonBasicUserDefinedColumnsVisibleOrNot() { final List<AjtColumnInfo<MulticastDemand>> res = new LinkedList<> (); res.add(new AjtColumnInfo<MulticastDemand>(this , Node.class, null , "A", "Ingress node", null , d->d.getIngressNode() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "Bs", "Egress nodes", null , d->d.getEgressNodes().stream().map(n->n.getName().equals("")? "Node " + n.getIndex() : n.getName()).collect(Collectors.joining(",")) , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Collection.class, null , "Coupled links", "The links that this demand is coupled to, if any", null , d->d.isCoupled()? d.getCoupledLinks() : "-" , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Offered traffic (" + getTableNetworkLayer().getLinkCapacityUnits() + ")", "Offered traffic by the demand", (d,val)->d.setOfferedTraffic((Double) val), d->d.getOfferedTraffic() , AGTYPE.SUMDOUBLE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Carried traffic (" + getTableNetworkLayer().getLinkCapacityUnits() + ")", "Carried traffic by the demand", null , d->d.getCarriedTraffic() , AGTYPE.SUMDOUBLE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "% Lost traffic", "Percentage of the lost traffic by the demand", null, d->d.getOfferedTraffic() == 0? 0 : d.getBlockedTraffic() / d.getOfferedTraffic() , AGTYPE.NOAGGREGATION , d->d.getBlockedTraffic() > 0? Color.RED : Color.GREEN)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "QoS type", "A used-defined string identifying the type of traffic of the demand", (d,val)-> d.setQoSType((String)val) , d->d.getQosType(), AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Boolean.class, null , "All nodes reached?", "True if all the multicast trees of the demand reach all the demand egress nodes", null, d->d.isAllTreesReachingAllEgressNodes() , AGTYPE.COUNTTRUE , d->d.isAllTreesReachingAllEgressNodes()? Color.GREEN : Color.RED)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "Bifurcated?", "Indicates whether the demand is satisfied by more than one multicast tree", null, d->d.isBifurcated() , AGTYPE.COUNTTRUE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Integer.class, null , "# trees", "Number of associated multicast trees", null, d->d.getMulticastTrees().size() , AGTYPE.SUMINT , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Worst e2e lat (ms)", "Current worst case end-to-end propagation time in miliseconds (accumulating any lower layer propagation times if any), from the origin node, to destination nodes reached", null, d->d.getWorseCasePropagationTimeInMs() , AGTYPE.NOAGGREGATION , d->{ final double maxMs = d.getMaximumAcceptableE2EWorstCaseLatencyInMs(); return maxMs <= 0? null : (d.getWorseCasePropagationTimeInMs() > maxMs? Color.RED : null); })); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Worst e2e length (km)", "Current worst case end-to-end propagation length in km (accumulating any lower layer propagation lengths if any)", null, d->d.getWorstCaseLengthInKm() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Limit e2e lat (ms)", "Maximum end-to-end propagation time in miliseconds (accumulating any lower layer propagation times if any)", (d,val)-> d.setMaximumAcceptableE2EWorstCaseLatencyInMs((Double)val) , d->d.getMaximumAcceptableE2EWorstCaseLatencyInMs() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "CAGR(%)" , "Compound annual growth factor for this demand", (d,val)->d.setOfferedTrafficPerPeriodGrowthFactor((Double) val), d->d.getOfferedTrafficPerPeriodGrowthFactor() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Integer.class, null , "#Monit points" , "Number of samples of the offered traffic stored, coming from a monitoring or forecasting traffic process", null , d->d.getMonitoredOrForecastedOfferedTraffic().getSize() , AGTYPE.NOAGGREGATION , null)); return res; }