/** * <p>Adds a new layer.</p> * * @param name Layer name ({@code null} means empty) * @param description Layer description ({@code null} means empty) * @param linkCapacityUnitsName Textual description of link capacity units ({@code null} means empty) * @param demandTrafficUnitsName Textual description of demand traffic units ({@code null} means empty) * @param defaultNodeIconURL The URL of the default icon for the layer nodes * @param attributes SortedMap for user-defined attributes ({@code null} means 'no attribute'). Each key represents the attribute name, whereas value represents the attribute value * @return The newly created layer object */ public NetworkLayer addLayer(String name, String description, String linkCapacityUnitsName, String demandTrafficUnitsName, URL defaultNodeIconURL, Map<String, String> attributes) { return addLayer(null, name, description, linkCapacityUnitsName, demandTrafficUnitsName, defaultNodeIconURL, attributes); }
NetworkLayer ipLayer = netPlan.addLayer(null, null, null, null, null , null);
interLayerCoupling = new DirectedAcyclicGraph<NetworkLayer, DemandLinkMapping>(DemandLinkMapping.class); defaultLayer = addLayer("Layer 0", null, null, null, null, null);
@Override public List<AjtRcMenu> getNonBasicRightClickMenusInfo() { final NetPlan np = callback.getDesign(); ; final List<AjtRcMenu> res = new ArrayList<> (); res.add(new AjtRcMenu("Add layer", e-> { np.addLayer("Layer " + np.getNumberOfLayers(), null, null, null, null, null); } , (a,b)->true, null)); res.add(new AjtRcMenu("Remove selected layers", e->getSelectedElements().forEach(dd->np.removeNetworkLayer((NetworkLayer) dd)) , (a,b)->b>0, null)); return res; } }
throw new Net2PlanException("The number of nodes in the origin design and this design must be the same"); NetworkLayer newLayer = addLayer(origin.name, origin.description, origin.linkCapacityUnitsName, origin.demandTrafficUnitsName, origin.defaultNodeIconURL, origin.getAttributes());
/** Creates an empty design with no nodes, links etc. * @return see above */ public static WNet createEmptyDesign () { final NetPlan np = new NetPlan (); np.getNetworkLayerDefault().setName("WDM"); np.addLayer("IP", "IP Layer", "", "", null, null); np.addNode(0, 0, WNetConstants.WNODE_NAMEOFANYCASTORIGINNODE , null); np.addNode(0, 0, WNetConstants.WNODE_NAMEOFANYCASTDESTINATION, null); final WNet res = new WNet (np); return res; }
newLayer = netPlan.addLayer(layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, null , null);
newLayer = netPlan.addLayer(layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, null , null);
newLayer = netPlan.addLayer(layerId , layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, defaultNodeIconURL , null); netPlan.removeNetworkLayer(netPlan.layers.get (0)); newLayer = netPlan.addLayer(layerId , layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, defaultNodeIconURL , null);
newLayer = netPlan.addLayer(layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, null , null);
this.netPlan.setDemandTrafficUnitsName("Gbps"); this.netPlan.setLinkCapacityUnitsName("Frequency slots"); this.ipLayer = netPlan.addLayer("IP" , "IP layer" , "Gbps" , "Gbps" , null , null); for (Demand wdmDemand : netPlan.getDemands(wdmLayer)) netPlan.addDemand(wdmDemand.getIngressNode(), wdmDemand.getEgressNode() , wdmDemand.getOfferedTraffic() , RoutingType.HOP_BY_HOP_ROUTING , wdmDemand.getAttributes() , ipLayer);
newLayer = netPlan.addLayer(layerId , layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, defaultNodeIconURL , null); netPlan.removeNetworkLayer(netPlan.layers.get (0)); newLayer = netPlan.addLayer(layerId , layerName, layerDescription, linkCapacityUnitsName, demandTrafficUnitsName, defaultNodeIconURL , null);
if (thisLayer == null) thisLayer = addLayer(otherLayer.getName(), "", otherDesign.getLinkCapacityUnitsName(otherLayer), otherDesign.getDemandTrafficUnitsName(otherLayer), null, null);
netPlan.setDemandTrafficUnitsName("Gbps"); netPlan.setLinkCapacityUnitsName("Frequency slots"); this.ipLayer = netPlan.addLayer("IP" , "IP layer" , "Gbps" , "Gbps" , null , null); for (Demand wdmDemand : netPlan.getDemands(wdmLayer)) netPlan.addDemand(wdmDemand.getIngressNode(), wdmDemand.getEgressNode() , wdmDemand.getOfferedTraffic() , RoutingType.SOURCE_ROUTING , wdmDemand.getAttributes() , ipLayer);
this.upperLayer = netPlan.addLayer("UP LAYER" , "Upper layer of the design" , "Gbps" , "Gbps" , null , null);