Generated code error

A place for Ventity software questions & answers
Post Reply
Jack Harich
Senior Member
Posts: 68
Joined: Wed Sep 15, 2004 9:01 pm
Vensim version: DSS

Generated code error

Post by Jack Harich »

Another error. I expect that during my learning Ventity phase, there will be plenty of these, so I really appreciate your patience!
Generated code at (577, 76) Cannot convert lambda expression to delegate type 'System.Func<string>' because some of the return types in the block are not implicitly convertible to the delegate return type (context: initializing; reference voter_by_politician_supported, in politician)
The model is very young and has hardly anything yet. The problem relates to a partitioned collection. Thanks!
Attachments
RDem 07 With error related to Voter collection.zip
(19.67 KiB) Downloaded 261 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Generated code error

Post by tomfid »

Not sure what the problem is, but it's not the referenced count. Ticketed - hopefully devs will have an answer soon.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Generated code error

Post by tomfid »

The error is defining the incumbent attribute as an integer 1 instead of a string "1". We'll catch this in the future.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Generated code error

Post by tomfid »

However, you wouldn't want to make the incumbent attribute "1" because there is no politician with that name. It should be "P1" or something to match your data. I tend to leave the attribute default expression blank and instead define it in the input data.
Post Reply