| | |
| | | import com.zy.ai.domain.autotune.AutoTuneRuleSnapshotItem; |
| | | import com.zy.ai.domain.autotune.AutoTuneSnapshot; |
| | | import com.zy.ai.domain.autotune.AutoTuneStationRuntimeItem; |
| | | import com.zy.ai.domain.autotune.AutoTuneTargetType; |
| | | import com.zy.ai.domain.autotune.AutoTuneTaskSnapshot; |
| | | import com.zy.ai.service.AutoTuneSnapshotService; |
| | | import com.zy.ai.service.FlowTopologySnapshotService; |
| | |
| | | item.setMaxStep(rule.getMaxStep()); |
| | | item.setCooldownMinutes(rule.getCooldownMinutes()); |
| | | item.setDynamicMaxValue(rule.isDynamicMaxValue()); |
| | | item.setDynamicMaxSource(resolveDynamicMaxSource(rule)); |
| | | item.setNote(resolveRuleNote(rule)); |
| | | item.setDynamicMaxSource(rule.getDynamicMaxSource()); |
| | | item.setNote(rule.getNote()); |
| | | result.add(item); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private String resolveDynamicMaxSource(AutoTuneRuleDefinition.Rule rule) { |
| | | if (!AutoTuneTargetType.STATION.equals(rule.getTargetType())) { |
| | | return null; |
| | | } |
| | | if (!"outTaskLimit".equals(rule.getTargetKey())) { |
| | | return null; |
| | | } |
| | | return "currentParameterSnapshot.stationOutBufferCapacities[targetId]"; |
| | | } |
| | | |
| | | private String resolveRuleNote(AutoTuneRuleDefinition.Rule rule) { |
| | | if (AutoTuneTargetType.STATION.equals(rule.getTargetType()) |
| | | && "outTaskLimit".equals(rule.getTargetKey())) { |
| | | return "单次调整幅度不能超过 maxStep;增大时不得超过对应站点 outBufferCapacity。"; |
| | | } |
| | | return "单次调整幅度不能超过 maxStep。"; |
| | | } |
| | | |
| | | private AutoTuneTaskSnapshot buildTaskSnapshot() { |