ALLOCATE BY PRIORITY - problems with managing allocations

Use this forum to post Vensim related questions.
Post Reply
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Dear,
I cannot manage to model correctly the ALLOCATE BY PRIORITY function for what I want to do, I hope I'll manage to make it clear and you'll be able to guide me...

I would like to model the human resources allocation for several buildings, depending on the operations (renovation and/or maintenance) I have to do on each building, only if I have a sufficient human resources stock.
I have 5 buildings such as :
[building]=A,B,C,D,E

I want to operate on those buildings according to 3 different scenarios :
operation scenario=4, 5 or 6 (depending on renovation(4), maintenance(6), or renovation+maintenance(5))

I calculated the quantity of human resources necessary for the buildings operations, such as :

HR demand[building,workforce type]=hours (with [workforce type]=manager, technician, support)

So I obtain something like this :
Time (Month) 0 1 2
HR demand (hours/month)
[bâtA,manager] 269,10 57,92 57,92
[bâtA,technicien] 577,20 273,78 273,78
[bâtA,support] 167,14 150,43 150,43
[bâtB,manager] 96,72 25,74 25,74
[bâtB,technicien] 280,11 121,68 121,68
[bâtB,support] 66,86 66,86 66,86
[bâtC,manager] 95,68 20,59 20,59
[bâtC,technicien]
[bâtC,support]
[bâtD,manager]
[bâtD,technicien] AND SO ON
[bâtD,support]
[bâtE,manager]
[bâtE,technicien]
[bâtE,support]


My first question is :
is it possible to obtain the results under the form : HR demand[building]=(manager,technician,support) ==> Here would be for instance HR demand for building A = (269.10,577.20,167,14) at Time=0.

This would be useful for me in order to compare the scenarios of every building to a total stock (Total stock of human resources=(1 manager,5 technician,2 support) for instance), and select the buildings I can operate considering the overall human resources available. I defined a scenario priority, ranking the buildings according to the operation demand (maintenance (score=6) has priority over renovation (score=4) ). This works well. The problem is that when I want to allocate HR, it occurs directly on the [workforce type], not on a building selection. Here is what I obtain for example :
Time (Month) 0 1 2
allocate ?[type d'effectif,bâtiment]
allocate ?
[manager,bâtA] 0 4.123 4.123
[manager,bâtB] 156 19.49 19.49
[manager,bâtC] 0 10.71 10.71
[manager,bâtD] 0 0 0
[manager,bâtE] 0 121.7 121.7
[technicien,bâtA] 477.5 273.8 273.8
[technicien,bâtB] 167.1 150.4 150.4
[technicien,bâtC] 80.02 25.74 25.74
[technicien,bâtD] 0 121.7 121.7
[technicien,bâtE] 55.31 66.86 66.86
[support,bâtA] 66.27 147.2 147.2
[support,bâtB] 96.72 25.18 25.18
[support,bâtC] 111.1 119 119
[support,bâtD] 0 0 0
[support,bâtE] 37.94 20.59 20.59


buildingB has the biggest score (6) and should have priority over all other buildings.
So I would like it to be selected, and compare its HR demand to my total HR stock (here Total stock of human resources=(1 manager=x hours/month,5 technician=y hours/month,2 support=z hours/month) ).
Then if HR demand[building,workforce type] < Total stock of human resources[workforce type], I take it off the Total stock of human resources, and compare the next scenario to this new Total stock of human resources[workforce type]. This way, I would like to allocate nothing to the buildings I don't have the HR for.

Do you have any idea how I could model this in order to compare and take off the HR "building after building" ?

Thank you a lot in advance !

Laura
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

Can you upload the model you are testing with? Looking at tables of numbers makes it really difficult (and time consuming) to try and figure out what is wrong/right.
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
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Thank you for your answer, you'll find the model in attachment !
Attachments
équivalent tâches 5.mdl
(10.26 KiB) Downloaded 211 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

The allocate functions work over the last subscript, in your case, this is "workforce type". But in this case, I think you need to reverse the order of the subscripts to do what you need.

So something like the following.

hr allocated[workforce type,building] = ALLOCATE BY PRIORITY(
working[workforce type,building]
, priority rank[building]
, ELMCOUNT(building)
, 1
, "total available time hours/month"[workforce type] )

This will allocate "total available time hours/month" to each building depending on the priority and "working" parameter.
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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by tomfid »

Check the sample model in the Help system. If you can't find it because the OS has locked it down, look in the Vensim install directory (C:\Users|Public\Vensim on Windows) for Models\FunctionExamples\ALLOCATE AVAILABLE.mdl etc. Or see http://vensim.com/documentation/fn_allocations.htm
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Thank you for your answer, it's kind of working !
But still there is something I don't manage to do.

I would like to delay(cancel) operations for which I don't have the right amount of HR. The output I ideally would like to obtain from ALLOCATE BY PRIORITY is "buildingB" if I only could provide HR for 1 project, or "buildingB, buildingC" if I've got enough HR for 2 projects, and so on... in order to start the acceptable projects, while the other projects are cancelled (and re-computed with another scenario, eg maintenance).
For now the function is okay for buildingB : the right amount of HR is allocated. ==> building(allocated/demand) = B(35.1/35.1 , 280.1/280.1 , 66.86/66.86)
But then the HR are "spread" over buildings A, C and E. For instance : A(35.1/269.1 , 296/577.2 , 145.2/167.1)
(The good new is that D was not allocated at all, which much what I would like to represent). I guess this is because they have the same "score" in "priority rank" (= 6).
But if I only use a simple ranking (from 1 to 5 like in "primary scenario), the ALLOCATION doesn't work anymore.

I put the new model version in attachment.

Thank you !

Laura
Attachments
équivalent tâches 6.mdl
(10.53 KiB) Downloaded 208 times
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by tomfid »

You might read through http://vensim.com/documentation/allocation_overview.htm if you haven't already.

The basic problem may be that you really need an integer program to do this.

However, as long as (a) priorities are distinct, and (b) the width parameter is less than the difference between priorities, the allocation will sequentially "fill up" projects. However, even in that case, the last project to receive staff may only get a partial allocation.

You could potentially accomplish something similar using the VECTOR SORT/RANK functions and IF THEN ELSE logic.
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Hello,

I'm again in trouble with the ALLOCATE BY PRIORITY function ! I managed to do what you advised me earlier, in the previous messages of this topic. I thought it worked well, but I realize that in this configuration, the allocation of time for every building was compared to the total time available, and the human resources allocation ended way above the total time available when I expected the sum of time allocation per building = total time available. I'm not sure that's clear... anyway, I tried to do it another way and I wrote :


allocate time[building,task type,workforce type]=
ALLOCATE BY PRIORITY(HR demand[building,task type,workforce type],priority rank\
[building,task type,workforce type], ELMCOUNT(workforce type)*ELMCOUNT(buildings\
)*ELMCOUNT(task type), 1, available time[building,task type,workforce type\
])
~
~ |
HR demand[building,task type,workforce type]=
HR demand 1[building,task type,workforce type]
~
~ |

priority rank[building,task type,workforce type]=
VECTOR RANK(invert[building,task type,workforce type], 1)
~
~ |
Here, several HR demand[building,task type,workforce type] will have the same priority rank (1, 2 or 3) : is that a problem for the allocation ?

available time[building,task type,workforce type]=
"total available time hours/year"[workforce type]*importance[building,task type\
]
~
~ |
I get the error message : Last 1 subscripts on LHS restricted to vector arguments on RHS
What does this mean please ?

Thank you for your help !!

Laura
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

Can you upload the model?
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
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

I'm sorry, the model I'm working on is a terrible mess as I'm trying many different things to make it work...
But I isolated the variables involved in the view 5, I hope it will be okay for you to work with this...

Thanks a lot,

Laura
Attachments
fusion des modèles 16 forum.mdl
(90.09 KiB) Downloaded 209 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

The error message is very misleading here and does not really help.

The problem is with the parameter in red here.

ALLOCATE BY PRIORITY (
hr demand[batiments,type de tache,type d effectif]
, priority rank[batiments,type de tache,type d effectif]
, total subs
, 1
, available time[batiments,type de tache,type d effectif]
)

This needs to be subscripted by "batiments,type de tache", "not batiments,type de tache,type d effectif" as you are allocating to the "type d effectif" array.
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
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

It effectively computes something !
But now I have a floating point error message computing allocate time at time 1, whenever using total available time hours/year or available time as the supply stock.
Once again, I don't know what this message means in my situation, do you have any idea about what I'm supposed to do or where this error comes from ?

Thanks
Attachments
fusion des modèles 16 forum.mdl
(88.93 KiB) Downloaded 207 times
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

In attachment the same model using available time !

Thanks
Attachments
fusion des modèles 16 forum 3.mdl
(88.95 KiB) Downloaded 203 times
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Okay, I found the solution !

ALLOCATE BY PRIORITY (
hr demand[batiments,type de tache,type d effectif]
, priority rank[batiments,type de tache,type d effectif]
,elmcount(type de tache)
, 1
, available time[batiments,type de tache,type d effectif]
)

This works !!

BUT there is still something I cannot explain : at time 1, if you look at the time allocated to the "support" workforce type, you can see :
total available time hours/year[support] = 1833 hours
sum demand 1 at time 1 [support] = 1444 hours
sum allocated [support] = 1418 hours

Why only 1418 hours allocated over 1444 hours when 1833 hours are available ? Would you have any idea about what is going wrong ?

Once again, thank you a lot for your help !

Laura
Attachments
fusion des modèles 16 forum 4.mdl
(89.76 KiB) Downloaded 195 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

Can you upload the spreadsheet that goes with the model so I can test?
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
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Here we go !
Attachments
Tableur données2.xlsx
(52.24 KiB) Downloaded 193 times
Location4.xlsx
(12.29 KiB) Downloaded 200 times
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

I hope this is what you were talking about :)
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

Missing "COUTS RENO.xlsx" as well.
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
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Oops, sorry !
Attachments
COUTS RENO.xlsx
(13.34 KiB) Downloaded 131 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by Administrator »

I'm not sure you understand how the allocation functions work.

In this case, it allocates "sum available[batiments,type d'effectif]" to "hr demand[batiments,type d'effectif,type de tâche]". The function runs for every element of "batiments" and "type d'effectif". So what you need to compare is

sum available[batiments,type d'effectif]
to
SUM ( allocate time[batiments,type d'effectif,type de tâche!] )
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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by tomfid »

There are sample models for all the ALLOC functions in the Help system.
oOLauraOo
Member
Posts: 41
Joined: Wed Mar 22, 2017 5:05 pm
Vensim version: PRO

Re: ALLOCATE BY PRIORITY - problems with managing allocations

Post by oOLauraOo »

Yes, you're right, thanks !

Laura
Post Reply