| real sum approximation problem [message #754485] |
Wed, 02 November 2011 13:32  |
giovi Messages: 39 Registered: September 2011 |
Member |
|
|
hi,
i've problem with a constraint in my model. I want to test in my state machine if the sum of probability (Real eattribuute) of all outgoingTransitions in any states is equal to 1. For do this i've write this ocl code:
outgoingTransition.transProb->iterate(p; res : Real = 0 | res+p) = 1.0
constraint work but the problem is in the approximation... if for example i test this rule in a state with 2 transition with 0.2 and 0.8 probability, i receive as result 1.0000000149011612, not 1.0. Where is problem?
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01782 seconds