queue attrib

Use this forum to post Vensim related questions.
Post Reply
LAUJJL
Senior Member
Posts: 1428
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

queue attrib

Post by LAUJJL »

Hi

The min function is still not working with the new version 5.4A. I cannot say if the quantity function is ok due to the definition which is highly imprecise.
Ïn the definition there may be more than one result, unless the quantity is cumulated starting with the oldest elements which is not told in the definition.
The function average is now working correctly but it is now the function in range that has strange results in my model.
Regards.

J.J. Laublé
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I am not sure what you mean when you say the QUEUE ATTRIB MIN and QUEUE ATTRIB MAX functions are not working. They seem to behave fine to me. QUE ATTRIB QUANTITY always works against the oldest elements in the queue - that is indeed not very clear from the documentation.

QUEUE ATTRIB IN RANGE counts the number of elements with attributes in the specified range (any age).

All these functions appear to be working correctly to me. If you could put together a simple example showing what seems to be the problematic behavior and describe this I would be happy to take a look.
LAUJJL
Senior Member
Posts: 1428
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Reply min attrib function

Post by LAUJJL »

Hi

I send a simplistic model for the attrib minimum function, the attrib in range needs more work because it does not work in a model more complicated and I have to transform it in a simple one.
The model shows a level of cars with no cars at the beginning running for 7 months, one car being added every month, for the three first months, no car is never sold. Every car is making 1000 kilometres every month.
In the model there is a graph table showing how is behaving the level number of cars, the age average, attrib average, max and min functions. The min function is behaving strangely as it always stay equal to 1000. But may be I have not understood something.
Regards.
J.J. Laublé
Attachments
essai_queue_attrib_min.mdl
(4.05 KiB) Downloaded 350 times
LAUJJL
Senior Member
Posts: 1428
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

queue attrib quantity

Post by LAUJJL »

Hi Bob

Here is the second simplistic model that deals with attrib quantity.
I use the same model with 1 car bought each month, no cars sold and
I have the graph table that shows number of cars, attrib quantity 1000, 2000 and 3000
That calculates the number of elements whose total attrib is equal to 1000, 2000 or 3000
starting with the older.

Here again there seems to be strange values as I have understood the function, but I am probably wrong,

At the beginning of year two, there is one car with one thousand kilometres, or the model
calculates that there is one car with total attribute with 1000 kilometres which is true, one
element whose total attribute is 2000 which is not true, unless it considers the stock at the end of the period, but even then it calculates that there is one element whose total attribute is 3000, which is never possible.

In year 3 , the function works properly for the three values.
In year 4, the function delivers real values, which is rather strange for a discrete function, but on top of that the results are strange.
The Value for 3000 is right, but the value for 2000 and 1000 seems strange with 0.666 as it should be normally 1 and 1, as there is a car that has 1000 kilometres and another one with 2000 kilometres.

In year 5, all the values are strange, the cars have respectively 2000, 3000 and 4000 kilometres and there is no car that has a total of attrib that is equal to 1000, one car whose total attrib is equal to 2000 and one car whose total is equal to 3000.

There is probably something that I miss in the definition of the function or in the definition of the attribute. There is no error in the check not in the units check.
I really do not understand what is happening.
Thanks for your help
John.
Attachments
queue_attrib_quantity.mdl
(3.94 KiB) Downloaded 339 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ,

Indeed there is a problem with the Min/Max functions when there is a 0 inflow. It treats that inflow as it it were relevant - that is why you always get 1000 in the first example. I will fix that for the next rev (a couple of weeks).

For the second one you really are looking for the QUEUE ATTRIB IN RANGE function not he QUEUE ATTRIB QUANTITY function. In your example the input quantity would have units Kilometer and if you put in say 5500 it would tell you how many cars you would need so that the odometers added to 5500, starting with the oldest car. If the oldest had 3000, the next 2000 and the next 1000 it would return 2.5 since only 1/2 of the 3rd cars 1000 km are needed.

The in_range function will tell you how many cars have odometer readings in a specific range which is, I am pretty sure, what you are after.
LAUJJL
Senior Member
Posts: 1428
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

answer attrib quantity

Post by LAUJJL »

Hi Bob

It is true that in my model, I do not use the queue attrib quantity but the queue attrib in range. Not using the attrib quantity, I do not mind really how it works, but it needs anyhow a much better definition. As to the queue attrib in range I will verify how it works with my full model and eventually send you something if it does not work.
Thank you anyhow for the answer.
Regards.
John.
LAUJJL
Senior Member
Posts: 1428
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

attrib in range works properly

Post by LAUJJL »

Hi Bob

I had an agerange of 17 instead of 18 in my model in the queue fifo attrib function, and the distribution of the attributes were wrong. This is why I thought the attrib in range was working strangely.
Regards.

J.J.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi JJ

Does this mean that you now think the function is working correctly? (Just want to be sure.)
Post Reply