Use expressions in Distribution

493 views
Skip to first unread message

Jean-Christophe S.

unread,
Apr 4, 2016, 11:21:06 AM4/4/16
to Jaamsim Users Discussion Group
Hello Harry,

I have a new request concerning a situation I can't solve with the current Jaamsim features. (But may be I'm wrong and you can give me an advice)

Here's the situation:

I have differents types of entities that go through a server but each type has a different mean and standard deviation for the cycle time. So I wanted to create for each entity, two attributes (mean and ST) and call them in the Distribution object ([Server1].obj.mean), but it doesn't work since the distribution input can only be a number (not an expression).

So is it possible to integrate expressions in the inputs of the distributions ?

Another request would also be to be able to declare a list of data in an attribute. For example: { A (2 5 7 4 9) m} and to call these data in an expression, using an index. 

And finally, is it possible to add an output "value" to the boolean selector .It could be very usefull to simulate scraps especially if I can define the True rate with an expression as requested before.

I'm still very happy to see how dynamic is the Jaamsim team. The main challenge is to adapt to the new features when you do not practice for a while.

Best regards

Harry King

unread,
Apr 4, 2016, 12:40:37 PM4/4/16
to Jaamsim Users Discussion Group
Hi Jean-Christophe,

It's good to see you on the forum again. I'll go through your suggestions one by one:

1) Allow the probability distributions to accept expressions for mean and standard deviation. Yes, it would be quite easy to do this. I had hesitated to allow these inputs to change because I was afraid that it would encourage people to model time-varying distributions incorrectly. However, now that expressions are used so extensively in JaamSim models, I am starting to think that we should let ALL numerical inputs accept expressions and rely on good documentation to encourage people to use them correctly.

In the meantime, you can assign a Type attribute to your entities and define a separate NormalDistribution object for each type of entity. The ServiceTime keyword for the Server can then be set to 'choose( this.obj.Type, NormalDistribution1, NormalDistribution2, ... )'

2) Vector-valued attributes. This should be possible and it seems like a reasonable feature. I will look into it.

3) Value output for BooleanSelector. Yes, we can add outputs for Value and a few others.

Harry

Harry King

unread,
Apr 4, 2016, 7:20:39 PM4/4/16
to Jaamsim Users Discussion Group
Jean-Christophe,

Regarding the vector-valued attributes, do you want the ability to use an Assign object to assign one of the values in the vector based on a calculated index, e.g.

{ 'this.A( [Queue1].QueueLength ) = 0' }

Harry 

Jean-Christophe S.

unread,
Apr 6, 2016, 3:21:02 AM4/6/16
to Jaamsim Users Discussion Group
Hello Harry,

Yes it would be great.

For example, I update a counter depending on the line the object is coming from.

Today, I have to declare n Counters and use an expression like Counter_n=this.obj.line==n?Counter_n+1:Counter_n, and repeat it for each counter 

It would be more simple to declare a vector Counter attribute with the number of lines for the dimension and increase it  as you suggest: Counter(this.obj.line)=Counter(this.obj.line)+1, in an Assign object.

We should have also the possibility to declare the vector with initial values in its original object. {Counter (20,10,25,,...) [unit]}

I think that to avoid confusion, we shouldn't mix units in one vector.

Thank you again for what you're doing.

Harry King

unread,
Apr 21, 2016, 7:43:44 PM4/21/16
to Jaamsim Users Discussion Group
Hi Jean-Christophe,

Release 2016-09 satisfies two of your feature requests:
    • Allow the probability distributions to accept expressions for mean and standard deviation.
    • Value output for BooleanSelector.
    The third feature, vector-valued attributes, will be included in a major upgrade of the attribute and expression system that we are planning. I expect that it will released sometime in June.

    Harry

    Jean-Christophe S.

    unread,
    May 4, 2016, 8:35:39 AM5/4/16
    to Jaamsim Users Discussion Group
    Hello Harry,

    Thank you for this improvement.

    I tested it and it works well.

    Best regards


    Le lundi 4 avril 2016 17:21:06 UTC+2, Jean-Christophe S. a écrit :

    E.T.

    unread,
    Sep 13, 2016, 4:46:48 AM9/13/16
    to Jaamsim Users Discussion Group
    Hi Harry and Jean-Christophe, merely saying that I found this conversation useful.
    I had found the same needs with an example, that I attach, taken from Law-Kelton book, example 2.7.
    (BTW: if you find some of my examples useful, you're welcome to modify and add them to the examples collection.)

    I understand that the vector-valued attributes are yet to come, aren't they?
    LawKelton.2.7_JobShopModel.cfg

    Harry King

    unread,
    Sep 14, 2016, 6:10:13 PM9/14/16
    to Jaamsim Users Discussion Group
    Enrique,

    We will be releasing vector valued attributes sometime in the next few months. Originally, we had planned to include it with the extension of expressions to strings and entities, but decided to keep it separate. The system we are planning will be quite powerful and well worth the extra wait.

    Harry

    E.T.

    unread,
    Sep 15, 2016, 8:06:59 AM9/15/16
    to Jaamsim Users Discussion Group
    Hi Harry, surely it will be worthwhile :-)

    In the meanwhile I attach the example from Law-Kelton book, Sect.13.5,
    which is - in the authors' words - an "embellishment" of the one from Sect.2.7,
    where the movement between stations is performed by some forklifts.
    I believe it might motivate well the needs for more expressive attributes and so.

    For the movements (AssignMoveTime) I changed the statement from the book, so it was not so tedious, in the absence of lookup tables or arrays.
    (The AssignNext and AssignServiceTime already illustrated the cumbersome definition of some functions.)

    I've been unable to model a Forklift assignation such as a newly free Forklift takes the nearest pending Job (when there are more than one)
    or a newly pending Job is attended by the nearest free Forklift (when there are more than one).
    I intended using the Match values, the list of which would be required to be manipulated to compute priorities and reorder queued entities,
    but I guess doing so, that is, working with the arrays/lists of entities is not yet possible.

    Any hint? 

    Regards, Enrique
    LawKelton.13.5_JobShopModelExtended.cfg
    Reply all
    Reply to author
    Forward
    0 new messages