Exemplo n.º 1
0
  public List<Vm> getAllVms() {
    List<Vm> list = new ArrayList<Vm>();

    for (ApplicationVertex av : vertexSet()) {
      list.addAll(av.getVms());
    }

    return list;
  }
Exemplo n.º 2
0
  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);
  }
Exemplo n.º 3
0
  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;
  }