Is it possible to have subscripted structures draw from a common un-subscripted stock, and update the value of that stock during the current time step, so that subsequent subscripted structures in the same time step can use the update stock value?
For example:
A car parts store has a stock of 3 alternators (the common stock). Five customers come in at the same time needing the same alternator for their car (the car is the subscripted structure). Three will go home happy, but 2 will need to wait until the stock has been replenished.
The problem arises when I try to remove a part from the common stock using the subscripted structure. The subscript appears on the right hand of the equation, but not the left.
Thanks!
Common Stock with subscripted structures
Common Stock with subscripted structures
- Attachments
-
- simple_spare.JPG (58.3 KiB) Viewed 2915 times
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
the equation for part stock outflow should be
part stock outflow = SUM(parts replaced[part!])
you need to fix the equation for parts replaced - perhaps using ALLOCATE AVAILABLE - to prevent too many replacements given the common stock.
Also it would be good to add units to everything and do units checking.
part stock outflow = SUM(parts replaced[part!])
you need to fix the equation for parts replaced - perhaps using ALLOCATE AVAILABLE - to prevent too many replacements given the common stock.
Also it would be good to add units to everything and do units checking.
This worked, thank you! I replaced the equation for part stock outflow with the sum of parts replaced, as suggested.
I also updated the parts replaced equation using Allocate Available and a couple of other variables (needed to get a discrete output, since I can't withdraw 80% of a part). Seems to be working very well.
I learned a lot about the allocation functions in Vensim doing this, and it was very helpful. Thanks again.
I also updated the parts replaced equation using Allocate Available and a couple of other variables (needed to get a discrete output, since I can't withdraw 80% of a part). Seems to be working very well.
I learned a lot about the allocation functions in Vensim doing this, and it was very helpful. Thanks again.