Describe the bug
On the current git version, when opening some models I only have an empty parameter view even with some parameters defined. To have it appear I have to close the view and open it again:
/*
* Name: spatialoperators
* Based on the internal empty template.
* Author: Tri
* Tags:
*/
model spatialoperators
global{
int font_size <- 16;
font my_font <- font("Helvetica", font_size , #plain);
float scale <- 0.8;
list operator_list <- ["covers","overlaps","partially_overlaps","crosses","intersects","touches"];
map<string,map<list
init{
create form{
shape <- rectangle(140,90);
location <- {75,50};
color <- #pink;
name <- "pink";
}
create form{
shape <- rectangle(20,40);
location <- {100,50};
color <- #cyan;
name <- "cyan";
}
create form{
shape <- circle(8);
location <- {110,30};
color <- #yellow;
name <- "yellow";
}
create form{
shape <- triangle(14,40) rotated_by(75);
location <- {90,60};
color <- rgb(150,209,69);
name <- "green";
}
create form{
shape <- square(10);
location <- {115,75};
color <- #purple;
name <- "purple";
}
create form{
shape <- polyline([{70,30},{110,70}]);
// location <- {115,75};
color <- #red;
name <- "red";
}
create legend;
loop op over: operator_list{
map<list<form>,bool> op_map;
float width;
loop f1 over: form{
loop f2 over: form-f1{
switch op{
match "covers" {put covers(f1,f2) key: [f1,f2] in: op_map;}
match "overlaps" {put overlaps(f1,f2) key: [f1,f2] in: op_map;}
match "partially_overlaps" {put partially_overlaps(f1,f2) key: [f1,f2] in: op_map;}
match "crosses" {put overlaps(f1,f2) key: [f1,f2] in: op_map;}
match "intersects" {put intersects(f1,f2) key: [f1,f2] in: op_map;}
match "touches" {put touches(f1,f2) key: [f1,f2] in: op_map;}
}
}
}
put op_map at: op in: relations;
}
do reset_width;
}
action reset_width{
frame_width <- ["covers"::0.0,"overlaps"::0,"partially_overlaps"::0,"crosses"::0, "intersects"::0,"touches"::0];
loop op over: operator_list{
float width;
loop f1 over: form{
loop f2 over: form-f1{
if relations[op][[f1,f2]] {
width <- max(width,(name_shift[op]+color_shift[f1.name]+color_shift[f2.name]+2*space_shift)*scale);
}
}
}
put width at: op in: frame_width;
}
}
}
species legend{
rgb color;
point size <-{40,60};
point window_top_left_corner <-{10,10};
float frame_margin <- 2.5;
float vert_shift <- 4.0;
point shift_ini <- window_top_left_corner;
list
Problem was due to the fact that the list of labels was not declared as const: true. I've relaxed a bit the constraint ... (and corrected a bug responsible for the no-show).
Describe the bug On the current git version, when opening some models I only have an empty parameter view even with some parameters defined. To have it appear I have to close the view and open it again:
https://github.com/gama-platform/gama/assets/6374469/fc00c707-f533-434c-8ef1-ca4c59018350
To Reproduce Steps to reproduce the behavior:
model spatialoperators
global{ int font_size <- 16; font my_font <- font("Helvetica", font_size , #plain); float scale <- 0.8; list operator_list <- ["covers","overlaps","partially_overlaps","crosses","intersects","touches"];
map<string,map<list
}
species legend{ rgb color; point size <-{40,60}; point window_top_left_corner <-{10,10}; float frame_margin <- 2.5; float vert_shift <- 4.0; point shift_ini <- window_top_left_corner; list