Skip to content

Commit

Permalink
Modification of some default values for attributes in these models
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Mar 14, 2022
1 parent ba8fe52 commit 075c830
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
Expand Up @@ -10,15 +10,11 @@ model BuildingHeatmap
import "3D Visualization/models/Building Elevation.gaml"

global {
int size <- 300;
int size <- 400;
field heatmap <- field(size, size);
reflex update {
ask people {
loop i from: -(size/100) to: size/100 step: 2 {
loop j from: -(size/100) to: size/100 step: 2 {
heatmap[location + {i, j}] <- heatmap[location + {i, j}] + 5 / (abs(i) + 1);
}
}
heatmap[location] <- heatmap[location] + 10;
}
}
}
Expand All @@ -27,10 +23,10 @@ experiment "Show heatmap" type: gui {
output {
layout #split;
display HeatmapPalette type: opengl axes: false background: #black {
// The field is displayed without 3D rendering, a palettre of cold to warm colors and a smoothness of 4 (meaning three passes of box blur are being done to "spread" the values)
mesh heatmap scale: 0 color: palette([ #black, #cyan, #yellow, #yellow, #red, #red, #red]) smooth: 4 ;
// The field is displayed without 3D rendering, a palettre of warm colors and a smoothness of 3 (meaning three passes of box blur are being done to "spread" the values)
mesh heatmap scale: 0 color: palette([ #black, #yellow, #yellow, #orange, #orange, #red, #red]) smooth: 3 ;
}
display HeatmapGradient type: opengl axes: false background: #black {
display HeatmapGradient type: opengl axes: false background: #black camera: #from_up_front {
species building refresh: false {
draw shape border: #white wireframe: true width: 3;
}
Expand All @@ -42,9 +38,9 @@ experiment "Show heatmap" type: gui {
species people {
draw circle(1) color: #white at: {location.x, location.y};
}
// The field is displayed a little bit above the other layers, with a slight 3D rendering, and a smoothness of 2 (meaning three passes of box blur are being done to "spread" the values). The colors are provided by a gradient with three stops
mesh heatmap scale: 0.01 color: gradient([#black::0, #cyan::0.1, #red::1]) transparency: 0.2 position: {0, 0, 0.001} smooth: 2 ;
}
// The field is displayed a little bit above the other layers, with a slight 3D rendering, and a smoothness of 1 (meaning one passe of box blur are being done to "spread" the values). The colors are provided by a gradient with three stops
mesh heatmap scale: 0.01 color: gradient([#black::0, #cyan::0.1, #red::1]) transparency: 0.2 position: {0, 0, 0.001} smooth: 1 ;
}


}
Expand Down
Expand Up @@ -11,8 +11,8 @@ model FallingHelloWorld


global parent: physical_world {
float restitution <- 0.0; // the "bounciness" of the world
float friction <- 0.5; // the deceleration it imposes on other objects
float restitution <- 0.8; // the "bounciness" of the world
float friction <- 0.2; // the deceleration it imposes on other objects
int environment_size <- 500;
int max_substeps <-0;
float step <- 0.006;
Expand Down
Expand Up @@ -15,7 +15,7 @@ global {
// Initialize the emiter cell as the cell at the center of the word
reflex new_Value {

cells[any_point_in(circle(25))] <- (40);
cells[any_point_in(circle(25))] <- (100);
}
reflex diff {
// Declare a diffusion on the grid "cells", with a uniform matrix of diffusion.
Expand All @@ -25,8 +25,8 @@ global {

experiment diffusion type: gui {
output {
display uniform_diffusion_in_8_neighbors_grid type: opengl synchronized: true {
mesh cells color: #green triangulation: true scale: 1 ;
display uniform_diffusion_in_8_neighbors_grid type: opengl synchronized: true camera:#from_up_front axes: false {
mesh cells color: #green triangulation: true scale: 1 smooth: true ;
}
}
}

0 comments on commit 075c830

Please sign in to comment.