Skip to content

Commit

Permalink
resolved merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Chen committed Jul 31, 2017
2 parents c20dbae + bc692b3 commit 532314b
Show file tree
Hide file tree
Showing 39 changed files with 74,588 additions and 43 deletions.
Binary file added CPG_CityScope_GAMA/includes/energy/volpe.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions CPG_CityScope_GAMA/includes/energy/volpe.qpj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83 / Massachusetts Mainland",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.68333333333333],PARAMETER["standard_parallel_2",41.71666666666667],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-71.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",750000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","26986"]]
Binary file added CPG_CityScope_GAMA/includes/energy/volpe.shp
Binary file not shown.
Binary file added CPG_CityScope_GAMA/includes/energy/volpe.shx
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added CPG_CityScope_GAMA/includes/volpe/Roads.qix
Binary file not shown.
File renamed without changes.
File renamed without changes.
65,500 changes: 65,500 additions & 0 deletions CPG_CityScope_GAMA/includes/volpe/mobility/boston_1_08_10_2017.csv

Large diffs are not rendered by default.

8,940 changes: 8,940 additions & 0 deletions CPG_CityScope_GAMA/includes/volpe/mobility/kendall_1_08_10_2017.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CPG_CityScope_GAMA/includes/volpe/table_bounds.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",656166.6666666665],PARAMETER["False_Northing",2460625],PARAMETER["Central_Meridian",-71.5],PARAMETER["Standard_Parallel_1",41.71666666666667],PARAMETER["Standard_Parallel_2",42.68333333333333],PARAMETER["Latitude_Of_Origin",41],UNIT["Foot_US",0.30480060960121924]]
2 changes: 1 addition & 1 deletion CPG_CityScope_GAMA/models/CityScope_Andorra_demo.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ global {
}

experiment CityScopeAndorraDemo type: gui {
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"Andorra" among:["kendall", "Andorra"];
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"andorra" among:["kendall", "andorra"];
float minimum_cycle_duration <- 0.02;
output {
display CityScope type:opengl background:#black {
Expand Down
12 changes: 6 additions & 6 deletions CPG_CityScope_GAMA/models/CityScope_Kendall_data.gaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* Name: CityScope Kendall - Mobility Data Visualization
* Name: CityScope volpe - Mobility Data Visualization
* Author: Arnaud Grignard
* Description: Visualization of Modbile Data in Kendall
* Description: Visualization of Modbile Data in volpe
*/

model CityScope_Kendall
model CityScope_volpe

global {
// GIS FILE //
file bound_shapefile <- file("../includes/Kendall/Bounds.shp");
file roads_shapefile <- file("../includes/Kendall/Roads.shp");
file bound_shapefile <- file("../includes/volpe/Bounds.shp");
file roads_shapefile <- file("../includes/volpe/Roads.shp");
file imageRaster <- file('../includes/images/gama_black.png') ;
geometry shape <- envelope(bound_shapefile);
float angle <--9.74;
Expand All @@ -20,7 +20,7 @@ global {
float lenghtMax <-0.0;
//kendall_1_08_10_2017
//boston_1_08_10_2017
file my_csv_file <- csv_file("../includes/Kendall/mobility/kendall_1_08_10_2017.csv",",");
file my_csv_file <- csv_file("../includes/volpe/mobility/kendall_1_08_10_2017.csv",",");
matrix data <- matrix(my_csv_file);

//CLUSTERING
Expand Down
108 changes: 108 additions & 0 deletions CPG_CityScope_GAMA/models/CityScope_Kendall_energy.gaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
* Name: CityScope volpe - Energy Data Visualization
* Author: Arnaud Grignard
* Description: Visualization of Energy Data on Volpe Site
*/

model CityScope_volpe



global {
// GIS FILE //
file bound_shapefile <- file("../includes/volpe/Bounds.shp");
file roads_shapefile <- file("../includes/volpe/Roads.shp");
file buildings_shapefile <- file("../includes/energy/volpe.shp");
file imageRaster <- file('../includes/images/gama_black.png') ;
geometry shape <- envelope(buildings_shapefile);
float angle <--9.74;
graph<geometry, geometry> smart_grid_graph;

init {
create road from:roads_shapefile;
create building from:buildings_shapefile with:[energy:: int(read('Kwh/m2'))]{
color<-rgb(255 - (255 * ((4000-energy)/4000 )),255 * ((4000-energy)/4000 ),0);
}
create people number:500{
location<-any_location_in(one_of(building));
}
}


reflex updateGraph when:time=100{
ask powerSupply{
do die;
}
ask building{

create powerSupply{
location<-myself.location;
color<-myself.color;
energy<-myself.energy;
}

smart_grid_graph <- as_distance_graph(powerSupply, 100);

}
}

}

species building{
int energy;
rgb color;
aspect base {
draw shape color: color depth:(time>100) ? energy/4000*100 :(time/100)*energy/4000*100;
}
}

species road schedules: []{
rgb color <- #red ;
aspect base {
draw shape color: rgb(125,125,125,75) ;
}
}

species powerSupply{
rgb color;
int energy;
aspect base{
if(time>100){
draw sphere(10 +abs(cos(time)*energy/250)) color:color;
}

}
}

species people skills:[moving]{
reflex move {
do wander;
}
aspect base{
draw circle(5) color:#black;
}
}

experiment CityScopeEnergy type: gui {
output {
display CityScope type:opengl background:#white {
species people aspect:base;
species road aspect: base refresh:false;
species building aspect:base;
species powerSupply aspect:base position:{0,0,0.25};
graphics "the graph" position:{0,0,0.25}{
if(time>100){
loop edge over: smart_grid_graph.edges {
draw edge color: #green;
}
}
}
}
}
}






2 changes: 1 addition & 1 deletion CPG_CityScope_GAMA/models/CityScope_Volpe_demo.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ global {
}

experiment CityScopeVolpeDemo type: gui {
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"kendall" among:["kendall", "Andorra"];
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"volpe" among:["volpe", "Andorra"];
float minimum_cycle_duration <- 0.02;
output {
display CityScope type:opengl background:#black {
Expand Down
51 changes: 20 additions & 31 deletions CPG_CityScope_GAMA/models/CityScope_main.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,22 @@ global {
write "cityScopeCity" + cityScopeCity + " w:" + world.shape.width + " h:" + world.shape.height;
create building from: buildings_shapefile with: [usage::string(read ("Usage")),scale::string(read ("Scale"))];
create road from: roads_shapefile ;
if(cityScopeCity= "kendall"){
if(cityScopeCity= "volpe"){
angle <- -9.74;
center <-{3305,2075};
brickSize <- 70.0;
if(localHost=false and cityMatrix = true){
cityIOUrl <-"https://cityio.media.mit.edu/api/table/citymatrix_volpe";
}
else{
cityIOUrl <-"http://localhost:8080/table/citymatrix_volpe";
}
}
if(cityScopeCity= "Andorra"){
if(cityScopeCity= "andorra"){
angle <-3.0;
center <-{2525,830};
brickSize <- 37.5;

if(localHost=false and cityMatrix = true){
cityIOUrl <-"https://cityio.media.mit.edu/api/table/citymatrix_andorra";
}
else{
cityIOUrl <-"http://localhost:8080/table/citymatrix_andorra";
}
}

if(localHost=false and cityMatrix = true){
cityIOUrl <-"https://cityio.media.mit.edu/api/table/citymatrix_"+cityScopeCity;
}
else{
cityIOUrl <-"http://localhost:8080/table/citymatrix_"+cityScopeCity;
}

road_graph <- as_edge_graph(road);
Expand All @@ -101,7 +95,6 @@ global {
do initGrid;
}


ask building where (each.usage="R"){
create people number: (cityScopeCity = "kendall") ? shape.area/2000 : (flip(0.8) ? 1 : 0){//shape.area/2000 {
living_place <- myself;
Expand Down Expand Up @@ -264,19 +257,15 @@ species people skills:[moving]{
}

aspect scale{

if(current_path = nil and objective = "working"){
draw square(14) color: color_map[scale];
}
else{
draw circle(14) color: color_map[scale];
}
draw circle(14) color: color_map[scale];
}

aspect scaleTable{
if(toggle1 > 4 ){
draw circle(4) color: color_map[scale];
}
if(toggle1 >4)
{
draw circle(4) color: color_map[scale];
}

}
}

Expand Down Expand Up @@ -319,7 +308,7 @@ species table{
}

experiment CityScopeVolpe type: gui {
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"kendall" among:["kendall", "Andorra"];
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"volpe" among:["volpe", "andorra"];
float minimum_cycle_duration <- 0.02;
output {
display CityScope type:opengl background:#black {
Expand Down Expand Up @@ -391,7 +380,7 @@ experiment CityScopeTaipeiMain type: gui {
}

experiment CityScopeAndorra type: gui {
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"Andorra" among:["kendall", "Andorra"];
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"andorra" among:["volpe", "andorra"];
float minimum_cycle_duration <- 0.02;
output {
display CityScope type:opengl background:#black {
Expand All @@ -411,11 +400,11 @@ experiment CityScopeAndorra type: gui {
experiment CityScopeMulti type: gui {
init {
//we create a second simulation (the first simulation is always created by default) with the given parameters
create simulation with: [cityScopeCity:: "kendall", minimum_cycle_duration::0.02];
//create simulation with: [cityScopeCity:: "Andorra", minimum_cycle_duration::0.02];
create simulation with: [cityScopeCity:: "volpe", minimum_cycle_duration::0.02];
//create simulation with: [cityScopeCity:: "andorra", minimum_cycle_duration::0.02];

}
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"Andorra" among:["kendall", "Andorra"];
parameter 'CityScope:' var: cityScopeCity category: 'GIS' <-"andorra" among:["volpe", "andorra"];
float minimum_cycle_duration <- 0.02;
output {
display CityScope type:opengl background:#black {
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# CPG_CityScope_Volpe
Agent based model of the Kendal CityScope using GAMA Platform
Agent based model of the Kendal CityScope using GAMA Platform - Devel

## CPG_CityScope_Volpe_GAMA
## CPG_CityScope_GAMA
This is the first version of the actual ABM model running on the
CityScope table using the GAMA Platform. This version is the one
running on the physical table at the lab and synchronized with CityIOServer
running on the physical table at the lab and synchronized with CityIOServer.

## Software used
http://gama-platform.org/

Developped by [Arnaud Grignard](https://github.com/agrignard)


0 comments on commit 532314b

Please sign in to comment.