Hello,--I'm new in GAMA and i'm trying to use the clustering algorithms, but I can't figure out how to use it I've build a simple example of a town and I want to aggregate buildings into cluster.This is my sample code:model town
global{
file shape_file_buildings <- file('../includes/building.shp');
file shape_file_roads <- file('../includes/road.shp');
int nb_people <- 100;
geometry shape <- envelope(shape_file_roads);
init{
create building from: shape_file_buildings with: [type::string(read ('NATURE'))] {
if type='Industrial' {
color <- rgb('blue');
datasize <- 1000;
recurence <-1000;
}
else if type='Residential'{
color <- rgb('red');
datasize <- 1000;
recurence <-1000;
}
}
list<building> residential_buildings <- building where (each.type='Residential');
list<building> industrial_buildings <- building where (each.type='Industrial');
create road from: shape_file_roads ;
create species: home number: nb_people {
living_place <- one_of(residential_buildings) ;
location <- any_location_in (living_place);
}
}
}
species building
{
rgb color;
string type;
int datasize;
int recurence;
aspect geometry {
draw shape color: rgb(color);
}
}
species road
{
aspect geometry {
draw shape color: rgb("black");
}
}
species home
{
building living_place;
point location;
}
experiment town type: gui{
output{
display first_map {
species building aspect:geometry;
species road aspect:geometry;
}
}
}
Thanks/Merci
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.
Just one more thing, is it possible during the run time to add moving cars to the closest cluster and make them change when the move?