#
luxiaotao1123
2024-12-23 0ae57663de53c0c988d4b06a1218c1a4c5440651
#
3个文件已修改
1个文件已删除
258 ■■■■ 已修改文件
zy-acs-flow/src/map/constants.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/resources/agv.py 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/resources/agv1.py 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/constants.js
@@ -1,5 +1,5 @@
export const ANIMATE_DURING_TIME = 200;
export const ANIMATE_DURING_TIME = 800;
export const MAP_DEFAULT_ROTATION = 270;
zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/MapDataWsScheduler.java
@@ -33,7 +33,7 @@
@Component
public class MapDataWsScheduler {
    public static final int WEBSOCKET_BROADCAST_INTERVAL = 200;
    public static final int WEBSOCKET_BROADCAST_INTERVAL = 800;
    private ExecutorService singleThreadExecutor;
@@ -58,7 +58,7 @@
                    MapWsVo mapWsVo = new MapWsVo();
                    mapWsVo.setAgvVos(syncAgv());
                    MapWebSocket.broadcast(GsonUtils.toJson(mapWsVo));
                    Thread.sleep(WEBSOCKET_BROADCAST_INTERVAL);
                    Thread.sleep(WEBSOCKET_BROADCAST_INTERVAL / 2);
                } catch (Exception e) {
                    log.error("MapDataWsScheduler.init", e);
                }
zy-acs-manager/src/main/resources/agv.py
@@ -19,29 +19,45 @@
def getWaveScopeByCode_iterative(x, y, codeMatrix, cdaMatrix, radiusLen):
    """
    使用广度优先搜索(BFS)来代替递归,以避免递归深度过大的问题。
    使用广度优先搜索(BFS)并跟踪扩展方向,以避免递归深度过大和不必要的资源浪费。
    当遇到 'NONE' 节点时,仅在当前方向上继续扩展。
    """
    includeList = []
    existNodes = set()
    queue = deque()
    originNode = {"x": x, "y": y}
    currNode = {"x": x, "y": y}
    queue.append(currNode)
    # 初始节点,没有方向
    originNode = {"x": x, "y": y, "dir": None}
    queue.append(originNode)
    existNodes.add((x, y))
    while queue:
        node = queue.popleft()
        node_x, node_y = node['x'], node['y']
        neighbors = [
            (node_x + 1, node_y),
            (node_x - 1, node_y),
            (node_x, node_y + 1),
            (node_x, node_y - 1)
        ]
        node_x, node_y, current_dir = node['x'], node['y'], node['dir']
        for neighbor in neighbors:
            nx, ny = neighbor
        # 根据当前方向决定扩展的方向
        if current_dir is None:
            # 如果没有方向,向四个方向扩展
            neighbors = [
                (node_x + 1, node_y, 'right'),
                (node_x - 1, node_y, 'left'),
                (node_x, node_y + 1, 'down'),
                (node_x, node_y - 1, 'up')
            ]
        else:
            # 如果有方向,仅在该方向上扩展
            if current_dir == 'right':
                neighbors = [(node_x + 1, node_y, 'right')]
            elif current_dir == 'left':
                neighbors = [(node_x - 1, node_y, 'left')]
            elif current_dir == 'down':
                neighbors = [(node_x, node_y + 1, 'down')]
            elif current_dir == 'up':
                neighbors = [(node_x, node_y - 1, 'up')]
            else:
                neighbors = []
        for nx, ny, direction in neighbors:
            # 检查边界条件
            if (nx < 0 or nx >= codeMatrix.shape[0] or ny < 0 or ny >= codeMatrix.shape[1]):
                continue
@@ -52,8 +68,10 @@
            neighbor_code = codeMatrix[nx, ny]
            if neighbor_code == 'NONE':
                queue.append({"x": nx, "y": ny})
                # 遇到 'NONE' 节点,继续在当前方向上扩展
                queue.append({"x": nx, "y": ny, "dir": direction})
            else:
                # 检查距离条件
                o1Cda = convert_to_float_array(cdaMatrix[x, y])
                o2Cda = convert_to_float_array(cdaMatrix[nx, ny])
@@ -65,7 +83,8 @@
                        "y": int(ny),
                        "code": str(codeMatrix[nx, ny])
                    })
                    queue.append({"x": nx, "y": ny})
                    # 非 'NONE' 节点,重置方向
                    queue.append({"x": nx, "y": ny, "dir": None})
    return includeList
zy-acs-manager/src/main/resources/agv1.py
File was deleted