Demand extends NetworkElement implements IMonitorizableElement { public boolean isBlocked () { return (this.offeredTraffic > 0 && this.carriedTraffic == 0) || (this.carriedTraffic + Configuration.precisionFactor < offeredTraffic); } Demand(NetPlan netPlan , long id , int index , NetworkLayer layer , Node ingressNode , Node egressNode , double offeredTraffic , RoutingType routingType , AttributeMap attributes); SortedSet<Node> getEndNodes(); void setOfferedTrafficPerPeriodGrowthFactor(double growthFactor); double getOfferedTrafficPerPeriodGrowthFactor(); void setQoSType(String newQosType); String getQosType(); void setMaximumAcceptableE2EWorstCaseLatencyInMs(double maxLatencyMs); double getMaximumAcceptableE2EWorstCaseLatencyInMs(); boolean isSourceRouting(); void checkRoutingType(RoutingType routingType); IntendedRecoveryType getIntendedRecoveryType(); void setIntendedRecoveryType(IntendedRecoveryType recoveryType); SortedSet<Route> getRoutes(); void setRoutingType(RoutingType newRoutingType); SortedSet<Route> getRoutesAreBackup(); SortedSet<Route> getRoutesHaveBackup(); SortedSet<Route> getRoutesHaveNoBackup(); SortedSet<Route> getRoutesAreNotBackup(); double getWorstCaseLengthInKm(); double getWorstCasePropagationTimeInMs(); boolean isTraversingOversubscribedLinks(); boolean isTraversingOversubscribedResources(); List<String> getServiceChainSequenceOfTraversedResourceTypes(); void setServiceChainSequenceOfTraversedResourceTypes(List<String> resourceTypesSequence); NetworkLayer getLayer(); boolean isBifurcated(); boolean isBlocked(); boolean isServiceChainRequest(); boolean isCoupled(); boolean isCoupledInSameLayer(); boolean isCoupledInDifferentLayer(); double getOfferedTraffic(); SortedMap<Pair<Demand,Link>,Double> getForwardingRules(); double getCarriedTraffic(); double getBlockedTraffic(); RoutingType getRoutingType(); RoutingCycleType getRoutingCycleType(); Node getIngressNode(); Node getEgressNode(); Demand getBidirectionalPair(); void setBidirectionalPair(Demand d); boolean isBidirectional(); Demand createBidirectionalPair(); Link getCoupledLink(); void coupleToUpperOrSameLayerLink(Link link); Link coupleToNewLinkCreated(NetworkLayer newLinkLayer); void decouple(); void removeAllForwardingRules(); void removeAllRoutes(); Pair<SortedSet<Route>,Double> computeShortestPathRoutes(double [] costs); Pair<SortedSet<Route>,Double> computeMinimumCostServiceChains(double [] linkCosts , double [] resourceCosts); void remove(); void setOfferedTraffic(double offeredTraffic); @Override String toString(); SortedSet<Link> getLinksWithNonZeroForwardingRules(); Pair<SortedSet<Link>,SortedSet<Link>> getLinksNoDownPropagationPotentiallyCarryingTraffic(); SortedMap<Link, Double> getTraversedLinksAndCarriedTraffic(final boolean normalizedToOfferedTraffic); double getOccupiedCapacity(Link e); TrafficSeries getMonitoredOrForecastedOfferedTraffic(); void setMonitoredOrForecastedOfferedTraffic(TrafficSeries newTimeSeries); @Override TrafficSeries getMonitoredOrForecastedCarriedTraffic(); @Override void setMonitoredOrForecastedCarriedTraffic(TrafficSeries newTimeSeries); @Override double getCurrentTrafficToAddMonitSample(); @Override boolean isPossibleToSetCurrentTrafficAsGivenMonitSample(); @Override void setCurrentTrafficToGivenMonitSample(double traffic); @Override Optional<TrafficPredictor> getTrafficPredictor(); @Override void setTrafficPredictor(TrafficPredictor tp); @Override void removeTrafficPredictor();  }
@Test public void testIsBlocked() { assertTrue (d12.isBlocked()); assertTrue (d13.isBlocked()); assertTrue (!scd123.isBlocked()); }