Create labels based on arrival list

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Nickdendrijver
Posts: 3
Joined: Sunday 29 April, 2018 - 12:43

Create labels based on arrival list

Post by Nickdendrijver »

Dear all,

I have made a model with a arrival list with multiple arrivals. Later on in the model I want to create multiple labels based on a percentage for the different arrivals in a server (trigger on entry or exit).

Such as,
if Arrival time (7,5) --> label 1 30%, label 2 40% and label 3 30%
if Arrival time (8,5) --> label 1 60%, label 2 30% and label 3 10%
and so on.

Can anyone tell me if this is possible and how I can execute this?

Thanks you for all the help,

Kind regards,
User avatar
Markus Holzner
Posts: 21
Joined: Thursday 20 January, 2011 - 13:31

Re: Create labels based on arrival list

Post by Markus Holzner »

Dear Nickdendrijver,

I do not fully understand your intention - maybe it would help if you could attach a model or maybe even a part of the model related to your topic.

Nevertheless, you should have a look at the Empirical Distribution atom. Please, also check the Help and maybe the example model "Empirical Distribution.mod".

Basically, for the Empirical Distribution atom, you have a table with 2 columns and as many rows you need. The first column contains your percentages (needs to be cumulative, so the last row should add up to 100 [%]) and the second any value you can define yourself. Maybe in your case that could look like 30 - 70 - 100 (not 30 - 40 - 30 !!!) in column 1 and 1 - 2- 3 in colmn 2.
If you need several different distributions, just use several of these atoms. Each atom gets a distribution name like let's say "MyArrivals". If you use that command MyArrivals now anywhere in some code (triggers, ...) you get as a result like in our example the values 1, 2 or 3 (from column 2). You can use that information to set your labels now or for any other purpuse. Hint: you can also test that command MyArrivals in the Interact window!

I hope that helps, otherwise, please let me know. Success.

Best regards,
Markus
Post Reply