I tried to model this C++ function using AD(we assume that there is an operation named max in class Class0, and the AD will model the behaviour of that operation)
int max (int a, int b)
{
if a < b
return b
else
return a;
}
I tried to use activity parameter nodes with 2 input parameter (int a and int b) et one outpout parameter
I used a desision node like follow
a<b
<> _ _ _ _
|
| a>b
|
but I can not link this decision node neither with the 2 input parameters nor with the result (output parameter)
because:
- I think that decision node has only one incoming flow, so how can I add both a and b to the decision node
- I think I can use a merge node after the decision one, but How can I say that one flow of the outging flows of a decision node holds only the maximum between a and b?
I seems to be very confused :(
did so has an idea how we can model such a simple function ?
thank you very much for your help.
Asma
I tried to model this C++ function using AD(we assume that there is an
operation named max in class Class0, and the AD will model the
behaviour of that operation)
int max (int a, int b)
{
if a < b
return b
else
return a;
}
I tried to use activity parameter nodes with 2 input parameter (int a
and int b) et one outpout parameter
I used a desision node like follow
a<b
<> _ _ _
|
--
You received this message because you are subscribed to the Google Groups "UML Forum" group.
To post to this group, send email to umlf...@googlegroups.com.
To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/umlforum?hl=en.
| Well, this is particularly silly thing to do --- there are several ways. 1) both a and b could go into the same action, which could subtract b from a (result=a-b) the result could go the decision node, which would test on <=0 or > 0. Depending on the result the flow would go to a different action. Each action would have two inputs, one the result from the test and the other the appropriate a or b value, which would then go to the return value. 2) In the UML 2.2, the decision node has been modified so that it can accept one or two inputs to handle this sort of thing. Michael --- On Mon, 1/25/10, asma <charf...@gmail.com> wrote: |
|
|
To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.
To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.