matrix new_agents <- matrix (csv_file("../includes/my_files.csv"));
--
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.
model createfrommatrix
global {
init {
matrix new_agents <- create_a_matrix();
loop i from: 0 to: new_agents.rows -1{
loop j from: 0 to: new_agents.columns -1 {
int val <- int(new_agents[i,j]);
if (val > 0) {
cell my_cell <- cell[i,j];
create dummy number: val {
location <- any_location_in(my_cell);
}
}
}
}
}
matrix create_a_matrix {
matrix mat <- 0 as_matrix {10,10};
loop i from: 0 to: mat.rows - 1{
loop j from: 0 to: mat.columns -1 {
mat[i,j] <- rnd(3);
}
}
write mat;
return mat;
}
}
species dummy {
aspect default {draw circle(0.5) color: #red;}
}
grid cell width: 10 height: 10 ;
experiment createfrommatrix type: gui {
output {
display map {
grid cell lines: #black;
species dummy;
}
}
}