Simio Forum

# TimeTables

## Recommended Posts

Hi again..

I have a different kind of a problem today. For example lets think that I am making a simulation about ferries. I have just 2 seaports to use and 2 ferries to use also. My ferry is taking possibly 40 cars per travel. And I want to control the ships to start traveling according to a table that I will create. For example the ferry must stop at the port at 9:45 until 10:00 and start traveling at 10:00. It takes again beetween 35 to 45 minutes for it to cross the sea and when it reaches to the port it must wait until its time will come for example 11:00 so that it can move again to the other port.

1) How can I make the ferry wait until the time in a table will come. for example my table can be

10:00 - 11:00 - 12:00 ...

Thank You

##### Share on other sites

If you model your ferry as a vehicle, I believe that the Dwell Time Type of Specific Time will work perfectly for this situation.

##### Share on other sites

I made what you said before but I could not assign the values in the table. For example I created a table which is like this

01:00:00

02:00:00

03:00:00

04:00:00

etc.

I assigned the table with right click to Dwell time and it gives me an error. Do you have any kind of examples so that I can see how to assign a table or which type? Thank you

##### Share on other sites

The Dwell time could be specified in many different ways depending on exactly what you want and where/how your data is specified.

For a simple example, presume that you always want to wait (dwell) until the top of the hour (e.g. xx:00). You could use the expression:

Math.Ceiling(TimeNow) - TimeNow

Since base time is in hours, this simply calculates the time remaining to the next integer hour.

For another somewhat simple case, if the change time for the current stop is stored in a column named GoTime in a table called MyStops, and the current row in that table points to the current stop, you would use the expression:

Math.Min(0, MyStops.GoTime - TimeNow)

which calculates the time remaining (if any) between the the schedule time and now.

If your current row does not point to the current stop, then you would have to put in an expression for the row number. For example if each row in the table corresponded to a stop of the same number and that stop was stored in a state named StopNumber, then you could use the expression:

Math.Min(0, MyStops[stopNumber].GoTime - TimeNow)

##### Share on other sites

I created a very basic, not quite fully functional, 'dwell time' model that calculates the dwell time based on how soon the next departure slot is according to Dave's 3rd example. I don't feel my approach is very elegant but maybe it can help get you started. It's at the following post:

Getting things to run 'on schedule' can be a bit tricky, especially when you start adding in the rules of what happens if you arrive late (do you miss the slot and wait for next departure, or now depart late?), if there's more activities to be done, etc.

##### Share on other sites

Thank you for your replies they were really useful. Especially the 3rd option was the best for my problem.