Cancel
Showing results for
Did you mean:

# Insert Paralogistic Distribution in Source

Valued Contributor

Der Community members,

I would like to set as interarrival time a paralogistic distibution with alpha = 1.8 and theta = 9.6

the list doesn not containg the paralogigic distribution, then how can i achieve this?

Thank you

13 REPLIES 13

# Re: Insert Paralogistic Distribution in Source

Siemens Phenom

Select the distribution type "Formula" and enter:

z_paraLogistic(self.RandomSeed, 1.8, 9.6)

Note: If you want to keep it simple, and if you want to speed-up the formula a little bit, you can always use the random number stream 1 in all formulas and Methods. So you can just write:

z_paraLogistic(1, 1.8, 9.6)

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.

# Re: Insert Paralogistic Distribution in Source

Valued Contributor
Hi Michael,
The formula works and I would like to ask also another question:
The entities can arrive in a batch of 1,2,3,4 or 5 pcs; assuming that in 50% of the cases they arrive as batch of 1 pc and in the other case the probability is the same (50% divided by 4), how can i insert this parameters in the source?

# Re: Insert Paralogistic Distribution in Source

Siemens Phenom

I uploaded a small example. I do not use a Source object. Instead I use a ParallelProc and create the parts via method. I named the user-defined method "init", so that it will automatically be called in the Init phase. The method will call itself for each batch to generate.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.

# Re: Insert Paralogistic Distribution in Source

Valued Contributor

Dear Michael,

I'm finding an issue with this approach:

the distribution is for seconds and i'm trying to transform it in minutes. Basically I multiplied it by 60, but it doesn't work:

`self.methCall(z_paraLogistic(1, 1.8, 9.6)*60);`

# Re: Insert Paralogistic Distribution in Source

Gears Esteemed Contributor

this is the wrong position for the multiplication; try this:

self.methCall(z_paraLogistic(1, 1.8*60, 9.6*60));

 Steffen Bangsowfreelance simulation specialist  web: www.bangsow.eumail: steffen@bangsow.net

# Re: Insert Paralogistic Distribution in Source

Valued Contributor
ok it's working, many thanks.
Can you just explain me why the number of cases in a uniform(1,2,10) is 8? It should create numbers from 2 to 10 and not from 2 to 9, right?

# Re: Insert Paralogistic Distribution in Source

Gears Esteemed Contributor

it creates real-values between 2 and 10 (each call results another value); if you store this values into a integer variable, the decimal places get lost, so you will never get 10

look also here:

http://community.plm.automation.siemens.com/t5/Plant-Simulation-Forum/Generate-a-random-integer-in-r...

 Steffen Bangsowfreelance simulation specialist  web: www.bangsow.eumail: steffen@bangsow.net

# Re: Insert Paralogistic Distribution in Source

Valued Contributor
Many Thanks

# Re: Insert Paralogistic Distribution in Source

Valued Contributor

I'm experimenting with this method and I would ask for a clarification:
at the beginning we insert a local variable called n

```is
do
-- generate an integer from 2 to 9 (including both 2 and 9)
local n: integer := z_uniform(1, 2, 10);```

then we set a rule that tranforms values from 6 to 9 in 1

```if n > 5 then  -- 6, 7, 8 and 9 will become 1
n := 1;  -- in 4 of the 8 cases (50% probability) we create 1 MU
end;```

At this point, we tell  the parallelproc to create an entity at the parallelProc location (self.~) and the number to be created is n.

```for local i := 1 to n loop
.MUs.Entity.create(self.~);
next;```

Now, suppose i want a different percentages. I want to create a uniform distribution that creates numbers from 1 to 213 and:

if the number created is beetween 1 and 124, it creates 1 entity

if the number created is between 125 and 186, it creates 2 entities

if the number created is between 187 and 203, it creates 3 entities

if the number created is between 204 and 210, it creates 4 entities

if the number created is between 211 and 213, it creates 5 entities

this new method should be:

```is
do
-- generate an integer from 1 to 213 (including both 1 and 213)
local n: integer := z_uniform(1, 1, 214);

if n < 125 then  -- 1-124 will become 1
n := 1;  -- in 124 of the 213 cases (58,22% probability) we create 1 MU
elseif n > 124 and n <187 then -- 125-186 will become 2
n := 2; -- in 62 of the 213 cases (29,11% probability) we create 2 MUs
elseif n > 186 and n < 204 then -- and so on
n := 3;
elseif n > 203 and n < 211 then
n := 4;
elseif n > 210 and n < 214 then
n := 5;
end;

for local i := 1 to n loop
.MUs.Entity.create(self.~);
next;

-- call this method again later to create the next batch
self.methCall(z_paraLogistic(1, 1.8, 9.6));
end;```

Is it right?