gmo network creator

Post on 24-Mar-2016

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Creation of Network with minimum span tree and voronoi

TRANSCRIPT

TUTORIAL

GMO NETWORK CREATOR

1. Software Functions

This program create the two main road networks of a city and are both defined by a net of points

- The network based on Voronoi Diagram. This Network also create the limits of all the districts of the site (neighborhoods)

GMO Network Creator - Tutorial

- The network called “Minimum Spanning Tree” which links the most efficiently all the points (the shorter network).

Under the final network are indicated the length of :

- the total network

- the longest street (between 2 points)

- the shortest street (between 2 points)

GMO Network Creator - Tutorial

You can restart the program when press “Restart”

or

You can show the final result of the network (with a black mask) when press “Final Result”

GMO Network Creator - Tutorial

1. Configuration

In order to adapt the program to any configuration, here are the parameters you have to modify :

• Modification of number of points

GraphBuilder graph;ProcessMST process;ArrayList edgesList;ArrayList verticesList;// Number of connexion pointint SIZE = 15;PImage img;

• Modification of the image

void setup(){ size(700, 700); fill(255, 0, 0, 8); stroke(200, 0, 0, 90); strokeWeight(3); points = new float[SIZE][2]; ellipseMode(CENTER); frameRate(10); background(0); label = loadFont("Helvetica-Bold-12.vlw"); // Image Loading img = loadImage("stutt.jpg"); image(img,0,0,700,700); }

GMO Network Creator - Tutorial

• Mask definition for final result

RGB Color of Mask

void masque() { img= loadImage("stutt1_700.jpg"); loadPixels(); img.loadPixels();

for (int y = 0; y < height; y=y+1 ) { for (int x = 0; x < width; x=x+1 ) { int loc = x + y*width; float r = red(img.pixels [loc]); float g = green(img.pixels[loc]); float b = blue(img.pixels[loc]);

// Definition of the color of the mask in the picture of mask with RGB Colors if ((r==2) && (g==0) && (b==1)) { // Set the display pixel to the image pixel pixels[loc] = color(0,0,0); } } updatePixels(); } }

• Showing Delaunay and Hull Mesh

boolean showVoronoi=true;boolean showDelaunay=false; // Show all the connexion between pointsboolean showHull=false; // show the area delimited by the connexion points

GMO Network Creator - Tutorial

top related