Modeling a Shypping Bay

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
Spaggio86
Posts: 12
Joined: Sunday 16 March, 2014 - 15:15

Modeling a Shypping Bay

Post by Spaggio86 »

Hallo everyone, I'm an italian final year student doing an internship in a company in order to get my master's degree.

First of all I apologize if my english is not so good, secondly I would like to explain my problem.

My project aims to redesign the shipping bay of a big company. The bay i'm trying to simulate consist of 3 loading ramps and a single queue with a specific capacity. The queue is fed form many different sources representing many different kind of carriers with a specific inter arrival time and a specific charge to load (number of parcels). Another data i have already taken is about the service time of the loading ramps as the seconds needed to charge a single parcel.

It seems easy but I have two problem:
1) I need a source able to generate containers within a specific number of products (parcels).
2) I need a server able to express its service time as a function of the number of parcels within the containers. Just to give an example consider 30 seconds as the single service time to charge one parcel: if the carrier has 10 parcels inside, the final service time of the server results like 300 seconds, otherwise if the carrier has only 5 parcels the time begin 150 seconds instead.

It's possible to model that situation? Thanks in advance for all the answers.

P.S. In the site videos I saw a sample of a great shipping bay with a lot of trucks and many shipping docks but I didn't find that atoms or servers anywhere. Someone knows why?
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Modeling a Shypping Bay

Post by Nick »

Hi Spaggio86,

If you want to get familiar with ED (scripting) you can have a look at the tutorial 'A first start with 4DScript' available in the Help. The tutorial learns you the basics of the 4DScript programming language. You do not necessarily need to have any previous knowledge of other programming languages to understand this tutorial.

More specific, based on your questions you could have a look at:
Tutorials > A first start with 4DScript > Enterprise Dynamics scripting > Flow control

Good luck with your project!

Regards, Nick
Spaggio86
Posts: 12
Joined: Sunday 16 March, 2014 - 15:15

Re: Modeling a Shypping Bay

Post by Spaggio86 »

Thanks Nick for the suggest!! I have already read the basics tutorials but not the basics of 4Dscript. I didn't know it doesn't need a basic program knowledge. I'll try that and I hope to understand what I need to do.

If I can't accomplish my project I'll ask you again.. Thanks!!!
Spaggio86
Posts: 12
Joined: Sunday 16 March, 2014 - 15:15

Re: Modeling a Shypping Bay

Post by Spaggio86 »

All right!!! I have read the tutorial about 4D Script and I found a way to make the server as function of the different containers arriving. But I have a little problem...

The server is an assembler fed by a product source and different containers sources. The assembler has a BOM that explain the number of products to assemble depending on the name of the containers (given at the exit of the sources).
To link the name of the arriving container at the right column of the BOM I wrote this 4D Script text in the fill named "Column Reference b." of the assembler:

if(CompareText(Name(First(c)),[JYT]),1,CompareText(Name(First(c)),[GROUPAGE]),2,CompareText(Name(First(c)),[OUTBOUND]),3,CompareText(Name(First(c)),[INBOUND]),4,5)

With this statements if within other if i tryed to switch the container to the right BOM's column by reading their "name"
But it doesn't works!!!! It appear an error in the script.. I can't to understand why!!! Is it possible to make an if within an if? Could someone help me?

Thanks in advance!!!!!
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Modeling a Shipping Bay

Post by Nick »

Hi Spaggio 86,

Yes, it is possible to make an if statement within another if statement. This is called 'nesting'. However, an if statement only executes parameter (e2) if the statement is true. Similarly, the if statement only executes (optional) parameter (e3) if the statement is false. As a result it might happen that your if statement within your if statement is never evaluated.

In your case you want to evaluate multiple statements. To do so, you can use the function 'Case'.

Code: Select all

Case(
  InList( 
    Name(First(c)), 
    [JYT],
    [GROUPAGE],
    [OUTBOUND],
    [INBOUND]
  ) + 1, 
  5, 
  1, 
  2, 
  3, 
  4
)

For more information about the functions 'Case' or 'InList' please consult the Enterprise Dynamics help.

Regards, Nick
Post Reply