Urban Growth raster model

Julien Mazars edited this page May 21, 2016 · 3 revisions

Cellular Automaton Based Urban Growth

Author : Truong Chi Quang, Patrick Taillandier, Benoit Gaudou & Alexis Drogoul

model based on the one proposed by (Raimbault et al., 2014): At each simulation step the nb_plots_to_build empty plots with the highest constructability are built The constructability is computed from 3 criteria: the density of construction in the neighborhood, the distance to a road, the distance to the city center (using the road network).

Code of the model :


model raster3


global
{ 
	//File for the ascii grid
	file asc_grid <- grid_file("../includes/cantho_1999_v6.asc");
	//Shapefile for the road
	file road_shapefile <- shape_file("../includes/roads15_3.shp");
	//Shapefile for the city
	file city_center_shapefile <- shape_file("../includes/city center.shp");
	//Shape of the environment
	geometry shape <- envelope(asc_grid);
	//Graph of the roads
	graph roads_network;
	
	// Dynamic list of the cells to consider at each cycle
	list<plot> empty_plots <- plot where (each.grid_value = 0.0) update: shuffle(plot where (each.grid_value = 0.0));
	
	list<rgb> plot_colors <- [ 
		#lightgray, //empty
		#orange, // 1 built
		#blue // 2 River-lake
	];
	//Radius of density
	int density_radius <- 4;
	//Weight of density
	float weight_density <- 0.05;
	//Weight of the road distance
	float weight_road_dist <- 0.5;
	//Weight of the city center distance
	float weight_cc_dist <- 0.3;
	//Number of plot allowing to build a building
	int nb_plots_to_build <- 195;

	init
	{
		//Creation of the roads using the shapefile of the road
		create roads from: road_shapefile;
		//Creation of the city center using the city center shapefile
		create city_center from: city_center_shapefile;
		//Creation of the graph of the road network
		roads_network <- as_edge_graph(roads);
		
		//Each road has to compute its distance from the city center
		ask roads {
			do compute_cc_dist;
		}
		//Compute the city distance for each plot
		ask empty_plots {
			do compute_distances;
		}
		//Normalization of the distance
		do normalize_distances;
	}
	//Action to normalize the distance
	action normalize_distances {
		//Maximum distance from the road of all the plots
		float max_road_dist <- empty_plots max_of each.dist_route;
		//Maximum distance from the city center for all the plots
		float max_cc_dist <- empty_plots max_of each.dist_cv;
		//Normalization of  each empty plot according to the maximal value of each attribute
		ask empty_plots {
			dist_cv <- 1 - dist_cv / max_cc_dist;
			dist_route <- 1 - dist_route / max_road_dist;
		}
	}
	
	
	//Reflex representing the global dynamic of the model
	reflex dynamique_globale when: weight_density != 0 or weight_road_dist != 0 or weight_cc_dist != 0 {
		//Ask to each empty plot to compute its constructability
		ask empty_plots {
			constructability <- compute_constructability();
		}
		list<plot> ordered_plots <- empty_plots sort_by (each.constructability);
		ordered_plots <- nb_plots_to_build last ordered_plots;
		//Build on each empty plot having the highest constructability
		ask ordered_plots
		{
			do build;
		}
	}	
}
//Species representing the city center
species city_center {
	aspect default {
		draw circle(300) color: #cyan;
	}	
}
//Species representing the roads
species roads
{
	float dist_cv;
	//Action to compute the city center distance for the road
	action compute_cc_dist {
		using topology(roads_network)
		{
			dist_cv <- self distance_to first(city_center);
		}
	}
	aspect default {
		draw shape color: #black;	
	}
}
//Grid species to represent the different building plots
grid plot file: asc_grid use_individual_shapes: false use_regular_agents: false neighbors: 4
{
	rgb color <- grid_value = -1 ? #white : plot_colors[int(grid_value)];
	//Distance from the road
	float dist_route <- 0.0;
	//Distance from the city center
	float dist_cv <- 0.0;
	//Constructability of the plot
	float constructability;
	
	//Action to compute all the distances for the cell
	action compute_distances
	{
		roads route_pp <- roads closest_to self;
		dist_route <- (self distance_to route_pp) using topology(world);
		dist_cv <- dist_route + route_pp.dist_cv;
	}
	//Action to build on the cell
	action build
	{
		grid_value <- 1.0;
		color <- plot_colors[1];
	}
	//Action to compute the constructability of the plot cell
	float compute_constructability
	{
		//Get all the neighbours plots
		list<plot> voisins <- (self neighbors_at density_radius);
		//Compute the density of all the neighbours plots
		float densite <- (voisins count (each.grid_value = 1.0)) / length(voisins);
		return (densite * weight_density + dist_route * weight_road_dist + dist_cv * weight_cc_dist) / (weight_density + weight_road_dist + weight_cc_dist);
	}			
}

experiment raster type: gui {
 	parameter "Weight of the density criteria" var: weight_density;
 	parameter "Weight of the distance to roads criteria" var: weight_road_dist;
 	parameter "Weight of the distance to city center criteria" var: weight_cc_dist;
 	output {
 		display map type: opengl {
			grid plot;
			species roads;
			species city_center;
		}
	}
}

Home

Introduction

Changes from 1.6.1 to 1.8

Platform

  1. Installation and Launching
  2. Installation
  3. Launching GAMA
  4. Headless Mode
  5. Updating GAMA
  6. Installing Plugins
  7. Troubleshooting
  8. Workspace, Projects and Models
  9. Navigating in the Workspace
  10. Changing Workspace
  11. Importing Models
  12. Editing Models
  13. GAML Editor (Generalities)
  14. GAML Editor Toolbar
  15. Validation of Models
  16. Running Experiments
  17. Launching Experiments
  18. Experiments User interface
  19. Menus and commands
  20. Parameters view
  21. Inspectors and monitors
  22. Displays
  23. Batch Specific UI
  24. Errors View
  25. Preferences

Learn GAML step by step

  1. Introduction
  2. Start with GAML
  3. Organization of a Model
  4. Basic programming concepts in GAML
  5. Manipulate basic Species
  6. Global Species
  7. Regular Species
  8. Defining Actions and Behaviors
  9. Interaction between Agents
  10. Attaching Skills
  11. Inheritance
  12. Defining Advanced Species
  13. Grid Species
  14. Graph Species
  15. Mirror Species
  16. Multi-Level Architecture
  17. Defining GUI Experiment
  18. Defining Parameters
  19. Defining Displays Generalities
  20. Defining Charts
  21. Defining 3D Displays
  22. Defining Monitors and Inspectors
  23. Defining Export files
  24. Defining User Interaction
  25. Exploring Models
  26. Run Several Simulations
  27. Batch Experiments
  28. Exploration Methods
  29. Optimizing Model Section
  30. Runtime Concepts
  31. Optimizing Models
  32. Multi-Paradigm Modeling
  33. Control Architecture
  34. Defining Equations

Recipes

  1. Manipulate OSM Datas
  2. Diffusion
  3. Using Database
  4. Calling R
  5. Using FIPA ACL
  6. Using GamAnalyzer
  7. Using BDI
  8. Using Driving Skill
  9. Manipulate dates
  10. Manipulate lights
  11. Using comodel
  12. Save and restore Simulations
  13. Using network
  14. Headless mode
  15. FAQ
  16. Known Issues

GAML References

  1. Built-in Species
  2. Agent Built-in
  3. Model Built-in
  4. Experiment Built-in
  5. Built-in Skills
  6. Built-in Architecture
  7. Statements
  8. Data Type
  9. File Type
  10. Expressions
  11. Literals
  12. Units and Constants
  13. Pseudo Variables
  14. Variables And Attributes
  15. Operators [A-A]
  16. Operators [B-C]
  17. Operators [D-H]
  18. Operators [I-M]
  19. Operators [N-R]
  20. Operators [S-Z]
  21. Index

Tutorials

  1. Predator Prey
  2. Road Traffic
  3. 3D Tutorial
  4. Incremental Model
  5. Luneray's flu
  6. Co-modeling
  7. BDI Agents

Pedagogical materials

Developing Extensions

  1. Installing the GIT version
  2. Architecture of GAMA
  3. Developing a Plugin
  4. Developing a Skill
  5. Developing a Statement
  6. Developing an Operator
  7. Developing a Type
  8. Developing a Species
  9. Developing a Control Architecture
  10. Index of annotations
  11. IScope
  12. Creating a release of GAMA
  13. Documentation generation
  14. Website generation

Scientific References

Projects using GAMA

Training Session

Events

Older versions

Coding Camp

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.