Book a Demo

Author Topic: Modelling variable number of ports  (Read 5637 times)

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Modelling variable number of ports
« on: June 30, 2008, 09:25:39 pm »
In my model I have a class (actually a SysML Block) that can be configured to have a number of ports. For example an n-input logic gate could be instantiated with 1 or 2, or 3, or ... n inputs.

How do I model it and then deploy it (for example as a part in a composition)?

The only answer that I can find is to model the general case and then to specialise it into the myriad of actual cases, which seems to be both painful and tedious.

Any suggestions?

Regards
Dave B.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Modelling variable number of ports
« Reply #1 on: June 30, 2008, 10:42:33 pm »
Are you sure you need to specialize? Perhaps these are just instances rather than new class definitions. [A simple test is whether each of these would only be used once.]

If you are only dealing with a set of values that change between the 'specializations' then consider adding (if necessary) attributes to your current definition to accommodate these values. Then create instances of your class and set the run state for each. You'll find more information on run state in the EA help. There was also a short discussion of this in the forum in the past month or so, which you can look up.

The issue of number of ports could be trickier. Perhaps you have a set of ports, which could be modeled as a collection, or an attribute with a multiplicity setting. You'd have to play around with this a bit, perhaps building a higher-level component...

HTH, David
« Last Edit: June 30, 2008, 10:44:15 pm by Midnight »
No, you can't have it!

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: Modelling variable number of ports
« Reply #2 on: July 07, 2008, 07:25:27 pm »
I'm not at all sure how I should add a collection of ports to a class or SysML Block. All that I can think of is to add one port to class/block and then relate that to the class/block of interest in the form of a collection with a cardinality >1. This sounds and looks very ugly. Is there a better way?

Many Thanks
Dave B.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Modelling variable number of ports
« Reply #3 on: July 07, 2008, 11:39:25 pm »
I've been looking at this a bit since my earlier post, and I agree with you. We need something different, and better. [Both!]

Thus far I have not come up with anything, and am beginning to think I might not. If something comes to mind I'll post back here.
No, you can't have it!

OwenInCanada

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
  • have the right tool for the job
    • View Profile
Re: Modelling variable number of ports
« Reply #4 on: July 10, 2008, 11:20:25 am »
Depending on what your multi-port block is intended to implement, I wonder if an Expansion Region would be helpful.  See EA help index under Expansion Region, Element.  

It is an activity diagram construct that achieves repeated processing.  It applies to the case where multiple objects could be presented through a single port. I suppose that means that this construct only supports the special case in which the internal behaviour across the multiple ports can be serialized.

HTH,

Owen