Extracting DSM or N2 matrixes from Capella

Has anyone done this and has a script to share/show?

cheers, Ricardo

I don’t think there is any script to export table representations. Python4Capella doesn’t provide any API to do that, but you can call Java API.

One way could be to use the CSV export:

aird_path = '/In-Flight Entertainment System/In-Flight Entertainment System.aird'
model = CapellaModel()
model.open(aird_path)

table = model.get_diagrams('System Functions - Operational Activities').get(0).get_java_object().getRepresentation()
path = org.eclipse.core.runtime.Path.fromOSString('/tmp/file.csv')
csv_format = org.eclipse.sirius.ui.business.api.dialect.ExportFormat(org.eclipse.sirius.ui.business.api.dialect.ExportFormat.ExportDocumentFormat.CSV, None)
progress_monitor = org.eclipse.core.runtime.NullProgressMonitor()
org.eclipse.sirius.ui.business.api.dialect.DialectUIManager.INSTANCE.export(table, None, path, csv_format, progress_monitor, False)

The PyDev editor will show an error on the symbol org you can ignore it and remove it if you want.

Another way could be exporting with the Sirius table model API.

Maybe the sample script Export_traceability_matrix_SF_LF_to_xlsx.py that comes with Python for Capella would be a good start?

Thanks for this suggestions! Will explore them.

Cheers

I think I found something that could fit your needs. The code is not contributed yet but it should be contributed to the labs4capella organization and some parts will probably be contributed to Python4Capella.

Some videos:

3 Likes

This would be a great addition for the community.

The github repository.

1 Like

Hello Ricardo,
We have just published in Labs4Capella a Samares-Engineering contribution called DSM4Capella in the following github repository : GitHub - labs4capella/DSM4Capella

Our proposal consist to analyze existing interfaces complexity between logical functions and extract N2 matrix. Then, you have possibility to generate an “optimized” allocation using a genetic algorithm (we have a pending paper in a conference which details the behavior).

Do not hesitate to contact me in case you have any questions.

Regards,

3 Likes

This is great! Will try it.

Hello, for information we have performed minor updates on the Youtube videos and the link proposed in the early stages of the post are outdated. The updated links are available in the User guide documentation : DSM4Capella/DSM4Capella/User guide/Userguide.md at master · labs4capella/DSM4Capella (github.com)

Regards,

4 Likes