How do you profile / optimize a modeling tool?

In the past and intermittently, I have now used modeling tools such as Easy Java Simulations and NetLogo .

They are great tools for visually modeling various math / comp-sci concepts since "all you have to do" is write a simulation loop - graphics, etc. processed for you.

However, one thing I noticed is that improving runtime / speed of modeling is extremely difficult with tools like this, because the guts of the implementation are hidden beneath the surface.

There is usually excellent documentation on how to use the simulator tools, but I haven't found anything to improve the runtime.

For example, let's say you implement the Newton method to find roots. This is a straight forward algorithm, but depending on

  • the type of graphic attachment used, or
  • various other different options.

the simulation will run at different speeds.

Is there a way to determine the "optimal" display of the simulation data?

I think of this in the case of using such a tool for teaching modeling / scientific programming classes.

+1


source to share


3 answers


If all else fails, you can use a combination of these two approaches:

  • Let's assume an environment: ask yourself how you will implement your functions, and then deduce which function is likely to require the least computational work.
  • Trial error: just compare different methods by testing them. This is a big help if the environment has some way to keep your code in sync, like a function that (exactly) tells you what time it is.


Don't forget about effects like caching and memory optimization. If you try to use a specific function in a specific context, it may work differently with your previous experience.

+1


source


You can try using the Repast Symphony modeling toolkit . It is a mature, free, open source programming environment with many useful features. You can integrate Repast with Eclipse, which has a profiling plugin .



+3


source


In Netlogo you can use the Profiler extension

    extensions [profiler]

See the profiler documentation on the netlogo home page

+2


source







All Articles