Crime Map 2.0

I just finished up the last hour of polishing on the new version of the Grand Rapids Crime Map. Here is a list of the changes:

-all incidents are up to date
-new filters are in place: date, weekday, and street name
-more organized, usable layout
-content managed to allow for easier and more frequent updates

I built the new version – interface and content management system – in PHP. The data for the crimes is loaded using a Python script. Eventually this whole site may well be ported over to Python. It’s a neat language.

Here are some interesting tidbits which came to light using the new filters:

-Monday and Wednesday are the crimiest days of the week
-Division Ave, Plainfield Ave, Leonard Street and 28th Street have the most incidents
-49507 is the busiest zip code
-the SouthEast quadrant is by far the most exciting area of town.
-March, May and August are the angriest months

I am sure there is still a little clean-up left to do in the data, so expect things to shift around a bit over the next week or so.

Enjoy!

Perlin Ants In Color

Perlin ants in color

Click here to launch the ants.

Click the left button to reset the terrain which the ants follow.
Click the right button to show and hide the terrain.

1800 ants in a full-color version of yesterday’s experiment. Instead of looking for dark/light pixels, the ants look at the different color channels of the pixel they land on – red, green and blue. Then the ants follow the same pattern as yesterday – dark pixels turn left, light pixels turn right – based on the intensity of the target color.

Yup. I like how this one turned out, too.

Perlin Ants

Perlin Ants with visible terrain

Click here to launch the ants.

Click the left square to generate a new terrain map.
Click the right square to show and hide the terrain map.

This is kind of a mash-up between bits and pieces of some previous experiments – the terrain from the tile-based game, and the ants from the Langton’s Ants experiments.

Basically, what is happening here is this: A thousand “ants” are created and placed in random locations on the screen, facing in random directions. Each turn, each ant moves forward one pixel. If the color of the new pixel is lighter than the previous pixel, it turns a bit widdershins. If the new pixel is darker, it turns a bit clockwise.

The ants end up tracing something like contour lines, and seem to be “attracted” to sections where the color of the terrain varies significantly over a small area.

I threw in a bit of a blur to make things more interesting visually.

Enjoy!

Langton’s Ant 3D, Version 2

Langton's Ant in 3D

Another Langton’s Ant 3D experiment. Click here to run the experiment.

I finally got the ruleset sorted out, and now I have a simple 3d version of Langton’s Ant up and running. This is how it works:

Remember the behavior of Langton’s Ant:
1. If the ant is on an empty cell, color it in and move according to the next rule in the set.
2. If the ant is on a filled cell, empty the cell and move according to the previous rule in the set.
3. Do not talk about fight club.

The space in which the Ant is moving is a 50x50x50 (125,000) grid of cells.

There are eight rules which the ant follows, which – if none of the cells are colored in yet – the ant will follow in sequence:

1. Z–
2. X++
3. Y++
4. X–
5. Z++
6. X++
7. Y–
8. X–

In non-computerese, when the applet first runs, the ant will travel in, right, down, left, out, right, up, left, and in doing so fill in eight cells which make up a 2x2x2 cube.

2-3
5-4

1-8
6-7

With the next step the ant begins to encounter filled cells, which mean it takes a step back in the ruleset, and perhaps another, and eventually start to travel to new cells.

It is important, in order for the ant to make the desired patterns, that the sequence of movements in the ruleset visit each cell in a cube of cells exactly once, with the next iteration through the ruleset returning the ant to the original cell. Also, no diagonal movement; only cell face to cell face. I am not sure if this can be accomplished with more than a 2x2x2 cube.

In this demo the cells are colored in according to the “depth”, or the Z value of the cell-s position. Cells farther in the “back” are blue, and cells closer to the “front” are red. All layers (Z) are faded back except for the layer in which the Ant is currently moving. This is why there appears to be a “screen” of cells which moves back and forth and changes colors constantly.

Also in this demo, the pattern created appears to trend to the lower right corner of the screen because each of the layers, back to front, has been offset one cell to the right and one cell down, to provide a sort of isometric view of the pattern.

More experiments along these lines to come, after my brain cools down a bit.