Empirical Distribution

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
iam88
Posts: 2
Joined: Monday 07 January, 2013 - 21:16

Empirical Distribution

Post by iam88 »

Dear Incontrol-Team,

I am a rookie regarding Enterprise Dynamics and my problem is that I have 3 different atoms (Initialize, ExcelActiveX and Empirical Distribution) in my model, which I want to interconnect.

First of all, I connected my Excel-Sheet with the data base with the ExcelActiveX-atom. But now I want that by starting each simulation run, the Initialize-atom shall write the distribution out of the ExcelActiveX-atom into the Empirical Distribution-atom, so that I can feed my Source-atom with new products with the distribution of the Empirical Distribution-atom.

It would be great to get a hint because I do not have any clue how to solve this problem.

Thank you in advance.
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Empirical Distribution

Post by marlies »

Hi,

Here are some hints how to do this:
1. Make a global reference / alias to your ExcelActiveX table. You can do that by right clicking the table and selecting the option "Create Alias". Assume that you called the table MyExcelData, you can now directly refer to the table with refMyExcelData.
2. Connect the 1st inputchannel of your initialize atom to the central (yellow) channel of the emperical distribution atom.
3. Now you can write code to copy data from the exceltable to the empirical. You can read and write data from an atom's table using the command cell. Assume that you have 3 classes in your distribution, it might look like this:

Code: Select all

Repeat(
 3,
 { remember that the emperical is connected to 1st input of the initialize, the code: in(1,c) refers to the emperical atom when you write code on the initialize }
 cell( count, 1, in(1, c)) := cell( count, 1, refMyExcelData)
)
4. I think you'd better not select the option "On Reset" on the initialize atom. When you read data from Excel onreset and you copy the data onreset of another atom, it could happen that the resets will be executed in the wrong sequence. When you do not select this option, the distribution will be updated on the very beginning of a simulation run.

Good luck!

Marlies
iam88
Posts: 2
Joined: Monday 07 January, 2013 - 21:16

Re: Empirical Distribution

Post by iam88 »

Thank you very much for your answer and your help!

I followed your instructions and I understand the first part of your 4D-Skript (Repeat(3,cell(count,1,in(1,c))), but the second part (:=cell(count,1,refMyExcelData) does not function, because I can not create an alias by right clicking on the ExcelActiveX-atom and therefore I can not refer to the table with refMyExcelData. Is there another possibility to refer to the ExcelActiveX-atom or to read the data out of the ExcelActiveX-atom and to write it into the Empirical Distribution-atom.

Thank you very much in advance.
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Empirical Distribution

Post by marlies »

Hi,

You should click the table within the excelactivex not the excelactivex itself. Did you define the tables within the excelactivex already?

See attached for a small example showing what I meant.

Regards, Marlies

PS Now I also see I said right click, but on the table you need to doubleclick to get the settings...
Attachments
20131010_Emperical_ExcelActiveX.mod
(5.63 KiB) Downloaded 303 times
Post Reply