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() + '\'' +
|
'}';
|
}
|
}
|