It's all about the answers!

Ask a question

Are there any good examples of using Rhapsody with C++ for a simulation/calculations? What language/compiler is best to use with rhapsody?

Logan Torres (173) | asked Jan 27, 10:28 a.m.

 Is C++ the best language to use? Is Cygwin a popular compiler to use?

Accepted answer

permanent link
Andy Lapping (6836) | answered Jan 28, 12:01 p.m.

 The compiler is usually used to compile source code that Rhapsody has generated from the model. What you are doing I think is more of an analysis. I've done something similar with RAAML (Risk Analysis) - I build the model using graphics and / or tables - and then I use Java - through the Rhapsody API - to perform the actual calculations. The results of the calculations are also added to the model and presented in tables. Have a look and see if this is the kind of thing you want:

You can download the profile here:

Here's a hands on lab where you can try it out:


Logan Torres selected this answer as the correct answer

One other answer

permanent link
Andy Lapping (6836) | answered Jan 28, 8:44 a.m.

 It really depends on what you are trying to achieve and what you level of knowledge is with the languages. Rhapsody supports C, C++ and Java. If you are an experienced C++ programmer then yes use C++ - if you know Java use Java. Then there is the expense - Java 'compilers' are free - as is Cygwin. Visual Studio on the other hand tends to be an expense although there are lightweight free versions you can use (last time I checked anyway which was a while ago).

Rhapsody supports many compilers out of the box - Cygwin and Visual Studio included. 

Do you have an example of what you are trying to do ?

Logan Torres commented Jan 28, 9:49 a.m.

Trying to conduct a RMA (Reliability, Maintainability, Availability) analysis of our system. So will also need tables of data that help us calculate the RMA values as well. Would we use tables within Rhapsody for that? And then use an activity diagram to calculate the RMA values? 

Your answer

Register or to post your answer.