

coder.extrinsic('randi');
persistent init;
if isempty(init)
  init = true;
end
% time between orders in hours
res = 1.0;     % define type
if init
  dt = tW;
  init = false;
else
  res = randi(tMax - tMin + 1);
  dt = (res + tMin - 1)/3600;
end
              coder.extrinsic('randi');
entity.Product = randi(nProd);
entity.Distributor = randi(3);
              









idx = find(prodTypes == entity.Product);
entity.Product = idx(1); % idx could be a vector













 t PIn OIn   Lager    POut  OOut(P)  OOut(F) Bemerkung
----------------------------------------------------------------
 7      2   0/0/0/0                          delayed bis 24, E1
10  2       0/1/0/0
12  4       0/1/0/1
14      3   0/1/0/1                          delayed bis 24, E2
20  1       1/1/0/1
21      1   0/1/0/1    1
24  3       0/1/1/1
                           1/2/3/4  1/2/1/2
                             2/3      2/1        E1/E2
28      4   0/1/1/0    4
30  2       0/2/1/0
35      3   0/2/0/0    3
36  3       0/2/1/0
40  2       0/3/1/0
42      4   0/3/1/0                          delayed bis 48, E3
48  3       0/3/2/0
                           1/2/3/4  1/2/1/2
                             4        2         E3
49      1   0/3/2/0                          delayed bis 72, E4
50  1       1/3/2/0
56      2   1/2/2/0    2
60  4       1/2/2/1
    1       2/2/2/1
63      2   2/1/2/1    2
70  2       2/2/2/1
        1   1/2/2/1    1
72  3       1/2/3/1
                           1/2/3/4  1/2/1/2
                              1        1         E4
              



