|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final Map<String, List<int[]>> laneCodeIdxMap = new HashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final Map<String, Lane> codeLaneMap = new HashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private boolean initialized = Boolean.FALSE; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(codeData) || !this.initialized) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (Lane lane : this.lanes) { | 
|---|
|  |  |  | if (lane.getCodes().contains(codeData)) { | 
|---|
|  |  |  | return lane; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | //        if (result == null) { | 
|---|
|  |  |  | //            for (Lane lane : this.lanes) { | 
|---|
|  |  |  | //                if (lane.getCodes().contains(codeData)) { | 
|---|
|  |  |  | //                    return lane; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | return this.codeLaneMap.get(codeData); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<int[]> getLaneCodeIdxList(String codeData) { | 
|---|
|  |  |  | 
|---|
|  |  |  | for (Code code : codeList) { | 
|---|
|  |  |  | List<Long> adjacencyNode = routeService.getAdjacencyNode(code.getId()); | 
|---|
|  |  |  | this.adjacencyCodeMap.put(code.getData(), adjacencyNode.stream().map(node -> ( | 
|---|
|  |  |  | codeService.getById(node).getData() | 
|---|
|  |  |  | codeService.getCacheById(node).getData() | 
|---|
|  |  |  | )).collect(Collectors.toList())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Code parentCode = codeService.selectByData(parent); | 
|---|
|  |  |  | Code currentCode = codeService.selectByData(current); | 
|---|
|  |  |  | Code neighborCode = codeService.selectByData(neighbor); | 
|---|
|  |  |  | Code parentCode = codeService.getCacheByData(parent); | 
|---|
|  |  |  | Code currentCode = codeService.getCacheByData(current); | 
|---|
|  |  |  | Code neighborCode = codeService.getCacheByData(neighbor); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | double direction1 = this.calculateDirection(parentCode, currentCode); | 
|---|
|  |  |  | double direction2 = this.calculateDirection(currentCode, neighborCode); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void generateLaneCodeIdx(Integer lev) { | 
|---|
|  |  |  | log.info("There is initializing Lane CodeIdxMap......"); | 
|---|
|  |  |  | long l = System.currentTimeMillis(); | 
|---|
|  |  |  | if (Cools.isEmpty(this.lanes)) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | int[] codeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(lev, code); | 
|---|
|  |  |  | codeIdxList.add(codeMatrixIdx); | 
|---|
|  |  |  | this.laneCodeIdxMap.put(code, codeIdxList); | 
|---|
|  |  |  | this.codeLaneMap.put(code, lane); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|