배터리 잔여 시간 예측 후보 확장

This commit is contained in:
seo
2026-06-26 02:53:07 +09:00
parent 700258c7fa
commit 41b1ba5336
3 changed files with 325 additions and 9 deletions
+33
View File
@@ -706,6 +706,12 @@
if (remaining.confidence !== undefined && remaining.confidence !== null) {
lines.push(`추세 신뢰도: ${(Number(remaining.confidence) * 100).toFixed(0)}%`);
}
if (remaining.candidate_count !== undefined && remaining.candidate_count !== null) {
const spread = remaining.rate_spread === undefined || remaining.rate_spread === null
? ''
: ` / 후보 분산 ${(Number(remaining.rate_spread) * 100).toFixed(1)}%`;
lines.push(`후보 수: ${remaining.candidate_count}${spread}`);
}
if (remaining.recent_watts !== undefined && remaining.recent_watts !== null) {
lines.push(`최근 CPU 전력: ${Number(remaining.recent_watts).toFixed(3)}W`);
} else if (remaining.avg_watts !== undefined && remaining.avg_watts !== null) {
@@ -715,6 +721,9 @@
const labels = {
recent_window: '최근 추세',
robust_regression: '강건 회귀',
voltage_slope: '전압 기울기',
energy_profile: '에너지 학습',
capacity_power_model: '용량 전력 모델',
learned_profile: '장기 학습',
};
lines.push(`계산 출처: ${remaining.sources.map(source => labels[source] || source).join(', ')}`);
@@ -727,6 +736,15 @@
if (row.source === 'robust_regression') {
return `회귀 ${row.minutes}`;
}
if (row.source === 'voltage_slope') {
return `전압 ${row.minutes}`;
}
if (row.source === 'energy_profile') {
return `에너지 ${row.intervals || 0}구간`;
}
if (row.source === 'capacity_power_model') {
return '용량 모델';
}
return `${row.minutes}`;
}).join(', ')}`);
lines.push('');
@@ -734,6 +752,21 @@
remaining.windows.forEach(row => {
if (row.source === 'learned_profile') {
lines.push(`- 장기 학습: ${row.intervals || 0}구간 / SOC대 ${row.soc_buckets || 0}개 / 누적감소 ${Number(row.drop_percent || 0).toFixed(3)}% / 신뢰도 ${(Number(row.confidence || 0) * 100).toFixed(0)}%`);
} else if (row.source === 'energy_profile') {
const wh = row.wh_per_percent === null || row.wh_per_percent === undefined ? '-' : `${Number(row.wh_per_percent).toFixed(4)}Wh/%`;
const stability = row.stability === null || row.stability === undefined ? '' : ` / 안정도 ${(Number(row.stability) * 100).toFixed(0)}%`;
lines.push(`- 에너지 학습: ${row.intervals || 0}구간 / SOC대 ${row.soc_buckets || 0}개 / ${wh} / 신뢰도 ${(Number(row.confidence || 0) * 100).toFixed(0)}%${stability}`);
} else if (row.source === 'capacity_power_model') {
const capacity = row.capacity_wh === null || row.capacity_wh === undefined ? '-' : `${Number(row.capacity_wh).toFixed(2)}Wh`;
const stability = row.stability === null || row.stability === undefined ? '' : ` / 안정도 ${(Number(row.stability) * 100).toFixed(0)}%`;
lines.push(`- 용량 전력 모델: ${capacity} / 신뢰도 ${(Number(row.confidence || 0) * 100).toFixed(0)}%${stability}`);
} else if (row.source === 'voltage_slope') {
const load = row.load_factor === null || row.load_factor === undefined ? '-' : `${Number(row.load_factor).toFixed(3)}x`;
const kept = row.kept_ratio === null || row.kept_ratio === undefined ? '' : ` / 유효점 ${(Number(row.kept_ratio) * 100).toFixed(0)}%`;
const stability = row.stability === null || row.stability === undefined ? '' : ` / 안정도 ${(Number(row.stability) * 100).toFixed(0)}%`;
const floor = row.voltage_floor === null || row.voltage_floor === undefined ? '' : ` / 하한 ${Number(row.voltage_floor).toFixed(3)}V`;
const volts = row.volts_per_hour === null || row.volts_per_hour === undefined ? '' : ` / ${Number(row.volts_per_hour).toFixed(4)}V/h`;
lines.push(`- 전압 ${row.minutes}분: 신뢰도 ${(Number(row.confidence || 0) * 100).toFixed(0)}% / 부하보정 ${load}${kept}${stability}${floor}${volts}`);
} else {
const load = row.load_factor === null || row.load_factor === undefined ? '-' : `${Number(row.load_factor).toFixed(3)}x`;
const prefix = row.source === 'robust_regression' ? '강건 회귀' : '최근 추세';