How to reference state in a constraint ?

Discussions about ParaMagic functionalities

Moderator: Moderators

How to reference state in a constraint ?

Postby kcsmith@raytheon.com » Thu Feb 19, 2015 12:53 pm

This is both a general SysML question and one for paraMagic.

I have a Block who's power consumption is a function of its current state defined by a State Machine within it.

1. In general, how do I reference the state property of a Block with a state machine? (or, how do I create a state attribute to represent the Block's state)? I know how to dot-reference a state in the state machine, but what represents the current state?

2. How would I reference the State in a constraint Block for paraMagic? (i.e. in an 'if' statement for example)

So far the only way I've thought of is to create a Value Type property for the Block to represent its state and then give its slot values arbitrary numbers (currentState: 1 = Initialize, 2 = Operate::LowPower, 3 = Operate::HighPower, 4 = StandBy, ...) for each state. That's not a very attractive approach since its not related in anyway to the state machine states as defined in the state machine.

The desired ultimate result is to roll-up everything into a plot that has power usage as the Y-axis and system states as the X-axis.

Thanks,
Keith Smith
kcsmith@raytheon.com
Forum Beginner
Forum Beginner
 
Posts: 47
Posts Rating:3
Joined: Wed Jul 13, 2011 11:50 am

Re: How to reference state in a constraint ?

Postby kcsmith@raytheon.com » Fri Feb 20, 2015 11:54 am

Perhaps a little progress.

I found that I can create a property for my Block of type "Vertex" and name it ActiveState.

Then in the instance of my Block, I can create a slot for ActiveState and assign it one of the states in the state machine.

The one flaw with this approach may be when there are orthogonal states, sub-states, etc. However, at least for a simple state machine this seems to work.

I don't know how I could use this in paraMagic since its a Vertex and not a value type?

Keith Smith
kcsmith@raytheon.com
Forum Beginner
Forum Beginner
 
Posts: 47
Posts Rating:3
Joined: Wed Jul 13, 2011 11:50 am

Re: How to reference state in a constraint ?

Postby rose.yntema@intercax.com » Tue Mar 17, 2015 1:35 pm

Hi Keith,

I am having a hard time visualizing what you have described, so I was hoping you could answer a few questions. Also, it would be helpful for you to attach your model and perhaps include some screenshots. If your existing model is proprietary, a simple dummy model could help us figure out the best solution.

You say you created a property of type "Vertex", but what kind of property is it? Also is there a reason you used Vertex instead of State for its type? I see that the subclasses of vertex in UML are state and pseudostate, but it seems to me that pseudostates would not affect the power consumption, or would they?

Regards,
Rose Yntema
rose.yntema@intercax.com
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:1
Joined: Tue Mar 17, 2015 12:13 pm

Re: How to reference state in a constraint ?

Postby kcsmith@raytheon.com » Tue Mar 17, 2015 1:50 pm

Hi Rose:

My model is proprietary and I don't have a simple example model to show.

Basically, power consumption of some of the system components are a function of the system's or component's state. In other words, I have a State Machine with "Low Power" and "High Power" states.

I'd like to reference these states in my parametric constraint Blocks so that I can use paraMagic to compute the total power consumption with state as a parameter.

I created a system Block property of Type "Vertex" which I called "activeState" so I could reference it in a parametric diagram. Unfortunately, I can not use it with paraMagic as paraMagic requires Value Types.

My only solution so far is to create a Value Type property and set it to 1 (for the "Low Power" state) or 2 (for the "High Power" state). This is not a very attractive solution since this Value Type property and its values (1, 2) are not associated in the model with the system's states.

Thanks,

Keith Smith
kcsmith@raytheon.com
Forum Beginner
Forum Beginner
 
Posts: 47
Posts Rating:3
Joined: Wed Jul 13, 2011 11:50 am


Return to ParaMagic

Who is online

Users browsing this forum: No registered users and 0 guests