示例#1
0
 @SuppressWarnings("unchecked")
 public static Map<VirtualNetwork, Boolean> calculateMappedVnr(NetworkStack stack) {
   VirtualNetwork tempVnr;
   Network tmpN;
   boolean isMapped;
   Map<VirtualNetwork, Boolean> isMappedVnr = new LinkedHashMap<VirtualNetwork, Boolean>();
   for (Iterator<Network<?, ?, ?>> net = stack.iterator(); net.hasNext(); ) {
     tmpN = net.next();
     if (tmpN.getLayer() != 0) {
       tempVnr = (VirtualNetwork) tmpN;
       isMapped = true;
       for (VirtualNode tmpVNode : tempVnr.getVertices()) {
         for (AbstractDemand dem : tmpVNode) {
           if (dem instanceof CpuDemand) {
             if (dem.getMappings().isEmpty()) {
               isMapped = false;
             }
             break;
           }
         }
       }
       isMappedVnr.put(tempVnr, isMapped);
     }
   }
   return isMappedVnr;
 }