By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

Simulation Programming Skills and Python

P: n/a
Hello all. I have a few questions about simulation programming. One, do
all programmers know to how to code a simulation? By simulation I mean a
model of real world relationships (i.e. like Civilization which is a
simulation of ruling nations through various historical settings). For
example, could someone who codes word processing application necessarily
know how to do a simulation of economic relationships between banks and
enterprises if he/she had access to an economist? Is the skill of being
able to translate in one's head realworld relationships into a model
represented by code an inherent/native skill of all programmers? Two, is
Python a good language for simulation programming?

Thank you all!

- Richard Blackwood
Mar 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Object oriented languages lend themselves fairly well to this sort of
modeling, and a strong programmer in any language should be able to
take a good description of a well thought-out model and write some code
for it.

However, by far the harder part is designing a good model. Asking
whether all programmers are capable of that is sort of like asking
whether all carpenters are architects.

As for Python, it's a good language for prototyping. The development
cycle moves very fast, so one can experiment with many different ideas
more quickly than in Java or C++. The price, however, is execution
speed. There are extension modules like the scipy suite which can
reclaim some lost speed, but Python will generally be slower than
compiled languages.

Mar 6 '06 #2

P: n/a
Richard Blackwood:
Is the skill of being able to translate in one's head realworld relationships into a model represented by code an inherent/native skill of all programmers?<
I don't think so. Creating a good computational model can be a complex
art.

Python a good language for simulation programming?<


It depends on the type of simulation. Python can be good to create a
prototype of the simulation program, and it can be good if the
simulation doesn't require much number crunching that cannot be
vectorized :-)
If the simulation require a lot of number crunching, but such
operations can be done with Numarray and the like, then you can
probably use Python or Mathematica, or similar systems.
Otherwise you may need a hybrid program (Python + Pyrex, Swig, or f2py,
ShedSkin, etc).

Bye,
bearophile

Mar 6 '06 #3

P: n/a

Richard Blackwood wrote:
Hello all. I have a few questions about simulation programming. One, do
all programmers know to how to code a simulation? By simulation I mean a
model of real world relationships (i.e. like Civilization which is a
simulation of ruling nations through various historical settings). For
example, could someone who codes word processing application necessarily
know how to do a simulation of economic relationships between banks and
enterprises if he/she had access to an economist? Is the skill of being
able to translate in one's head realworld relationships into a model
represented by code an inherent/native skill of all programmers? Two, is
Python a good language for simulation programming?

The 2nd question is easy: python is excellent for your purpose, you'll
find lots of examples googleing for "python discrete event simulation",
http://simpy.sourceforge.net/

libs for linear algebra, statistics /probability / sampling, OR
algorithms, (both native libs and hooks to C/Fortran libs like GSL,
LAPACK etc.

The 1st question is open-ended, it's kind of like asking are
mathematicians good at music by disposition on average? (or something
like that) When you're modeling a knowledge domain with a developer
who doesn't master the details of the domain, you have to have
incredible specifications and testing, at all levels of the model

Thank you all!

- Richard Blackwood


Mar 6 '06 #4

P: n/a
On Mon, 06 Mar 2006 10:48:46 -0500, Richard Blackwood wrote:
Two, is
Python a good language for simulation programming?


Civilization 4 is (partly) written in Python. I suppose they thought Python
was a good language for that. I said partly because as far as I know some
code is C++ for speed reasons.

--
USB Priests for only 10$
Mar 7 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.