Skip to content

sheet_t::reinitialization() doesn't provide an ordering guarantee #137

Description

@sean-parent

If the following sheet (from default.pme) is reinitialized, the order of initialization is indeterminate (order is determined by iterating a closed_hash_map). Because the ordering of initializion determines priorities, the sheet may give different result. As a work-around you can ensure that only values used in the initial update are initialized. In this case the fix is to remoce the initializer on distance. Although that give you consistent results on reinitialization the priority state is still indeterminate so an edit may give a different result.

sheet distance_calculator
{
input:
    unit        : 1;

interface:
    distance  : 15 * unit; /* remove this initializer */
    rate        : 3 * unit;
    time        : 5 * unit;

logic:
    relate {
        rate <== distance / time;
        time <== distance / rate;
        distance <== rate * time;
    }
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions