Roll-up Pattern Not Summing on Parts with Multiplicities

Moderator: Moderators

Roll-up Pattern Not Summing on Parts with Multiplicities

Postby tford@integrity-apps.com » Mon Dec 03, 2018 10:52 pm

I am running Cameo Systems Modeler v19.0 with Cameo Simulation Toolkit.

I have a very simple model (attached) with a System <<block>> which is directly composed of a Component <<block>> of multiplicity [2..4]. After I apply the Cost Roll-Up Pattern and simulate the System <<block>>, I can manually key in Costs in the Variables pane for each of the two Component instances created plus the System instance and the System /TotalCost calculates correctly. I can also Add a Value to create additional Component instances up to the limit of 4 and the /TotalCost summation still works.

The problem occurs if I save an instance of my Component <<block>> (called myComponent) with a Cost assigned to the Cost slot, and then later try to apply this instance to Component instances when simulating my System <<block>>. The cost roll-up summation no longer works. Sometimes all costs are zeroed out, sometimes Cameo Simulation Toolkit only recognizes the cost of the first Component instance and ignores successive instances. I have confirmed this problem on multiple models I have created and several of my students independently ran into the same problem.

This is a problem for us because we are trying to create a library of Part instances from which we can build and analyze different system design variants. But the roll-up patterns do not work when applying Part instances from the library during simulation, and hence our parametric diagrams do not calculate correctly since they depend upon an accurate roll-up summation.

We'd appreciate any help you can give us!
You do not have the required permissions to view the files attached to this post.
Thomas Ford, PhD
tford@integrity-apps.com
Forum Newbie
Forum Newbie
 
Posts: 10
Posts Rating:3
Joined: Wed Apr 12, 2017 12:57 pm

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby rcastner@idtus.com » Tue Jul 20, 2021 1:25 pm

I am also having this issue. Any thoughts from NoMagic on this?

Thanks!
Reid
rcastner@idtus.com
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Aug 25, 2020 7:11 am

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby saulius_p » Wed Jul 21, 2021 9:54 am

Hello,

Good to talk to you. There are not enough details how instance is used. Could you please provide steps / screenshots or better video and small sample with the problem reproduced.

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 335
Posts Rating:14
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby rcastner@idtus.com » Thu Sep 02, 2021 9:31 am

It seems to me that the issue stems from the fact that MagicDraw doesnt make a copy of the instance that you drop in to the slots.... let me explain through example.

Below, I have simulated 'System' and drag+dropped the 'myComponent' instance to both slots. When I did this, I would have expected cameo to assign it two unique references, except it didnt (I believe the reference is assigned at the time of instance save, and never rehashed). In the screenshot, you can see the hash @62596e19 assigned to both slots. This is what causes the bug to occur.

Capture.PNG


Now in this second picture, I copy pasted 'myComponent' which by default was named 'myComponent1', and then drag+dropped them separately into the slots. Now the cost summation is working.

Capture1.PNG


I can't tell on my own if this is a bug, or intended behavior, but as a user, I would love it if the hashes (i.e. @62596e19) were generated at simulation time in the simulation toolkit. I feel that I should be able to generate one instance, just like the original poster, and then drag and drop it into many slots. Copy and pasting an instance to work around the limitations displayed here feels awkward, and it gets messy when you are talking about instantiations that are sufficiently large.
You do not have the required permissions to view the files attached to this post.
rcastner@idtus.com
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Aug 25, 2020 7:11 am

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby saulius_p » Thu Sep 02, 2021 10:30 am

Hello Reid,

Good to talk to you. Thank you for sharing.

In general this is not a bug, instance is an object. SO when you drag same instance it shows that same object is used. This is how you can choose to reuse same object or different also this is how it is saved into model - as instances.

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 335
Posts Rating:14
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby rcastner@idtus.com » Thu Sep 02, 2021 1:49 pm

Saulius, thanks for the response. I still think this is something that the implementation team of cameo simulation toolkit should be aware of, or at least respond to.

I wrote a java program to display why users like me believe what is happening here is odd.

Capture2.PNG


Capture3.PNG


Capture4.PNG


I hope you can understand why I find it odd that doing the same sort of sum on two objects with the same hash would produce a different result in MagicDraw, and why many users aside from me might find this behavior odd / confusing.
You do not have the required permissions to view the files attached to this post.
rcastner@idtus.com
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Aug 25, 2020 7:11 am

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby saulius_p » Thu Sep 02, 2021 2:36 pm

Reid,

Totally agree that it is confusing that multiplicity gets the same as if one object is used. Not sure is this right. I will share this case with dev team.

thank you for pointing this.

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 335
Posts Rating:14
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Roll-up Pattern Not Summing on Parts with Multiplicities

Postby arnon_l » Tue Sep 28, 2021 10:38 pm

Hello,

The roll-up pattern uses subset properties to contain child.
So in general, it should not contain the duplicate child, and not sum them too.

However if you drag and drop the instance into the variable panel, it will create the representative of that instance in the run-time environment, so it will use the same instance for both slots (then the roll-up pattern does not work as you expected).

BTW, I found that when slots contain the same instance, the roll-up pattern does not work at all in version 2021x refresh1 and older.
This issue has been fixed in 2021x refresh2 (sum only one instance).

Sincerely,
arnon_l
Customer Support
Customer Support
 
Posts: 85
Posts Rating:10
Joined: Thu Aug 30, 2012 3:39 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests