Simulating behavior across a connector

Moderator: Moderators

Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Wed Jan 06, 2016 12:36 pm

I am learning to develop executable SysML models and simulate them with Cameo Simulation Toolkit. I am using version 18.2 of MD, SysML, and the simulation toolkit. Here are a few questions to start.

1. The simulation toolkit manual (sec 8.1) says it is possible to execute a CallOperationAction through a port. I can't make it work. See the enclosed SimFigs.docx, which includes a bdd, ibd, and the activity diagram of the classifier behavior for Sub2. I would like to have sub2 invoke sub1::op() via their proxy ports and intervening connector. I am getting a validation error the activity: "The Operation of a CallOperationAction must be owned by the execution context". The context of the CallOperationAction is Sub2 and On Port is set to the proxy port i of Sub2. What am I doing wrong?

2. Similarly, I would like to have sub2 read and write sub1::prop. Is this possible? The SysML 1.4 spec (sec 9.4) indicates this is possible but I don't see the capability mentioned in the simulation toolkit manual and don't see an On Port property for the ReadStructuralFeatureAction and AddStructuralFeatureValueAction.

3. Sys, Sub1 and Sub2 all have classifier behaviors that I would like to start automatically when simulation of Sys is started. Can I do this by designating Sys, Sub1, and Sub2 as active (Is Active = true)? This doesn't seem to work for me. The alternative seems to be to have Sys's classifier behavior explicitly start the classifier behaviors of Sub1 and Sub2. ideas?
You do not have the required permissions to view the files attached to this post.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby arnon_l » Thu Jan 07, 2016 9:12 am

Jim,

#1
The operation of CallOperationAction must be owned by Sub2, so it means op() in Sub2, not IF1.
This is a limitation of CST for now.

#2
It is possible, but not directly.

sub2 cannot read/write a property of sub1 directly, but we can:
- call the operation of sub1 (via port of sub2) to read/write its property.
- send the signal to sub1 (via port of sub2 or intervening connector) to read/write its property.

#3
You can start all classifier behaviors of Sys, Sub1 and Sub2 automatically. If you execute at Sys block, please make sure that
- set "Is Active = true" of Sys, Sub1 and Sub2
It seems your class is not set as active yet, because if the class is active, it will look like this:

3_1.jpg


- set "Autostart Active Objects" in the simulation environment options as true (it is true by default)

3_2.jpg


If you have any further questions, you can attach your model too. It helps us to investigate your issue faster.

Best regards,
You do not have the required permissions to view the files attached to this post.
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Thu Jan 07, 2016 12:36 pm

Thanks for the quick reply. I took your suggestions and made some modifications. Updated model enclosed. Look in the package "between blocks".
--I defined operations setProp and getProp for block Sub1. As a first step, I defined a classifier behavior for Sub1 that calls setProp and getProp. If I simulate Sub1, all works as expected.
--I then migrated the classifier behavior to Sub2 so that Sub2 makes the calls to setProp and getProp. I get the same validation error "The Operation of a CallOperationAction must be owned by the execution context". I don't see how to avoid that error.
You do not have the required permissions to view the files attached to this post.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby arnon_l » Sun Jan 10, 2016 7:38 pm

I would like to correct my answer about #1.

After do more investigation, it seems this limitation has already been fixed (at least in 18.2), so you can use the operation of IF1 in CallOperationAction.
However the validation rule still exists, please ignore that validation error for now, we will remove it in CST 18.3.

Best regards,
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Thu Jan 14, 2016 3:13 pm

Thanks. I got things working. See the enclosed if you are curious. I am able to call an operation via a port (#1). For some reason I don't get a validation error. I won't complain.

So far I have not been able to start the classifier behavior of a part of a block using only isActive (#3). I have been able to make it work using an explicit StartObjectBehaviorAction with isSyncronous = true. Previously I was using StartClassifierBehaviorAction, which can only be asynchronous. Suggestions welcome but not necessary.
You do not have the required permissions to view the files attached to this post.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby arnon_l » Mon Jan 18, 2016 1:27 am

I found that you didn't set "isActive" of Sub1 and Sub2 as true.

1.jpg


Please try, then the classifier behaviors of Sub1 and Sub2 will be started automatically.

Best regards,
You do not have the required permissions to view the files attached to this post.
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Mon Jan 18, 2016 10:10 am

Thanks. Besides doing that, I also needed to add a behavior at the system level like the one shown in Figure 33 of the Cameo System Toolkit User Guide. I think this is because of the following from the UML 2.5 spec: "If the classifierBehavior of an active object completes, the object is terminated." Apparently, in order to allow Sub2 to continue to exist and execute its behavior, Sys must be active and have a behavior that keeps Sys from terminating before Sub2 completes its hehavior.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Mon Feb 01, 2016 12:46 pm

I have continued to develop the model. Latest version is enclosed (MD 18.2).

I can now successfully simulate a model of a system having a 3-level decomposition:
Lsys
Lsub1
Lcomp11
Lcomp12
Lsub2
Lcomp21
Lcomp22
Lsub3
Lcomp31
Lcomp32

See simulation configuration Log::Sim::Config. The leaf-level blocks, Lcomp11 through Lcomp32, exercise flow properties, operations, and signals across connectors. The higher-level blocks start the lower-level blocks and wait until they terminate.

However, if I reassemble the leaf-level blocks in a different way, the simulation fails:

Psys
Psub1
Lcomp11
Lcomp21
Lcomp31
Psub2
Lcomp12
Lcomp22
Lcomp32

See simulation configuration Phy::Sim::Config. My goal is to test out nested ports on Psub1 and Psub2 connected by a connector with an internal structure, but I can't get that far because the simulation of Psys never starts Psub1 despite the simulation showing that the StartObjectBehavior action was executed.

What am I doing wrong?

Thanks.
You do not have the required permissions to view the files attached to this post.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby jprichardson@dcscorp.com » Wed Feb 10, 2016 1:05 pm

Just curious--can you provide any help here? There may be something simple I need to do. I see that there are a lot of views of the post.
jprichardson@dcscorp.com
Forum Beginner
Forum Beginner
 
Posts: 65
Posts Rating:0
Joined: Tue Aug 19, 2014 2:14 pm
Full name: Jim Richardson

Re: Simulating behavior across a connector

Postby arnon_l » Thu Feb 11, 2016 3:22 am

Sorry for late reply, we are quite busy on 18.3 release.

It seems that "Psub1" never been started because it has no "Classifier Behavior" (see in the specification dialog).
I guess "cbPsub1" should be set there.

Best regards,
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
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