mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
split memorised and cost
This commit is contained in:
parent
dc8a687b33
commit
caadd9336d
2 changed files with 10 additions and 4 deletions
|
@ -417,7 +417,8 @@ message SimulateFsrsReviewResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
message SimulateFsrsWorkloadResponse {
|
message SimulateFsrsWorkloadResponse {
|
||||||
map<uint32, float> dr_workload = 1;
|
map<uint32, float> cost = 1;
|
||||||
|
map<uint32, float> memorized = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ComputeOptimalRetentionResponse {
|
message ComputeOptimalRetentionResponse {
|
||||||
|
|
|
@ -286,12 +286,17 @@ impl Collection {
|
||||||
)?;
|
)?;
|
||||||
Ok((
|
Ok((
|
||||||
dr,
|
dr,
|
||||||
result.memorized_cnt_per_day.last().unwrap_or(&0.)
|
(
|
||||||
/ result.cost_per_day.iter().sum::<f32>(),
|
*result.memorized_cnt_per_day.last().unwrap_or(&0.),
|
||||||
|
result.cost_per_day.iter().sum::<f32>(),
|
||||||
|
),
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
.collect::<Result<HashMap<_, _>>>()?;
|
.collect::<Result<HashMap<_, _>>>()?;
|
||||||
Ok(SimulateFsrsWorkloadResponse { dr_workload })
|
Ok(SimulateFsrsWorkloadResponse {
|
||||||
|
memorized: dr_workload.iter().map(|(k, v)| (*k, v.0)).collect(),
|
||||||
|
cost: dr_workload.iter().map(|(k, v)| (*k, v.1)).collect(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue