Track Pending Assignments in UDQ Configuration Object

The existing implementation used the UDQ State object to track
pending ASSIGN operations, mainly in terms of the report step index,
but this implies that the logic implicitly assumes an ASSIGN
operation can run at most once per report step.  That assumption
usually holds, but fails if the ASSIGN operation is triggered from
an ACTIONX block that happens to run multiple times within a report
step.

This commit instead introduces a new data member,

    UDQConfig::pending_assignments_

that keeps track of all ASSIGN operations that have been added for
the current report step.  We clear those pending assignments when
forming a new Schedule block (ScheduleState object), under the
assumption that all pending ASSIGN operations have been affected at
the previous time level (report step).

In effect, this new data member assumes the role of

    UDQState::assignments

and we therefore remove that data member and update the signature of

    UDQState::add_assign()

to account for the fact that the 'report_step' parameter is no
longer needed.
This commit is contained in:
Bård Skaflestad
2023-06-28 13:13:53 +02:00
parent 8ed1b4c21e
commit 09ffacb5bf
8 changed files with 120 additions and 86 deletions

View File

@@ -2851,7 +2851,7 @@ UDQ
const auto& udq = schedule.getUDQConfig(1);
{
const auto& ass = udq.assign("FUBHPP1");
context.update_assign(1, "FUBHPP1", ass.eval());
context.update_assign("FUBHPP1", ass.eval());
}
const auto& def = udq.define("WUDELTA");
auto res = def.eval(context);