| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.common.utils.CommonUtil; |
| | | import com.zy.acs.manager.common.utils.LocUtils; |
| | | import com.zy.acs.manager.core.domain.Lane; |
| | | import com.zy.acs.manager.manager.entity.*; |
| | |
| | | assert null != firstCode; |
| | | Double[] toPosition = new Double[]{firstCode.getX(), firstCode.getY()}; |
| | | // calculate distance |
| | | weight = weight + this.calcPositionDistance(fromPosition, toPosition); |
| | | weight = weight + CommonUtil.calcDistance(fromPosition, toPosition); |
| | | |
| | | // return opposite |
| | | return -weight; |
| | | } |
| | | |
| | | private int calcPositionDistance(Double[] from, Double[] to) { |
| | | return (int) (Math.abs(to[0] - from[0]) + Math.abs(to[1] - from[1])); |
| | | } |
| | | |
| | | public synchronized Agv execute(Task task, Map<String, List<Long>> taskAllot, List<Long> taskIds) { |