GDV P.2.2.1 Stupid agents

The original title of this chapter in the Generative Design book is: Dumb agents. But I have changed that for this blog because I liked it better this way. The starting point for this chapter’s assignment was: During each drawing operation, one of the eight possible directions is randomly selected for the next step. Steps are made by adding or subtracting a predetermined value (step size) to the current position’s coordinates. The circle is finally drawn at the new position. This is how it was described in the Generative Design Book. This chapter uses two programs. And here is the code and image for the first program.

I would like to introduce two new things. The homepage of my loftmatic site. Every time I work on a chapter I enlarge the best image to be put on the homepage. If you click that image you end up at the chapter’s page with all variations of that chapter. A small explanation of what I did and links to the ‘working’ program and code. If the code works in Processing but does not in JavaScript I just display the code on the screen.

As a first challenge I inverted everything. Background from white to black. The (stupid) agent is now displayed in white.

Introduced no fill. Added a stroke to the ellipses with a very low transparency level.

Replaced the ellipses with rectangles.

This example grows rather slow because it has a very low transparency. And instead of ellipses I used a quarter of an ellipse. Wow! I now see that I have made a mistake. When you press the backspace or delete key it erases the image. That’s what it supposed to do but it makes the background white instead of black.

Replaced the arcs by rectangles.

And here is the original code and image for the second program.

Changed that mistake when clearing the image that everything turns white. If you press the backspace or delete key you end up with a black background. Enlarged all ellipses. And when you hit the 1, 2 or 3 key you get different colors after 100 ellipses are displayed. I also commented out some lines. So the agents will now only walk in the NORTH and NORTHEAST directions.

Commented out some other program lines. So the agents will now walk only in the NORTH, EAST or SOUTHEAST directions.

In this version the agents will only walk in the NORTH, EAST and SOUTH directions.

Here the agents travel NORTH, SOUTHWEST, WEST or NORTHWEST.

And as a last try the agents travel only NORTH, EAST, WEST or NORTHWEST

I thought that I could get more out of the program. So I continued a little until I thought the program developed a little different. So I changed the background color of the agents into shades of green. And around each 400th agent it displays an agent without transparency.

Changed the background color of the agents into shades of red.

Commented out some lines. Agents now only stumble NORTH, EAST, SOUTHEAST, SOUTH, WEST and NORTHWEST.

Commented out some other lines. The agents are now running in the NORTH, EAST, SOUTHWEST and WEST direction.

Removed all comment-out lines. Made the background agents shades of blue. And introduced some randomness in the diameter of the agents (the ones which are displayed without any transparency).

I found that I still could go a step further. Just forget about the individual dots. But leave the positioning intact. Exaggerate the ellipses by making them very wide. Almost like they look like lines. In this case horizontal lines. Now here JavaScript does not a very fine job. In fact it does not work at all. That’s why I only display the Processing code and no image. And that is the case for the next programs (except P_2_2_1_04_GDV_04). I tried to find where  I made the mistake but I could not find it. And I would like to continue with my study of Processing. I do not want to spend time on looking for mistakes (I made?) by converting code from Processing to JavaScript. So knowing that… all programs are running fine in Processing 2. Here is the code.

Again I exaggerated the ellipses. But in this case vertical instead of horizontal.

Here I exaggerated the ellipses in both horizontal and vertical ways.

And yes! This one is working in JavaScript! I have no clue why this one works and the other ones don’t. Its vertical lines again. But it gives a totally different impression as P_2_2_1_04_GDV_02 because I decreased the stepsize of the agents. The longer you let it run the better the image gets. Hitting the 1, 2 and 3 keys is also helpfull for getting the image better.

Here I used horizontal and vertical ellipses to get a cross-like image. Rotated some ellipses for some 45 degrees and one other for 135 degrees.

Well I think I could continue for a while but I would like to stop here with the stupid agents. I will continue with the next chapter about intelligent agents. Lets see where we end up.

Henk Lamers


Comments? Leave a reply.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s