/** * <p>Returns the set of multicast trees ending in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The multicast trees, or an empty set if none */ public SortedSet<MulticastTree> getIncomingMulticastTrees (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<MulticastTree> res = new TreeSet<MulticastTree> (); for (MulticastDemand e : cache_nodeIncomingMulticastDemands) if (e.layer.equals(layer)) res.addAll (e.cache_multicastTrees); return res; }
/** * <p>Returns the set of links initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The set of outgoing links, or an empty set if none */ public SortedSet<Link> getOutgoingLinks(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Link> res = new TreeSet<Link> (); for (Link e : cache_nodeOutgoingLinks) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the set of multicast tree initiated in the node, in the given layer. If no layer is provided, the default layer is assumed. </p> * @param optionalLayerParameter The layer * @return The multicast trees, or an empty set if none */ public SortedSet<MulticastTree> getOutgoingMulticastTrees (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<MulticastTree> res = new TreeSet<MulticastTree> (); for (MulticastDemand e : cache_nodeOutgoingMulticastDemands) if (e.layer.equals(layer)) res.addAll (e.cache_multicastTrees); return res; }
/** * <p>Returns the set of multicast demands ending in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The demands, or an empty set if none */ public SortedSet<MulticastDemand> getIncomingMulticastDemands(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<MulticastDemand> res = new TreeSet<MulticastDemand> (); for (MulticastDemand e : cache_nodeIncomingMulticastDemands) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the set of routes initiated in the node, in the given layer. If no layer is provided, the default layer is assumed. </p> * @param optionalLayerParameter Network layer (optional) * @return The set of routes, or an empty set if none */ public SortedSet<Route> getOutgoingRoutes(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Route> res = new TreeSet<Route> (); for (Demand d : cache_nodeOutgoingDemands) if (d.layer.equals(layer)) res.addAll (d.cache_routes); return res; }
/** * <p>Returns the set of links ending in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter the layer * @return the of incoming links, or an empty set if none */ public SortedSet<Link> getIncomingLinks(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Link> res = new TreeSet<Link> (); for (Link e : cache_nodeIncomingLinks) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the set of demands ending in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return the demands, or an empty set if none */ public SortedSet<Demand> getIncomingDemands(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Demand> res = new TreeSet<Demand> (); for (Demand e : cache_nodeIncomingDemands) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the set of routes ending in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer * @return The routes, or an empty set if none */ public SortedSet<Route> getIncomingRoutes(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Route> res = new TreeSet<Route> (); for (Demand d : cache_nodeIncomingDemands) if (d.layer.equals(layer)) res.addAll (d.cache_routes); return res; }
/** * <p>Returns the set of demands initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The demands, or an empty set if none */ public SortedSet<Demand> getOutgoingDemands(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Demand> res = new TreeSet<Demand> (); for (Demand e : cache_nodeOutgoingDemands) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the set of multicast demands initiated in the node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The demands, or an empty set if none */ public SortedSet<MulticastDemand> getOutgoingMulticastDemands(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<MulticastDemand> res = new TreeSet<MulticastDemand> (); for (MulticastDemand e : cache_nodeOutgoingMulticastDemands) if (e.layer.equals(layer)) res.add (e); return res; }
/** * <p>Returns the nodes directly connected to this, with links ending in this node at the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The set of neighbor nodes */ public SortedSet<Node> getInNeighbors (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Node> res = new TreeSet<Node> (); for (Link e : cache_nodeIncomingLinks) if (e.layer.equals (layer)) res.add (e.originNode); return res; }
/** * <p>Returns the set of routes that start, end or traverse this node, in the given layer. If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The routes, or an empty set if none */ public SortedSet<Route> getAssociatedRoutes (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); SortedSet<Route> res = new TreeSet<Route> (); for (Link e : cache_nodeIncomingLinks) if (e.layer.equals (layer)) res.addAll (e.cache_traversingRoutes.keySet()); for (Link e : cache_nodeOutgoingLinks) if (e.layer.equals (layer)) res.addAll (e.cache_traversingRoutes.keySet()); return res; }
/** * <p>Returns the total multicast offered traffic initiated in the node, counting the multicast demands at the given layer. * If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The total multicast offered traffic initiated in the node */ public double getIngressOfferedMulticastTraffic (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (MulticastDemand d : cache_nodeOutgoingMulticastDemands) if (d.layer.equals (layer)) accum += d.offeredTraffic; return accum; }
/** Returns the total capacity in the links of te given layer entering the node. * If no layer is provided, the default layer is assumed * @param optionalLayerParameter Network layer (optional) * @return see above */ public double getOutgoingLinksCapacity (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (Link e : cache_nodeOutgoingLinks) if (e.layer.equals (layer)) accum += e.capacity; return accum; }
/** Returns the total capacity in the links of te given layer entering the node. * If no layer is provided, the default layer is assumed * @param optionalLayerParameter Network layer (optional) * @return see above */ public double getIncomingLinksCapacity (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (Link e : cache_nodeIncomingLinks) if (e.layer.equals (layer)) accum += e.capacity; return accum; }
/** Sets the population of the node (must be non-negative) * @param population the population */ public void setPopulation (double population) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (population < 0) throw new Net2PlanException ("Node population must be non-negative"); this.population = population; this.name = name == null? "" : name; }
/** * <p>Returns the total multicast offered traffic ending in the node, counting the multicast demands at the given layer. * If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter Network layer (optional) * @return The total multicast offered traffic ending in the node */ public double getEgressOfferedMulticastTraffic (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (MulticastDemand d : cache_nodeIncomingMulticastDemands) if (d.layer.equals (layer)) accum += d.offeredTraffic; return accum; }
/** Returns the total carried in the links of te given layer entering the node. * If no layer is provided, the default layer is assumed * @param optionalLayerParameter Network layer (optional) * @return see above */ public double getIncomingLinksTraffic (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (Link e : cache_nodeIncomingLinks) if (e.layer.equals (layer)) accum += e.getCarriedTraffic(); return accum; }
/** Returns the total carried in the links of te given layer entering the node. * If no layer is provided, the default layer is assumed * @param optionalLayerParameter Network layer (optional) * @return see above */ public double getOutgoingLinksTraffic (NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); double accum = 0; for (Link e : cache_nodeOutgoingLinks) if (e.layer.equals (layer)) accum += e.getCarriedTraffic(); return accum; }
/** * <p>Removes all forwarding rules associated to the node for a given layer (that is, of layer links outgoing from the node). If no layer is provided, the default layer is assumed.</p> * @param optionalLayerParameter the layer */ public void removeAllForwardingRules(NetworkLayer ... optionalLayerParameter) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); NetworkLayer layer = netPlan.checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); for (Link e : cache_nodeOutgoingLinks) if (e.layer.equals (layer)) e.removeAllForwardingRules(); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); }