The model is very young and has hardly anything yet. The problem relates to a partitioned collection. Thanks!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)
Generated code error
-
- Senior Member
- Posts: 68
- Joined: Wed Sep 15, 2004 9:01 pm
- Vensim version: DSS
Generated code error
Another error. I expect that during my learning Ventity phase, there will be plenty of these, so I really appreciate your patience!
- Attachments
-
- RDem 07 With error related to Voter collection.zip
- (19.67 KiB) Downloaded 263 times
Re: Generated code error
Not sure what the problem is, but it's not the referenced count. Ticketed - hopefully devs will have an answer soon.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Generated code error
The error is defining the incumbent attribute as an integer 1 instead of a string "1". We'll catch this in the future.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Generated code error
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/