Quickly Adding Values in Simulation?

Moderator: Moderators

Quickly Adding Values in Simulation?

Postby kfitting@gmail.com » Wed Feb 15, 2023 1:10 pm

I watched this video (https://www.youtube.com/watch?v=yP0_4aRB4Ok - Create and Update Instance, by MBSE Execution) and I was wondering if there is a faster way to add values than right-clicking on in the simulation and saying "add value?" I have part properties with multiplicity 1..* that need 20 instances... that's a lot of clicking! If I have multiple instances, I have to do this even more times. I tried going into the instance specification and looking at slots, but adding there does not seem to affect the simulation at all (it just adds the value property, not the instance specification object).

Any ideas?
kfitting@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Feb 15, 2023 1:07 pm
Full name: KF

Re: Quickly Adding Values in Simulation?

Postby jmorales@strattechnologies.com » Thu Feb 16, 2023 3:57 pm

Right click on the package where you've saved the instance and create an "Instance Table". Drag the instance on to this new table, you should be able to edit instance values from the table and also run a simulation on multiple instances from the table, too.
jmorales@strattechnologies.com
No Magic
No Magic
 
Posts: 15
Posts Rating:1
Joined: Wed May 25, 2022 10:05 am

Re: Quickly Adding Values in Simulation?

Postby kfitting@gmail.com » Fri Feb 17, 2023 6:57 am

Thanks! But, if I am thinking correctly, this just enables editing value properties, correct? I'm trying to add values (change multiplicity) of the various part properties. So if I have a block with multiplicity 1..* in my BDD, I can run a simulation and then, by right-clicking and choosing "Add Value" I can choose the specific multiplicity for the instance. The problem is that I have some cases where I would need to add 20+ "values"... that's a lot of clicking. Is there a way I can add value (change the multiplicty in the instance) quickly, by typing a number?
kfitting@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Feb 15, 2023 1:07 pm
Full name: KF

Re: Quickly Adding Values in Simulation?

Postby jmorales@strattechnologies.com » Fri Feb 17, 2023 2:12 pm

Not the most elegant solution, but you can try this:
Create an instance table of the part you want multiple instances of. On this table click "Create" or press the insert key on your keyboard. Create as many as you need. Here I created 5 additional students.
O9ItYFbrdz.png

Next, you'll use these to create instance values within the slot of the instance of the parent block. Open the spec, navigate to the slot, and press "Add"
bqSn7ar0Kr.png

Add multiple instance values from all of the part instances you created earlier. Here I added all 5 newly created student instance specifications
kpziHmGFXz.png

Finally, create an instance table, adding both owning block and the block typing its parts as "Classifier". In "Columns" show the value property you want to change and edit on the table.
8VhB3rxgG0.png
You do not have the required permissions to view the files attached to this post.
jmorales@strattechnologies.com
No Magic
No Magic
 
Posts: 15
Posts Rating:1
Joined: Wed May 25, 2022 10:05 am

Re: Quickly Adding Values in Simulation?

Postby FlexVar » Sat Feb 18, 2023 9:57 am

Thanks! I'll have to try this. I've been thinking about using the create button on the instance table, just hadnt gotten a chance to try it. I'll try it when I'm back at work this coming week.
FlexVar
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Sat Feb 18, 2023 9:47 am

Re: Quickly Adding Values in Simulation?

Postby FlexVar » Tue Feb 21, 2023 8:19 am

That procedure is interesting.

(First, let me explain my setup: I have a block, with another block as a part property, multiplicity 1..*. The part property's classifer has an enumeration literal with three values: NotSet, True, False. NotSet is the default. Create an instance tree. Then try to increase the multiplicity of the part property. When I create the instance table, I use the top-level instance specification object as the Scope.)

Following the way you suggest (using Create button in the instance table):

  • New instances are not named consistently with prior instances
  • But you can rename them (tedious)
  • Adding them as slot values makes everything work as expected
  • Interestingly, the first created instance (the one that is always present since the multiplicity is 1..*) never shows in the instance table. Even before trying to add more instances. It's like it's not an instance object at all. (If I change the scope to the package the top-level instance specification is in, the first instance does show in the table.)

If I use the Clone with parts:

  • Name of new instance is consistent (same name, incremented number)
  • In my case, my only sub-property is an enumeration literal... I get the instance (with all sub properties, matching the other instances I've created/renamed manually)
  • I also get an additional Enumeration literal. It has the exact same ID as the one under the instance and if I delete it, everything under the instance is removed as well. So there are two representations of the exact same object in the containment tree.
  • If I simulate my top-level instance and find the cloned instance, I cannot set any value for the enumeration in the simulation's variable window, value column. Enumeration literals in created instances are changeable.
  • The only mention on the web I can find for the clone button is: https://docs.nomagic.com/display/CSM190 ... rsion+News This is not very helpful to dig deeper into this (seemingly) strange behavior.
  • However, if I set the enumeration literal in the instance table (to a non-default value, True), the two enumeration literal objects have different IDs and I can delete one without deleting the other.

So, it looks like using create and renaming for consistency is probably the best option.

Or, the best option is just to right-click on the item in the simulation's variables window and select "Add Value" as many times as you need instances (since then you dont even have to rename).

Sigh. Looks like lots of clicking no matter what.

Is the method in the video linked in the top post to build out a specific instance of a block topology not used?? It feels like I'm doing something that is not normal, or at least not fully thought out.
FlexVar
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Sat Feb 18, 2023 9:47 am

Re: Quickly Adding Values in Simulation?

Postby FlexVar » Tue Feb 21, 2023 8:45 am

Ok, two more methods to add "values" (actually these are instances within a parent instance... increase the multiplicity in the parent):

Create instance menu

  • Right click on the top-level block, tools, create instance
  • There does not seem to be any way to choose multiplicities... only values (confusing terminology, overloaded the word "values" it feels like)

Change the block multiplicities, create instance, reset block multiplicities

  • This works great...
  • Except it gets very complicated to set all those multiplicities up/down the hierarchy
  • and then reset them!

Still not very satisfactory.
FlexVar
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Sat Feb 18, 2023 9:47 am

Re: Quickly Adding Values in Simulation?

Postby FlexVar » Tue Feb 28, 2023 8:54 am

Still haven't really found a way of solving this. The more I think about it, the more I question the terms: are you adding values or adding instances? (changing multiplicity)

Again, using instances/simulation this way just doesn't seem like something people actually do.
FlexVar
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Sat Feb 18, 2023 9:47 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests