First question.
Concerning the two last questions on the Vensim and SD forums about the C compiler, I went to the MSDN microsoft web site and found a Visual C++ .NET 2003 Standard compiler sold at 109 $. Is it the right C compiler to use?
Second question about the general use of C with external functions in Vensim models.
The Vensim language is not procedural and it is sometimes very tricky to program some logic that is very easy to program in any procedural language.
For instance to program a loop that works during a time step, it is generally necessary to build an array with a dimension equal to the number of loops and to loop accross all the dimension of the array.
I have so far managed not to use an external function.
So the question is: to what extent is it preferrable to stick to the Vensim environment at the cost of more tricky programmation and less understandability
and at the advantage of an unified tool?
Is it common among the Vensim experienced users, dealing with relatively complex models, to use external functions?
Regards.
J.J. Laublé
question about the c compiler
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
To answer the second question - if you have a procedure that is very hard to do in Vensim and would be easy to do in a program language it is best to use an external function. The biggest stumbling block in this is the ability to program functions and the biggest drawback the inability to share your model without also providing the external function.
As to compilers the standard C++ compiler will probably be fine if the function is not compute intensive. Last time I looked, however, the standard (as opposed to professional) did not have code optimization available so things will run a little bit slower.
As to compilers the standard C++ compiler will probably be fine if the function is not compute intensive. Last time I looked, however, the standard (as opposed to professional) did not have code optimization available so things will run a little bit slower.