| | |
| | | |
| | | existNodes.add(nextNode); |
| | | |
| | | String nextNodeCodeData = codeMatrix[x][y]; |
| | | |
| | | if (nextNodeCodeData.equals(CodeNodeType.NONE.val)) { |
| | | List<Double> o1Cda = MapDataUtils.parseCdaNode(cdaMatrix[originNode.getX()][originNode.getY()]); |
| | | List<Double> o2Cda = MapDataUtils.parseCdaNode(cdaMatrix[x][y]); |
| | | |
| | | if (Math.pow(o1Cda.get(0) - o2Cda.get(0), 2) + Math.pow(o1Cda.get(1) - o2Cda.get(1), 2) <= Math.pow(radiusLen, 2)) { |
| | | nextNode.setCodeData(codeMatrix[x][y]); |
| | | |
| | | if (!nextNode.getCodeData().equals(CodeNodeType.NONE.val)) { |
| | | includeList.add(nextNode); |
| | | } |
| | | |
| | | this.spreadWaveNode(originNode, nextNode, codeMatrix, cdaMatrix, radiusLen, includeList, existNodes); |
| | | |
| | | } else { |
| | | |
| | | List<Double> o1Cda = MapDataUtils.parseCdaNode(cdaMatrix[originNode.getX()][originNode.getY()]); |
| | | List<Double> o2Cda = MapDataUtils.parseCdaNode(cdaMatrix[nextNode.getX()][nextNode.getY()]); |
| | | |
| | | // if (Math.pow(o1.getX() - o2.getX(), 2) + Math.pow(o1.getY() - o2.getY(), 2) <= Math.pow(radiusLen, 2)) { |
| | | if (Math.pow(o1Cda.get(0) - o2Cda.get(0), 2) + Math.pow(o1Cda.get(1) - o2Cda.get(1), 2) <= Math.pow(radiusLen, 2)) { |
| | | nextNode.setCodeData(nextNodeCodeData); |
| | | includeList.add(nextNode); |
| | | |
| | | this.spreadWaveNode(originNode, nextNode, codeMatrix, cdaMatrix, radiusLen, includeList, existNodes); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // v2 BFS ------------------------------------------------------------------------------ |