Skip to content
Snippets Groups Projects
Commit 86d33127 authored by ThibautDemare's avatar ThibautDemare
Browse files

Put some inheritance to network species

parent 592fd5dc
Branches
Tags
No related merge requests found
......@@ -8,7 +8,8 @@ global {
graph river_network;
}
species Road {
species Network {
string col;
float speed;
float length;
int colorValue <- -1; // This value is filled by the custom GAMA Plugin : MovingOnNetwork. It allows to colour the road according to the quantity of goods on the road.
......@@ -19,7 +20,6 @@ species Road {
}
else{
if(colorValue = -1){
string col <- "grey";
draw shape + 2°px color: rgb(col) border: rgb(col);
}
else {
......@@ -28,46 +28,15 @@ species Road {
}
}
}
species Road parent:Network {
string col <- "grey";
}
species MaritimeLine {
float speed;
float length;
int colorValue <- -1; // This value is filled by the custom GAMA Plugin : MovingOnNetwork. It allows to colour the road according to the quantity of goods on the road.
bool blocked <- false;
aspect geom {
if(blocked){
draw shape + 2°px color: rgb(0, 255, 0) border: rgb(0, 255, 0);
}
else{
if(colorValue = -1){
string col <- "blue";
draw shape + 2°px color: rgb(col) border: rgb(col);
}
else {
draw shape + 2°px color: rgb(255, colorValue, 0) border:rgb(255, colorValue, 0);
}
}
}
species MaritimeLine parent:Network {
string col <- "blue";
}
species RiverLine {
float speed;
float length;
int is_new;// This attribute is used to distinguish parts of this network which belong to the Canal Seine Nord, and should be unblock at a different time
int colorValue <- -1; // This value is filled by the custom GAMA Plugin : MovingOnNetwork. It allows to colour the road according to the quantity of goods on the road.
bool blocked <- false;
aspect geom {
if(blocked){
draw shape + 2°px color: rgb(0, 255, 0) border: rgb(0, 255, 0);
}
else{
if(colorValue = -1){
string col <- "green";
draw shape + 2°px color: rgb(col) border: rgb(col);
}
else {
draw shape + 2°px color: rgb(255, colorValue, 0) border:rgb(255, colorValue, 0);
}
}
}
species RiverLine parent:Network {
string col <- "green";
int is_new;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment