Skip to content

Consider requiring two mutation method for all DecisionNodes #547

@arcondello

Description

@arcondello

We should consider requiring every decision to implement the following methods

class ArrayDecisionNode : public ArrayNode, public DecisionNode {
 public:
    // override the current state with a new one (specified as a flattened array).
    void assign(State& state, std::span<const double> values) const = 0;

    // override specific indices of the array
    void set_values(State& state, std::span<const std::tuple<ssize_t, double>> values) const = 0;
};

the responsibility would be on the caller to ensure the given state/changes result in a valid state for the decision, but each implementation should assert(...) for correctness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions