Skip to content
February 16, 2011 / kaigani

I’ve been modelling rivers based on neural network theory (for fun) …

River

I’m inordinately proud of this.  It started as a little experiment in Processing over the weekend – that quickly grew into my Great White Whale.

I wanted to model a river that followed a realistic behaviour of starting at an source and ending at an outlet, but having all sorts of unpredictable twists and turns along the way.  And I didn’t want it to be overly reliant on random equations.

At first, I tried modelling terrain, and attempted to move water across the surface according to pressure from the source and differences in volumes along the way.

In the end, I had a very realistic simulation of someone wetting their pants.

I went back to the drawing board, and thought of neural networks.  What if I had the water randomly seek the outlet, and once found, it begins to see the outlet with increasing efficiency. But hopefully not so efficient that it would be a straight line.

River02

It starts by advancing from the source by 360 degrees in any direction. And then 360 degrees in any direction from there, randomly.  

When it finally has a ‘success’ – it stores each step along the way there.  For the next round, it reduces the amount of deviation from the path of success.  So randomly 330 degrees around the successful angle at that step.  And so on.

… not sure why I did this anyhow.  It was meant to be fun.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: