1
zhang
2025-09-11 85392bb7db247c4596d3fbf49c9e00cfd0e76a13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.algo.model;
 
import java.util.List;
 
/**
 * 规划路径模型
 * 表示AGV的完整路径规划结果
 */
public class PlannedPath {
 
    /**
     * AGV编号
     */
    private String agvId;
 
    /**
     * 段落ID
     */
    private String segId;
 
    /**
     * 路径代码列表
     */
    private List<PathCode> codeList;
 
    // 构造函数
    public PlannedPath() {
    }
 
    public PlannedPath(String agvId, String segId, List<PathCode> codeList) {
        this.agvId = agvId;
        this.segId = segId;
        this.codeList = codeList;
    }
 
    // Getter和Setter方法
    public String getAgvId() {
        return agvId;
    }
 
    public void setAgvId(String agvId) {
        this.agvId = agvId;
    }
 
    public String getSegId() {
        return segId;
    }
 
    public void setSegId(String segId) {
        this.segId = segId;
    }
 
    public List<PathCode> getCodeList() {
        return codeList;
    }
 
    public void setCodeList(List<PathCode> codeList) {
        this.codeList = codeList;
    }
 
    /**
     * 获取路径长度
     *
     * @return 路径长度
     */
    public int getPathLength() {
        return codeList != null ? codeList.size() : 0;
    }
 
    /**
     * 获取起始位置
     *
     * @return 起始位置编号
     */
    public String getStartPosition() {
        return (codeList != null && !codeList.isEmpty()) ? codeList.get(0).getCode() : null;
    }
 
    /**
     * 获取终点位置
     *
     * @return 终点位置编号
     */
    public String getEndPosition() {
        return (codeList != null && !codeList.isEmpty()) ?
                codeList.get(codeList.size() - 1).getCode() : null;
    }
 
    @Override
    public String toString() {
        return "PlannedPath{" +
                "agvId='" + agvId + '\'' +
                ", segId='" + segId + '\'' +
                ", pathLength=" + getPathLength() +
                ", startPosition='" + getStartPosition() + '\'' +
                ", endPosition='" + getEndPosition() + '\'' +
                '}';
    }