Over Allocation

Use this forum to post Vensim related questions.
Post Reply
tomauro
Member
Posts: 41
Joined: Thu Mar 25, 2010 3:17 pm

Over Allocation

Post by tomauro »

Tom, Bob (or et al),

I'm having some trouble with the ALLOCATE AVAILABLE function. It seems to be overallocating...specifically it's duplicating demand for each supplier. If supply is infinite, each supplier will fill all the demand for each demander (i.e. if there are 3 suppliers, that will be 3 times as much as needed). Here is my formulation:

ALLOCATE AVAILABLE(Collects Allocated[Collect], R Pri Vector[Collect,ptype], Relay Capacity[Relay])

Collect has 5 subscripts and Relay has 3 subscripts. The quantities are generic volume (e.g. widgets). I can't simply lump supply together, since it's important what goes where and when. I can't predetermine the amount demanded by each Collect for each supply Relay...which would not only defeat the purpose, but Relay Capacity[Relay] can fluctuate. I've tried the FIND MARKET PRICE formulation, but it stops shy of allocating all demand, unless I "overdrive" PRICE by using FIND ZERO...which again, seems to defeat the purpose and I can't see what went where.

I've set this up in Excel in a series of matrices and the built-in solver allocates it fine based on the cascading constraints. This is actually a multi-level problem...I'm only showing one level here. I know I could just solve this in Excel, but it's always more elegant to not rely on external routines, software, etc. This seems simple enough...what am I doing wrong? Any examples would help.

Thanks in advance!

Lou
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Over Allocation

Post by tomfid »

Have you checked the example in the Help system, Ch. 4, Reference Manual, functions?

ALLOCATE AVAILABLE isn't designed for many-to-many situations (Relays -> Collects) so the behavior you're getting sounds right. I think we need to debug your FIND MARKET PRICE version.
tomauro
Member
Posts: 41
Joined: Thu Mar 25, 2010 3:17 pm

Re: Over Allocation

Post by tomauro »

Tom,

Here's a simplified version of my model. The Allocation One-Way view is the ALLOCATE AVAILABLE "attempt". The Allocation Two-Way view is the FIND MARKET PRICE "attempt". What I really need is to be able to get a many-to-many allocation between Problem->Collect and Collect->Relay. This is really very simple. I'm attaching my spreadsheet that shows the same formulation with the same quantities as in the model...solved using Excel's Frontline solver.

The essence of my problem is...I have multiple demanders wishing to process the same "goods" (in different amounts) on a number of suppliers' "machines" (in different capacities). Of course the amounts on both ends can vary. The Collect demand is grouped into two Problems P1 and P2. What I want out is (P1,C1)...(P2,C5) and (C1,R1)...(C5,R3). I've also got a calculation called Problem at Relay that is eseentially the equivalent of MMULT(Array1, Array2) in Excel that tells me (P1,R1)...(P2, R2). Any suggestions would be greatly appreciated.

Thanks again,
Lou
Attachments
Allocation Worksheet 28Mar12.xlsx
(16.61 KiB) Downloaded 228 times
Allocation Chain 19Mar12 Sanitized.mdl
(38.58 KiB) Downloaded 225 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Over Allocation

Post by tomfid »

This kind of problem can be pretty messy (which is why it takes an iterative solver, as in Excel). It would be very natural to solve as a linear program.

Mechanically, your model has 2 issues, fixed below. First, you're feeding in [problem,collect] tasks at the left, where it should probably be just [problem] dimensioned. As it is, the function is probably reading the wrong dimensions of the array, because you're feeding it 2D data where it's expecting 1D.

(Incidentally, FIND MARKET PRICE doesn't actually generate a demand x supply allocation matrix, because it assumes that the product is a commodity, and therefore that it doesn't matter which supplier serves which demander. However, you can generate one by assuming that each supplier serves a proportionate share of each demand.)

Second, to get full allocation, all of the demand priorities must equal or exceed the supply priorities (unless you're using the CES method, which I won't go into). You probably want to separate the Collect priority into two, one for the demand side and one for the supply side, because they're potentially different. (Example: c1 is desperate to solve problems, but the relays hate it and won't fill its orders.)

Third, in a two-level system like this, there's some extra accounting needed to differentiate between capacity and actual service. See attached.

If the problem gets any more complicated than this, it probably can't be solved with FIND MARKET PRICE, but FIND ZERO can be used to solve some tougher cases.
Allocation Chain 19Mar12 Sanitized-TF.mdl
(38.94 KiB) Downloaded 241 times
tomauro
Member
Posts: 41
Joined: Thu Mar 25, 2010 3:17 pm

Re: Over Allocation

Post by tomauro »

Tom,

Thanks so much! My main problem was not understanding that the successive priorities had to be >= to ones down stream. I think I even had a previous version of your cascading demand/supply that didn't work for that reason. Anyway, it worked like a charm after I re-integrated it into my full-up model. I actually just multiplied the proportion of Problem Demand Served by the Collect Supply to get the "cross-allocation". Of course, this is just the staighforward "sweeping" allocation explained by the graphical representation of the ALLOC P algorithm on the Vensim website. This doesn't "penalize" the allocation based on priority...so I was wondering if there was a way to do that. I'll think about it.

Meanwhile, I was trying to use the FIND ZERO function to allocate to a two-dimensional variable, like in my spreadsheet above...but I get a SINGULAR JACOBIAN error. See example attached. Another option I was considering was using the "hot link" feature with WS_DDE_REQUEST and WS_DDE_ADVISE to iterate with the Excel Solver at each SAVEPER. I'm sure this would be cumbersome if I could get it to work, so I'd much prefer to find a way to solve the 2-D cascading system in Vensim.

Again, thanks for your help! Have a great weekend...

Lou
Attachments
Generic Allocation Stage 1.mdl
(3.62 KiB) Downloaded 228 times
Post Reply