public List<Vm> getAllVms() { List<Vm> list = new ArrayList<Vm>(); for (ApplicationVertex av : vertexSet()) { list.addAll(av.getVms()); } return list; }
public void addVertex(ApplicationVertex av) { cloudlets.addAll(av.getCloudlets()); for (Cloudlet c : av.getCloudlets()) { cloudletToVertex.put(c, av); } for (Vm vm : av.getVms()) { vmToVertex.put(vm, av); } graph.addVertex(av); }
public Set<Cloudlet> allCloudletLinked(Cloudlet cloudlet) { Set<Cloudlet> set = new HashSet<Cloudlet>(); // adds all the cloudlets in the same vertex ApplicationVertex av = this.getVertexForCloudlet(cloudlet); set.addAll(av.getCloudlets()); // adds the cloudlets from the connected vertex for (ApplicationEdge ae : graph.edgesOf(av)) { ApplicationVertex source = graph.getEdgeSource(ae); if (source.equals(av) == false) set.addAll(source.getCloudlets()); ApplicationVertex target = graph.getEdgeTarget(ae); if (target.equals(av) == false) set.addAll(source.getCloudlets()); } return set; }