| | |
| | | import com.zy.asrs.wcs.core.map.entity.MapWsVo; |
| | | import com.zy.asrs.wcs.core.utils.Utils; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * Created by vincent on 4/3/2024 |
| | | */ |
| | | @Component |
| | | //@Component |
| | | public class MockScheduler { |
| | | |
| | | private int row = 1; |
| | |
| | | increasingBay = !increasingBay; // 到达每行的末尾时改变bay的递增/递减方向 |
| | | } |
| | | return fullPath; |
| | | } |
| | | |
| | | private List<String> generatePreTravelPath(int currentRow, int currentBay, int currentLev, boolean increasingBay, int pathLength) { |
| | | List<String> path = new ArrayList<>(); |
| | | int tempRow = currentRow; |
| | | int tempBay = currentBay; |
| | | boolean tempIncreaseBay = increasingBay; |
| | | |
| | | for (int i = 0; i < pathLength; i++) { |
| | | if (tempIncreaseBay) { |
| | | if (tempBay < 30) { |
| | | tempBay++; |
| | | } else { |
| | | if (tempRow < 10) { |
| | | tempRow++; |
| | | } else { |
| | | tempRow = 1; // 如果 row 已经是最大,则回到起始位置 |
| | | } |
| | | tempIncreaseBay = false; |
| | | } |
| | | } else { |
| | | if (tempBay > 1) { |
| | | tempBay--; |
| | | } else { |
| | | if (tempRow < 10) { |
| | | tempRow++; |
| | | } else { |
| | | tempRow = 1; // 如果 row 已经是最大,则回到起始位置 |
| | | } |
| | | tempIncreaseBay = true; |
| | | } |
| | | } |
| | | // 将生成的库位号加入路径列表 |
| | | path.add(Utils.getLocNo(tempRow, tempBay, currentLev)); |
| | | } |
| | | |
| | | return path; |
| | | } |
| | | |
| | | } |