Skip to content
Snippets Groups Projects
Commit 2688fa90 authored by Millian Poquet's avatar Millian Poquet
Browse files

[code] energy watcher: improve energy init

parent de96df22
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,9 @@ void EnergyWatcher::make_decisions(double date,
if (_consumed_joules_updated_recently)
{
if (_previous_energy < 0)
_previous_energy = _consumed_joules;
PPK_ASSERT_ERROR(_consumed_joules - _previous_energy >= -1e-6,
"Energy consumption inconsistency: it should be non-decreasing. "
"Received %g but previous value is %g.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment