Package api

Examples of api.Vertex


   */
  private boolean distributeMessages() throws IllegalMessageException {
    if (!incomingMsgs.isEmpty()) {
      for (int index = 0; index < this.incomingMsgs.size(); index++) {
        Message msg = this.incomingMsgs.get(index);
        Vertex targetVertex = idVertexMap.get(msg.getDestVertexID());
        if (targetVertex == null) {
          throw new IllegalMessageException(msg, this.getId());
        }

        targetVertex.queueMessage(msg);
      }
      this.incomingMsgs.clear();
      return true;
    }

View Full Code Here


      thisPartitionSize = 0;
      List<Vertex> listOfVertices = new Vector<Vertex>();
      while (thisPartitionSize < partitionSize
          && (line = buffRdr.readLine()) != null) {
        thisPartitionSize++;
        Vertex newVertex = (Vertex) (Class.forName(vertexClassName)
            .newInstance());
        newVertex.initialize(line);
        listOfVertices.add(newVertex);
      }

      if (listOfVertices.size() > 0) {
        int partitionID = listOfPartitions.size();
View Full Code Here

        new FileReader(inputFile));

    String line = null;
    List<Vertex> listOfVertices = new Vector<Vertex>();
    while ((line = buffReader.readLine()) != null) {
      Vertex aNewVertex = (Vertex) (Class.forName(vertexClassName)
          .newInstance());
      aNewVertex.initialize(line, this);
      String vtxSolnFile = aDataLocator.getVertexFile(aNewVertex
          .getVertexID());
      aNewVertex.setSolutionFile(vtxSolnFile);
      listOfVertices.add(aNewVertex);
    }

    buffReader.close();
    return listOfVertices;
View Full Code Here

  /**
   * Clears the vertex message queues
   */
  public void clearVertexQueues() {
    for (int index = 0; index < listOfVertices.size(); index++) {
      Vertex v = listOfVertices.get(index);
      v.clearMessageQueue();
    }

  }
View Full Code Here

TOP

Related Classes of api.Vertex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.