Example #1
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;
  }