Modeling the incoming of ships problem

All topics specific to modeling questions in Enterprise Dynamics
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear Josie,

Thank you very much in advance. I have managed to get a table working on the overdraaien atom. Based on labels i am trying to make the functions work at the moment ( instead of using comparetext functions). I am looking forward to your view on the subject. and help on my current problem.

thank you,
Dennis
Josie
Posts: 31
Joined: Friday 30 December, 2011 - 09:40

Re: Modeling the incoming of ships problem

Post by Josie »

Dear Dennis,
Please find attachment the example model.
I made changes to your original model. Besides codes, statistics about the product quantity has been altered by me so as to test the model. But this is just for model testing, you need to change them back...

Main Changes are in "Overdraaien", input Strategy.
Important points:
1, Use CreateEvent on Overdraaien to evaluate the instrategy,
2, Better to use openinput/closeinput than openallinput/closealloutput.


KR,
Josie
Attachments
Communitymodel_changed.mod
(82.62 KiB) Downloaded 316 times
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear Josie,

thank you for the fast reply. I am going to look at the model right now. I don't fully understand it yet, but i hope to get everything working with this information. In my version your updated model keeps having errors:

1479 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\sink_Resized.wrl does not exits. (KernelFnc)
1480 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1481 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)
1482 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1483 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)
1484 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1485 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)
1486 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\sink_Resized.wrl does not exits. (KernelFnc)
1487 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\sink_Resized.wrl does not exits. (KernelFnc)
1488 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1489 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)
1490 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1491 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)
1492 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\source_Resized.wrl does not exits. (KernelFnc)
1493 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\source_Resized.wrl does not exits. (KernelFnc)
1494 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\source_Resized.wrl does not exits. (KernelFnc)
1495 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server_Resized.wrl does not exits. (KernelFnc)
1496 4DScript:error at "AddModel3D":File Q:\00002991.UK2\Media\3DModels\Server2_Resized.wrl does not exits. (KernelFnc)

And when i reset the model:
1497 Time: 0 Atom: Initialize34 (ID=39595), OnReset>Compile error: "Product3" is not a valid expression. Reference: Product3

Therefore it crashes somehow. I am going to try to get this working in the full version of the model which has more products and silo's. I will get bakc to you wioth that model after some experimentation
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear Josie,

Thank you very much for the help. The system is working better already. I have a few more small questions. First while running the model, the time stops at some points. I think this has something to do with the checking functions you build in but cant seem to find out why.

Secondly, the silo's only get topped up to their upper level. They should be filled completely to the maximum when overdraaien becomes active. But overdraaien should only become actiove below a certain level. E.g. When product1 reaches below 250 tonnes, it is filled completely up to 318 tonnes if there is a product in the storage silo's and no ship waiting/unloading.

I have put some parts of your code into my full scale model. I have uploaded this model on the server to so you can have a look at the full version. Additionally i tried to work with more labels and codes for better understanding and readability.

In the full version you can see there are 8 different products with each their own factory silo. There are 29 storage silo's that can be used for all products.

The last thing i want to do is build in a fail safe. The factory silo's should never run out of products, because then the factory would have to stop producing. Therefore whenever there is need for a product but there is none in the storage silo's, it should be delivered by trucks. Trucks deliver within 3 hours and deliver a quantity of 30 tonnes. These should be via an extra source connected directly to the factory silo's.

I hope you have time to look at the full scale model again, because i really need to get this working.

Thank you for all the help already and if you have questions or anything please let me know.

Kind regards,
Dennis
Attachments
scheepsaankomstcommunity.mod
full model
(271.2 KiB) Downloaded 304 times
Josie
Posts: 31
Joined: Friday 30 December, 2011 - 09:40

Re: Modeling the incoming of ships problem

Post by Josie »

Dear Dennis,

I have put a stop in "Input Strategy" of "Overdraaien" because it is needed to check whether the system work as intended. You can remove it from the line 25.

Secondly, the silo's only get topped up to their upper level. They should be filled completely to the maximum when overdraaien becomes active. But overdraaien should only become actiove below a certain level. E.g. When product1 reaches below 250 tonnes, it is filled completely up to 318 tonnes if there is a product in the storage silo's and no ship waiting/unloading.
Change the level setting of "Up to upper level" or change the upper level.

The last thing i want to do is build in a fail safe. The factory silo's should never run out of products, because then the factory would have to stop producing. Therefore whenever there is need for a product but there is none in the storage silo's, it should be delivered by trucks. Trucks deliver within 3 hours and deliver a quantity of 30 tonnes. These should be via an extra source connected directly to the factory silo's.
What problem have you encountered?

KR
Josie
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear Josie,

The simulation is near to completion. I have added the incoming trucks from another source (they come in whenever there is a desperate need for a product). The only thing is that the codes does not yet select the right factory silo. Overdraaien atom works, but it sometimes keeps filling a factory silo which is nearly full while another one is almost empty. It should always chose to fill up the lowest content one first. I cant find why it is doing that.

Secondly i keep getting an error from the initialize atom. The same error occurs in the system you provided earlier:
13 Time: 0 Atom: Initialize106 (ID=322), OnReset>Compile error: "Zonnepitschroot" is not a valid expression. Reference: Zonnepitschroot (KernelFnc)

Everytime you reset this error occurs. It doesnt matter, but is kind of annoying. Maybe you know why it occurs?

Another quick question by the way. I have putted the emergancy incoming trucks on channel four of the factory silo's. These should only open if the content of the factory silo reaches a critical point. but i think the actually open at other times due to the level settings. Therefore i put a close function in the onexit event en 500 seconds on the process time of the server. Does this work or is it still delivering trucks while this is not needed?

I have added the completed model up to date now. Please take a look at it i hope you can find the missing error why overdraaien does not always fill up the lowest level factory silo.
Attachments
scheepsaankomstcommunity.mod
(283.96 KiB) Downloaded 296 times
Josie
Posts: 31
Joined: Friday 30 December, 2011 - 09:40

Re: Modeling the incoming of ships problem

Post by Josie »

Dear Dennis,

The only thing is that the codes does not yet select the right factory silo. Overdraaien atom works, but it sometimes keeps filling a factory silo which is nearly full while another one is almost empty. It should always chose to fill up the lowest content one first. I cant find why it is doing that.
In the factory silo, you need to update the table of Overdraaien by checking the first column of that row: "cell(count,1,in(3,c))=2," (It's in the exitTrigger of every factory silo. ) But you didn't change the 2 to corresponding numbers that ranges from 1 to 8 representing the 8 factory silo.

Secondly i keep getting an error from the initialize atom. The same error occurs in the system you provided earlier:
13 Time: 0 Atom: Initialize106 (ID=322), OnReset>Compile error: "Zonnepitschroot" is not a valid expression. Reference: Zonnepitschroot (KernelFnc)

I don't have this problem running your model. But what you can do is to recheck it by using the function of ED "find string or atom", the button is beside the question mark in the menu.

Another quick question by the way. I have putted the emergancy incoming trucks on channel four of the factory silo's. These should only open if the content of the factory silo reaches a critical point. but i think the actually open at other times due to the level settings. Therefore i put a close function in the onexit event en 500 seconds on the process time of the server. Does this work or is it still delivering trucks while this is not needed?
From the factory silos side, it is ok to open and close the input channel. But since in the server before, products are trapped in the server, how do you know that the incoming product from the server to factory silo is the product that you want to fill the factory silo? I mean eg. if the product is Mais but you need to fill Soya silo, the Mais product will not go to Soya at all.

KR,
Josie
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear Josie,

I have changed the code now but still it is not working properly. I dont know why but sometimes it keeps filling the wrong silo's. Maybe something is wrong in the code to sort the table or something but i cant find it.

Concerning the other two points. First the error doesnt do anything, but it is annoying thats all. If everything is working i will look into why it is doing that, otherwise i will just let it be.

For the incoming trucks i think i need to put some code in the onexit of the server. It doesnt matter which silo it wil fill up with 30 tonnes since it can basically be any truck until it enters a factory silo.
Therefore i need to put some code like if out channel is 1, set(name(i),[Gerst]),set(color(i),colorblue).

Or something alike. So the truck gets specific at the point it leaves the server or enters the factory silo. Before that it is just a truck with undefined load.

Can you please look into the overdraaien atom again. I think we are very close and i really want to thank you for all the help you provided so far.

Thank you in advance,
Dennis
Attachments
scheepsaankomstcommunity.mod
(284.58 KiB) Downloaded 329 times
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

Dear community,

Is anybody looking at this problem? I have deadlines coming up, which are really getting close. I want to use this model in the upcoming deadline, but since overdraaien is not working yet i cant. I think it is so close to perfect, but the final adjustments to get everything working properly have to be completed still.

I thank you for all the help already,

KR,
Dennis
DennisvLankeren
Posts: 21
Joined: Monday 23 April, 2012 - 15:20

Re: Modeling the incoming of ships problem

Post by DennisvLankeren »

i think iu have found one mistake in the code. In the atom of overdraaien, this code:

Code: Select all

 repeat(
  nroc(c),
   if(
    ICopen(1,out(count,c)),
    Do(
     cell(count,4,c,1):=1,
     valFactorySiloChannel:=cell(count,1,c,1)
    ),
    cell(count,4,c,1):=0
   )
 ),
Should be:

Code: Select all

 repeat(
  nroc(c),
   if(
    ICopen([color=#FF0000]2[/color],out(count,c)),
    Do(
     cell(count,4,c,1):=1,
     valFactorySiloChannel:=cell(count,1,c,1)
    ),
    cell(count,4,c,1):=0
   )
 ),
Furthermore there is something wrong with the content signal to the table. If you look in the table during some parts of the simulation, the given content does not match the amount truly in the factory silo. EG if Gerst is full it can say Gerst only has 20 tonnes in it.

I am still looking why this is hapening.

If you can find anything please let me know.

Thank you all in advance.
KR,
Dennis
Post Reply