Loop counter: Is there a known bug?

Use this forum to post Vensim related questions.
Post Reply
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Loop counter: Is there a known bug?

Post by kaveh.dianati »

Hello,

I was wondering whether there are any known bugs related to the Loops counter feature in Vensim (I'm using Vensim Professional for Windows Version 6.3D (x32)).

The reason I ask has to do with the two models attached. The two models are identical, except for one link. In version 2, I have added one additional link (from variable 'growth in real house prices' to variable 'change in real private rents'. See View No. 4).

When I compare the number of loops going through the stock variable Real House Prices (in View 1), version 1 shows 640 loops but version 2, in which 'Real House Prices' is linked to 'Real Private Rents', shows only 10 loops. I would expect that adding this additional link would actually increase the number of feedback loops in the model, or at least certainly not reduce them. However, the number of feedbacks going through Real House Prices is suddenly reduced by a factor of 64!

This seems like perhaps a bug to me. It would be great if you could please have a look.

Many thanks,
Kaveh.
Attachments
Loop_Counter_v2.mdl
(110.95 KiB) Downloaded 352 times
Loop_Counter_v1.mdl
(110.93 KiB) Downloaded 344 times
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

Nobody has reported any bugs. Looking at the output, all seems fine to me.

I guess you could take a sample of the 640 loops and see if these are no longer active.
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
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: Loop counter: Is there a known bug?

Post by kaveh.dianati »

Thanks for your reply.

I did compare the loops and it looks like the version 2 model is no longer reporting the vast majority of loops. Any idea why this might be the case?

Thanks for your help.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

Can you give me an example of one that is not being reported and I'll look into it.
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: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Loop counter: Is there a known bug?

Post by tomfid »

I agree - there has to be a bug. Adding a link can't possibly make the loop count go down.

I think the issue might be spurious loops in the larger set though.
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: Loop counter: Is there a known bug?

Post by kaveh.dianati »

One example that is reported in v1 but not in v2 (while it exists in both):
Loop Number 8 of length 7
Real House Prices
real average deposit
average deposit to income ratio
relative average deposit to income ratio
number of new mortgage advances per year
real new mortgage advances
growth in real new advances
change in real house prices

Many more examples like it of loops not being reported.
Would the bug have to do with my version of Vensim, you think or would all versions report the same 10 loops for the v2 model?
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

ok, I've found the issue.

Internally in Vensim there is an upper limit on the maximum depth of any loop (the value is 32). Anything above this is ignored.

I'll add it to the to-do list to allow this limit to be user configurable.
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
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

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
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

The help system does mention this as well.
https://www.vensim.com/documentation/23840.htm
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
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: Loop counter: Is there a known bug?

Post by kaveh.dianati »

Thanks for this.

I'm not sure if that explains the issue I've reported, though. The 32-rule does not explain why the number of reported loops would go down from 640 to 10 by adding one link.

Also, the loop I gave as an example, for instance, which is not reported in v2 has a length of only 7. Many more examples like it.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Loop counter: Is there a known bug?

Post by Administrator »

I've run it here with a limit is 32000 (instead of 32).

I cannot confirm just yet, but it looks like if Vensim finds a loop over 32 in depth when searching a particular parameter, it stops searching and moves onto the next variable in the list (which is incorrect, it should keep searching in case there is another less than 32 in length).

I'll take a proper look at the code as soon as I get the time.
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
kaveh.dianati
Senior Member
Posts: 50
Joined: Tue Dec 15, 2015 1:52 pm
Vensim version: DSS

Re: Loop counter: Is there a known bug?

Post by kaveh.dianati »

Thank you very much for looking into this!
Post Reply