Matching results in time

Use this forum to post Vensim related questions.
Post Reply
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Matching results in time

Post by Phill »

In the attached simple extract from a model, I am trying to show the accumulation of bookings for a hotel over a month, for accommodation on the last day of the month. It’s a 31-day month, so there are 32 daily time steps to complete the run. During the month, overbooking is allowed, so the stock of bookings can exceed the number of rooms available by 10, but on the last day, the number of bookings must be reduced to match the number of rooms available. The reduction in numbers is split between ‘no shows’ (guests who simply don’t show up) and ‘walked’ guests (those who need to be accommodated elsewhere).

When I run this model, it correctly books up to a ‘Bookings’ stock of 135 (125 rooms, plus 10 overbooked) then this is reduced to the actual number of rooms (125) on Day=32. But to achieve this, the variable calculating the reduction in bookings has to be run when Time=31, the day before. The results then show that the 10 extra guests were removed the day before the date of booking. Is there a way to place these two results on the same time step, on Day=32?
Attachments
Test bookings stock.mdl
(3.73 KiB) Downloaded 172 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Matching results in time

Post by tomfid »

If it's strictly a display alignment issue, switching from Euler to Diff integration might do the trick (this just changes the storage alignment of stocks and flows).
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Re: Matching results in time

Post by Phill »

Thank you for your answer Tom. I tried it, but it isn't just a question of display, as I actually need a slightly different formula on the last time step to the previous ones and I'm trying to avoid nested 'IF, THEN, ELSE' statements. I need the stock to increase to an 'over inventory' level (if there is sufficient demand) during the run, then be corrected on the last time step so that the end value does not exceed the actual capacity. I think I might just have to love with the result that the adjustments and the final stock value appear at different time steps.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Matching results in time

Post by Administrator »

I'm finding it difficult to actually work out what is going on in this model. The IF THEN ELSE embedded within the Bookings means the diagram is very misleading as "booking rate" and "cancellations per day" are not actually the flows in/out of the stock.

Am I right in saying that this is looking at bookings over a month period? And there can be up to 125 rooms booked during that period? Or is it 125 maximum bookings per day?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Re: Matching results in time

Post by Phill »

Yes, the maximum stock is effectively 125, but can 'overstock' to 135, then needs to be corrected at the last time step. But why are incoming bookings not the flow to the bookings total?
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Matching results in time

Post by tomfid »

How about this?
Test bookings stock 2.mdl
(5.04 KiB) Downloaded 212 times
Phill
Senior Member
Posts: 156
Joined: Wed Jun 04, 2014 2:18 pm
Vensim version: DSS

Re: Matching results in time

Post by Phill »

Thank you both for taking the time to reply, you have been very helpful and certainly helped me to improve my modelling skills! I see now that my example was not 'clean' and I shouldn't try to cram the IF, THEN, ELSE statement into the stock but, instead, take the values of the accumulating stock as a 'feed' for the end of month 'Staying guests' and 'Walked guests' variables. This seems to work very well, Tom, thank you again.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Matching results in time

Post by tomfid »

Glad it's helpful! These discrete things are always tricky.

Another option would be to go to a sub-day time step (hourly?), but that might add a lot of computational burden.
Post Reply