예제 #1
0
  /**
   * ��ʼ����<br>
   * TODO����ݷ���
   */
  private void startSimulate() {

    // �ƶ�������ݼ�����
    int length = movingObjectsByTimeStamp.size();

    // TODO: ���Ը�����������ڵ㣬�ɹ�
    double[] coors = {10400.666044867343, 34660.0};
    Vertices result = eQueryFunctions.queryNetworkNodeByCoordinate(coors);
    if (result == null) {
      logger.debug("�������ڵ��ǣ�Null");
      return;
    } else {
      logger.debug(
          "�������ڵ��ǣ�"
              + result.getVertice_id()
              + "--"
              + result.getPoint_x()
              + " "
              + result.getPoint_y());
    }
    // ģ�⶯̬�ƶ�����
    for (int i = 0; i < length; i++) {

      // ��ȡij��ID��Ӧ���û��Ĺ켣���
      List points = (List) movingObjectsByTimeStamp.get(i + "");
      logger.debug("ʱ�����" + i + " �ƶ���������" + points.size());

      /** ******************** �ƶ�����������Լ�����ӳ�� ******************* */
      eQueryFunctions.mappingMovingObjectToRegionAndNetwork(points);

      // TODO�����Կ�����
      Point point = eQueryFunctions.queryCoordinateByMovingObjectId(5);
      if (point != null)
        logger.debug("�ƶ�����" + point.getId() + "��꣺" + point.getX() + " " + point.getY());

      List mos = null;
      for (int j = 1; j < 34; j++) {
        // ��ѯ
        mos = eQueryFunctions.queryMovingObjectsByRoomId(("RM1-1-" + j));
        if (mos != null) {
          logger.debug("R" + j + "�����е��ƶ�����������" + mos.size());
          point = (Point) mos.get(0);
        }
      }
      for (int j = 1; j < 16; j++) {
        // ��ѯ
        mos = eQueryFunctions.queryMovingObjectsByRoomId(("HW1-1-" + j));
        if (mos != null) logger.debug("C" + j + "�����е��ƶ�����������" + mos.size());
      }
      //
      // try {
      // Thread.sleep(2000);
      // } catch (InterruptedException e) {
      // e.printStackTrace();
      // }
    }
  }
예제 #2
0
  public Main() {

    eQueryFunctions = new EQueryFunctionsImpl();
    movingObjectsByTimeStamp = eQueryFunctions.getMovingObjectsByTimeStamp();
  }