Optimization subject to TIME/ Time as subscript?

Use this forum to post Vensim related questions.
Post Reply
arraywanted
Member
Posts: 36
Joined: Fri Aug 20, 2010 11:03 am

Optimization subject to TIME/ Time as subscript?

Post by arraywanted »

Hello,

I am trying to optimize a model simulating personnel planning over several years. Therefore I want to know the optimal amount of employees to be hired every year.

Since the Vensim optimizer can use constants only for opimization, a problem occurs. Obviously I don't want to hire the same amount of employees everys year. Instead I want to choose the optimal number depending on the time.

Is there any way to achieve this? My idea was to use subscripts, which means I would need TIME as a subscript, which doesn't work.

Is there a way to build vectors in Vensim? If it where Matlab I would simply write
NewEmployees[10 10 12 15 12]
as an example and use components of this vector for further calculations like
staff=staff+NewEmployees(timeX).
Is there anything similar in Vensim?

Any ideas? This is really important.

Thanks for your help.

[Edited on 8-20-2010 by arraywanted]
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

optipization subject to time

Post by LAUJJL »

Hi

To build vectors you must study the chapter 17 in the Vensim user guide about subscripts.
To optimize such a model, you have two solutions.
The best one is to build your model so that the number of employees each year is calculated automatically from the combination of different constants that represent generally the current way that is used every year to hire people, and then to optimize an objective function using these constants as optimization parameters.
Another way is to define the number of employees as a constant vector where the dimension of the vector is equal to the number of years of the simulation and to optimize directly with the constant vector an objective function. This method generally suppresses most of the feedback loops and to my opinion should be avoided although it works, because it does not represent how the reality works and it does not show the relation of the number of employees each year with the other variables of the model.
I think that before trying to optimize it is better to have a very good understanding of how your model works. Optimization is the last thing to do to find policies, and it does not necessarily provide 'The Solution' whch in fact does not exist.
Regards.
JJ
arraywanted
Member
Posts: 36
Joined: Fri Aug 20, 2010 11:03 am

Post by arraywanted »

Thanks for your answer.

I think the first option is more or less what I was trying to do until now. I took the constant that is used for further calculations - the "origin" - as optimization parameter. Exactly this parameter has to change depending on time, that's the crucial point. There is no way to include TIME in further computations to replace that.

I will try the other option, though.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

I think what JJ is suggesting (first option) is something like the following:

hiring = (desired employees - employees)/time to hire
desired employees = normal employees*(workload/normal workload)^staffing workload sensitivity

This is a closed-loop decision rule for hiring. You'd then use the optimizer to find the parameters time to hire, normal employees, and staffing workload sensitivity.

The second option might be implemented as follows:

TimeVec : (t1-t11)
IndicatedHiring[TimeVec] = 1,3,2,5,2, ...
Hiring = VECTOR LOOKUP(IndicatedHiring[t1],time,INITIAL TIME,FINAL TIME,0)

You then optimize to find the points of IndicatedHiring[TimeVec]. If the dimension of TimeVec is the same as the number of time steps, you'll get a unique hiring decision at each time step, though that much detail may not be needed.

The problem with the 2nd decision is that it's open loop, i.e. JJ's warning applies:

" This method generally suppresses most of the feedback loops and to my opinion should be avoided although it works, because it does not represent how the reality works and it does not show the relation of the number of employees each year with the other variables of the model."

Tom
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

optimization

Post by LAUJJL »

Hi every body

There are three reasons for not using the second method.

First the number of parameters is equal to the number of steps of the simulation. If they are high, the time to optimize will be high too. I once has such a model and as it had random exogenous data, I had to simulate about a hundred parallel simulations to make a valid optimization. Using the sedond method took a time that could not be managed. The first method uses few constants and is easy to optimize.

The second is that if one changes the time step, one is obliged to change the dimension of the array of constants, which means that the optimization is time step dependant which is not the case with the first method.

The third reason probably the more important is that the optimization is totally arbitrary and pure mathematics without any explanations relative to the real world. One is obliged to believe in the results without understanding them which is to my opinion dangerous.
Furthermore the coherence of the results between one another is not granted even if as a whole they optimize an objective function.
Regards.
JJ
Post Reply