Skip to content

Commit 84fd278

Browse files
bugarelaCopilot
andauthored
Update evaluator/src/simulator.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b788e87 commit 84fd278

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

evaluator/src/simulator.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ impl ParsedQuint {
161161

162162
/// Get statistics about the lengths of traces collected during simulation.
163163
fn get_trace_statistics(trace_lengths: &[usize]) -> TraceStatistics {
164+
if trace_lengths.is_empty() {
165+
return TraceStatistics {
166+
average_trace_length: 0.0,
167+
max_trace_length: 0,
168+
min_trace_length: 0,
169+
};
170+
}
164171
TraceStatistics {
165172
average_trace_length: trace_lengths.iter().sum::<usize>() as f64
166173
/ trace_lengths.len() as f64,

0 commit comments

Comments
 (0)