| | |
| | | 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 |
| | | }, |