Hello! I have been getting started with JaamSim, and so far it has been amazing, thank you and congratulations for this software!
However, I have been having a few issues, possibly because I missed important options:
1) I am trying to find the smallest difference (or distance) between all pairs of values in a given unsorted list, for instance f([12, 8, 13, 16]) should give 1, but so far I've been trying to do this into an ExpressionEntity's Expression with a manually entered list, to no avail ; is there a better way to do computation on lists?
2) Especially interesting to me is the difference between the two smallest values in a given list, but so far, still as an Expression, the only way I've found to get the smallest minimum is to manually write another list looking like:
[ [Apple].Value + 10^9*min([Apple].Value, [Banana].Value)==[Apple].Value
,
[Banana].Value + 10^9*min([Apple].Value, [Banana].Value)==[Banana].Value
], to get rid of the initial minimum.
Again, I feel like there must be a simpler way to perform basic computations like in Python, directly within JaamSim, but I haven't found it...
3) On a wholly different topic, I've been trying to compute the expected time until completion of a series of events of variable length :
To put it simply, it's probably badly modeled, but I setup the filling of a tank at a slightly variable rate as a filling of 1% every X
± y min.
An EntityGenerator follows an InterArrivalTime which is a NormalDistribution, then there's a Server, then an AddTo, adding 100 "percents" to a ContainerUnit.
The two main ways I've found to estimate the instant at which the Container will be full are:
- '(([Simulation].PresentSimulationTime + (100 - [PercentQueue].QueueLength)*([ProductionRate].Mean))) ' --> "Now + expected time until full"
- '[Simulation].PresentSimulationTime - [PercentQueue].QueueTimes(1) + 100*
[ProductionRate].Mean
' --> "Time at which an empty Container was plugged + expected total time of filling"
Is there a third, better option?
4) The first solution felt more accurate, but also way more janky, as the output is roughly a sawtooth curve ; my best attempt at smoothing it was to use a MovingAverage ; currently it uses a fixed NumberOfSamples, but I would have liked to average over more values as the filling goes on.
I have tried using a variant of '[PercentQueue].QueueLength', so that it would average over something like that, without taking into the average the "TimeWhenFull" of the
previous Container :

But apparently, the MovingAverage really didn't like having a changing value as a NumberOfSamples and it always only used 1 sample (so not averaging anything), even though the Present Value from the input builder indeed showed the expression worked as intended. Do you know if that's normal and I missed something?
5) This above issue mostly stems from a need I may not have: one of the processes I would like to have in my model is simply a
somewhat steady flow of fluid into a container that has a
fixed capacity, and I would like to estimate either the
time left until full, or the
instant at which it will be full. I believe this is a pretty usual use case, so if there's a better way of modeling this than what I've been doing so far, I'm all ears!
6) As I'm using submodels that are near copies of one another, is there an easy way of gathering a value from each of the submodels?
For instance, is there an easier way to find the minimum of a value than:
'min([SubModel1.Queue].QueueLength, [...], [SubModel25.Queue].QueueLength)' ?
I would greatly appreciate some help over these points, and again I would like to thank you since other than that, there are many,
many things that went really well with the software! I'm sorry if I haven't been clear enough with my issues, let me know if I should give additional details!
Thanks in advance!
- Paul