| | |
| | | private Double s2DeadlockWeight = 8.0d; |
| | | private Double s2RunBlockWeight = 10.0d; |
| | | private Double s2LoopLoadWeight = 12.0d; |
| | | private Double circleMaxLoadLimit = 80.0d; |
| | | |
| | | private Double stationPathLenWeightPercent = 50.0d; |
| | | private Double stationPathCongWeightPercent = 50.0d; |
| | |
| | | if (source.s2DeadlockWeight != null) this.s2DeadlockWeight = source.s2DeadlockWeight; |
| | | if (source.s2RunBlockWeight != null) this.s2RunBlockWeight = source.s2RunBlockWeight; |
| | | if (source.s2LoopLoadWeight != null) this.s2LoopLoadWeight = source.s2LoopLoadWeight; |
| | | if (source.circleMaxLoadLimit != null) this.circleMaxLoadLimit = source.circleMaxLoadLimit; |
| | | if (source.stationPathLenWeightPercent != null) this.stationPathLenWeightPercent = source.stationPathLenWeightPercent; |
| | | if (source.stationPathCongWeightPercent != null) this.stationPathCongWeightPercent = source.stationPathCongWeightPercent; |
| | | if (source.stationPathPassOtherOutStationWeightPercent != null) this.stationPathPassOtherOutStationWeightPercent = source.stationPathPassOtherOutStationWeightPercent; |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.path.StationPathResolvedPolicy; |
| | | import com.zy.asrs.domain.vo.StationCycleCapacityVo; |
| | | import com.zy.asrs.domain.vo.StationCycleLoopVo; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private StationCycleCapacityService stationCycleCapacityService; |
| | | @Autowired |
| | | private StationPathPolicyService stationPathPolicyService; |
| | | |
| | | //执行输送站点入库任务 |
| | | public synchronized void stationInExecute() { |
| | | try { |
| | | DispatchLimitConfig limitConfig = getDispatchLimitConfig(); |
| | | DispatchLimitConfig baseLimitConfig = getDispatchLimitConfig(null, null); |
| | | int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()}; |
| | | LoadGuardState loadGuardState = buildLoadGuardState(limitConfig); |
| | | LoadGuardState loadGuardState = buildLoadGuardState(baseLimitConfig); |
| | | |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | DispatchLimitConfig limitConfig = getDispatchLimitConfig(stationProtocol.getStationId(), targetStationId); |
| | | LoopHitResult loopHitResult = findPathLoopHit(limitConfig, stationProtocol.getStationId(), targetStationId, loadGuardState); |
| | | |
| | | if (isDispatchBlocked(limitConfig, currentStationTaskCountRef[0], loadGuardState, loopHitResult.isThroughLoop())) { |
| | |
| | | //执行堆垛机输送站点出库任务 |
| | | public synchronized void crnStationOutExecute() { |
| | | try { |
| | | DispatchLimitConfig limitConfig = getDispatchLimitConfig(); |
| | | DispatchLimitConfig baseLimitConfig = getDispatchLimitConfig(null, null); |
| | | int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()}; |
| | | LoadGuardState loadGuardState = buildLoadGuardState(limitConfig); |
| | | LoadGuardState loadGuardState = buildLoadGuardState(baseLimitConfig); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts) |
| | |
| | | true |
| | | ); |
| | | |
| | | DispatchLimitConfig limitConfig = getDispatchLimitConfig(stationProtocol.getStationId(), moveStaNo); |
| | | LoopHitResult loopHitResult = findPathLoopHit(limitConfig, stationProtocol.getStationId(), moveStaNo, loadGuardState); |
| | | |
| | | if (isDispatchBlocked(limitConfig, currentStationTaskCountRef[0], loadGuardState, loopHitResult.isThroughLoop())) { |
| | |
| | | redisUtil.expire(RedisKeyType.STATION_CYCLE_LOAD_RESERVE.key, LOOP_LOAD_RESERVE_EXPIRE_SECONDS); |
| | | } |
| | | |
| | | private DispatchLimitConfig getDispatchLimitConfig() { |
| | | private DispatchLimitConfig getDispatchLimitConfig(Integer startStationId, Integer endStationId) { |
| | | DispatchLimitConfig config = new DispatchLimitConfig(); |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (!(systemConfigMapObj instanceof Map)) { |
| | | return config; |
| | | if (systemConfigMapObj instanceof Map) { |
| | | Map<?, ?> systemConfigMap = (Map<?, ?>) systemConfigMapObj; |
| | | config.circleMaxLoadLimit = parseLoadLimit(getConfigValue(systemConfigMap, "circleMaxLoadLimit"), config.circleMaxLoadLimit); |
| | | String loopModeValue = getConfigValue(systemConfigMap, "circleLoopModeEnable"); |
| | | if (isBlank(loopModeValue)) { |
| | | loopModeValue = getConfigValue(systemConfigMap, "circleModeEnable"); |
| | | } |
| | | if (isBlank(loopModeValue)) { |
| | | loopModeValue = getConfigValue(systemConfigMap, "isCircleMode"); |
| | | } |
| | | config.loopModeEnable = parseBoolean(loopModeValue, config.loopModeEnable); |
| | | } |
| | | Map<?, ?> systemConfigMap = (Map<?, ?>) systemConfigMapObj; |
| | | |
| | | config.circleMaxLoadLimit = parseLoadLimit(getConfigValue(systemConfigMap, "circleMaxLoadLimit"), config.circleMaxLoadLimit); |
| | | String loopModeValue = getConfigValue(systemConfigMap, "circleLoopModeEnable"); |
| | | if (isBlank(loopModeValue)) { |
| | | loopModeValue = getConfigValue(systemConfigMap, "circleModeEnable"); |
| | | if (stationPathPolicyService != null && startStationId != null && endStationId != null) { |
| | | try { |
| | | StationPathResolvedPolicy resolvedPolicy = stationPathPolicyService.resolvePolicy(startStationId, endStationId); |
| | | if (resolvedPolicy != null && resolvedPolicy.getProfileConfig() != null) { |
| | | config.circleMaxLoadLimit = parseLoadLimit(String.valueOf(resolvedPolicy.getProfileConfig().getCircleMaxLoadLimit()), config.circleMaxLoadLimit); |
| | | } |
| | | } catch (Exception ignore) { |
| | | } |
| | | } |
| | | if (isBlank(loopModeValue)) { |
| | | loopModeValue = getConfigValue(systemConfigMap, "isCircleMode"); |
| | | } |
| | | config.loopModeEnable = parseBoolean(loopModeValue, config.loopModeEnable); |
| | | |
| | | return config; |
| | | } |
| | |
| | | 100, |
| | | 1, |
| | | 1, |
| | | '{"calcMaxDepth":120,"calcMaxPaths":500,"calcMaxCost":300,"s1TopK":5,"s1LenWeight":1.0,"s1TurnWeight":3.0,"s1LiftWeight":8.0,"s1SoftDeviationWeight":4.0,"s1MaxLenRatio":1.15,"s1MaxTurnDiff":1,"s2BusyWeight":2.0,"s2QueueWeight":2.5,"s2WaitWeight":1.5,"s2DeadlockWeight":8.0,"s2RunBlockWeight":10.0,"s2LoopLoadWeight":12.0,"stationPathLenWeightPercent":50.0,"stationPathCongWeightPercent":50.0,"stationPathPassOtherOutStationWeightPercent":100.0,"stationPathPassOtherOutStationForceSkip":false}', |
| | | '{"calcMaxDepth":120,"calcMaxPaths":500,"calcMaxCost":300,"s1TopK":5,"s1LenWeight":1.0,"s1TurnWeight":3.0,"s1LiftWeight":8.0,"s1SoftDeviationWeight":4.0,"s1MaxLenRatio":1.15,"s1MaxTurnDiff":1,"s2BusyWeight":2.0,"s2QueueWeight":2.5,"s2WaitWeight":1.5,"s2DeadlockWeight":8.0,"s2RunBlockWeight":10.0,"s2LoopLoadWeight":12.0,"circleMaxLoadLimit":80.0,"stationPathLenWeightPercent":50.0,"stationPathCongWeightPercent":50.0,"stationPathPassOtherOutStationWeightPercent":100.0,"stationPathPassOtherOutStationForceSkip":false}', |
| | | '默认模板' |
| | | FROM dual |
| | | WHERE NOT EXISTS ( |
| | |
| | | s2DeadlockWeight: 8.0, |
| | | s2RunBlockWeight: 10.0, |
| | | s2LoopLoadWeight: 12.0, |
| | | circleMaxLoadLimit: 80.0, |
| | | stationPathLenWeightPercent: 50, |
| | | stationPathCongWeightPercent: 50, |
| | | stationPathPassOtherOutStationWeightPercent: 100, |
| | |
| | | }, |
| | | normalizeProfile: function (raw) { |
| | | var config = Object.assign({}, this.defaultProfileConfig(), this.parseJson(raw.configJson) || raw.config || {}) |
| | | config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit) |
| | | config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent) |
| | | config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent) |
| | | config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent) |
| | | config.circleMaxLoadLimit = config.circleMaxLoadLimit == null ? 80 : config.circleMaxLoadLimit |
| | | config.stationPathLenWeightPercent = config.stationPathLenWeightPercent == null ? 50 : config.stationPathLenWeightPercent |
| | | config.stationPathCongWeightPercent = config.stationPathCongWeightPercent == null ? 50 : config.stationPathCongWeightPercent |
| | | config.stationPathPassOtherOutStationWeightPercent = config.stationPathPassOtherOutStationWeightPercent == null ? 100 : config.stationPathPassOtherOutStationWeightPercent |
| | |
| | | }, |
| | | sanitizeProfileForSave: function (item) { |
| | | var config = Object.assign({}, item.config || {}) |
| | | config.circleMaxLoadLimit = this.toNumberSafe(config.circleMaxLoadLimit) == null ? 80 : this.toNumberSafe(config.circleMaxLoadLimit) |
| | | config.stationPathLenWeightPercent = this.toNumberSafe(config.stationPathLenWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathLenWeightPercent) |
| | | config.stationPathCongWeightPercent = this.toNumberSafe(config.stationPathCongWeightPercent) == null ? 50 : this.toNumberSafe(config.stationPathCongWeightPercent) |
| | | config.stationPathPassOtherOutStationWeightPercent = this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent) == null ? 100 : this.toNumberSafe(config.stationPathPassOtherOutStationWeightPercent) |
| | |
| | | var num = Number(value) |
| | | return isNaN(num) ? null : num |
| | | }, |
| | | displayLoadLimitPercent: function (value) { |
| | | var num = this.toNumberSafe(value) |
| | | if (num == null) { |
| | | num = 80 |
| | | } |
| | | if (num <= 1) { |
| | | num = num * 100 |
| | | } |
| | | return num.toFixed(1) + '%' |
| | | }, |
| | | notNull: function (value) { |
| | | return value != null |
| | | }, |
| | |
| | | <div class="entity-desc"> |
| | | S1: 长度(s1LenWeight) {{ item.config.s1LenWeight }} / 拐点(s1TurnWeight) {{ item.config.s1TurnWeight }} / 顶升(s1LiftWeight) {{ item.config.s1LiftWeight }}<br> |
| | | S2: 拥堵(s2BusyWeight) {{ item.config.s2BusyWeight }} / 排队(s2QueueWeight) {{ item.config.s2QueueWeight }} / 等待(s2WaitWeight) {{ item.config.s2WaitWeight }} / 死锁(s2DeadlockWeight) {{ item.config.s2DeadlockWeight }} / 堵塞(s2RunBlockWeight) {{ item.config.s2RunBlockWeight }} / 环线(s2LoopLoadWeight) {{ item.config.s2LoopLoadWeight }}<br> |
| | | 平衡: 长度(stationPathLenWeightPercent) {{ item.config.stationPathLenWeightPercent }}% / 承载(stationPathCongWeightPercent) {{ item.config.stationPathCongWeightPercent }}% / 他出惩罚(stationPathPassOtherOutStationWeightPercent) {{ item.config.stationPathPassOtherOutStationWeightPercent }} / 强跳(stationPathPassOtherOutStationForceSkip) {{ item.config.stationPathPassOtherOutStationForceSkip ? '是' : '否' }} |
| | | 平衡: 长度(stationPathLenWeightPercent) {{ item.config.stationPathLenWeightPercent }}% / 承载(stationPathCongWeightPercent) {{ item.config.stationPathCongWeightPercent }}% / 他出惩罚(stationPathPassOtherOutStationWeightPercent) {{ item.config.stationPathPassOtherOutStationWeightPercent }} / 强跳(stationPathPassOtherOutStationForceSkip) {{ item.config.stationPathPassOtherOutStationForceSkip ? '是' : '否' }}<br> |
| | | 执行: 环线禁发阈值(circleMaxLoadLimit) {{ displayLoadLimitPercent(item.config.circleMaxLoadLimit) }} |
| | | </div> |
| | | <div class="entity-actions"> |
| | | <el-button size="mini" @click.stop="openProfileDialog(item)">编辑</el-button> |
| | |
| | | <el-form-item label="死锁风险权重(s2DeadlockWeight)"><el-input-number v-model="profileForm.config.s2DeadlockWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item> |
| | | <el-form-item label="堵塞权重(s2RunBlockWeight)"><el-input-number v-model="profileForm.config.s2RunBlockWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item> |
| | | <el-form-item label="环线负载权重(s2LoopLoadWeight)"><el-input-number v-model="profileForm.config.s2LoopLoadWeight" :min="0" :step="0.5" style="width: 100%;"></el-input-number></el-form-item> |
| | | <el-form-item label="环线禁发阈值(circleMaxLoadLimit, %)"><el-input-number v-model="profileForm.config.circleMaxLoadLimit" :min="0" :max="100" :step="5" style="width: 100%;"></el-input-number></el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |