# Tag Archives: Simulation

## Algorithm analysis – Big O notation

Continuing from my previous post on performance analysis of algoritms, I decided to plot the CPU-time over the size of the problem, that is, the number of cells. The two graphs above, both plotted ‘log-log’, demonstrate a straight line.  A straight … Continue reading

## Single simulation run consuming 230 h (!) of cpu-time – root cause analysis of performance

I think I’ve broken some kind of record of CPU-time consumption for a single simulation run… for a fairly trivial application… As my frequent readers know, I’ve been playing lately with a simulation of Shelling’s segration model (see previous posts … Continue reading

## Animation of Thomas Shelling’s Segregation model

Programmed in Python, NumPy, SciPy and Prof. John Zelle’s Graphics Library

## Graphics programming with Python

For reasons unknown to me, probably psychological, I’ve always hated graphics programming…. Never touched it, if I could avoid it…  Over the past 40 years that I’ve been programming,professionally as well as privately,  most of the time making ‘the pedal … Continue reading

## Schelling’s segration model: evolution

The image above shows the evolution, per iteration, for a run of the Schelling simulation. The upper left grid shows the initial condition, which is a randomly arranged state. The seven remaining grids show the state of the board after … Continue reading

## There’s a bug in my program: The enormous difference between < and <=

I’ve found a bug in my program! A bug, in my program…! And I’m a pro hacker, how shameful…! 🙂 Scary, isn’t it… a simple bug, a single character among the thousands of characters in my program… that single character … Continue reading

## Segregation – technical details

Just a few details to the more technically inclined readers of this blog: The image below has three sections: the leftmost showing the results in terms of where the agents prefer to be, the middle image showing a heatmap over … Continue reading

## Segration demo by computational agent simulation

For the fun of it, (and to learn more about Numpy’s multidimensional arrays) I decided to repeat Thomas Shelling’s famous experiment which demonstrates that segregation based on any real or imagined divider, such as gender, income, language,age, ethnicity, race, social status, … Continue reading