A device for providing output values with associated uncertainties for a flexible modular plant or machine, the modular plant or machine comprising an arrangement of a combination of modular entities, the combination of the modular entities being subject to be made or changed during runtime of the flexible modular plant or machine, and uncertainty information associated with an operation of said modular entity being assigned to a plurality of said modular entities, the device comprising:
- an interface configured to receive, by said plurality of modular entities, input values based on an operation of said modular entities;
- and
- a computing unit configured to calculate an output value based on said input values provided by said plurality of modular entities, configured to calculate an input value uncertainty for each input value based on the uncertainty information of a modular entity providing the input value and, during runtime, configured to calculate at least one output value uncertainty associated with the output value based on propagation of uncertainty using the input value uncertainties;
- wherein said interface is configured to output said output value and said at least one output value uncertainty;
- wherein at least one calculation tree describing how said output value is calculated based on said input values is provided;
- wherein the combined plurality of said modular entities of the arrangement is modified during runtime of the flexible modular plant or machine based on the output value and said at least one output value uncertainty output from said interface;
- and
- wherein, if a plurality of different calculation trees is provided for calculating the output value, corresponding to different ways to calculate said output value, then an optimal calculation tree is determined which results in a lowest output value uncertainty.