//Reflex to add water among the water cells
reflex adding_input_water {
float water_input <- rnd(100)/100;
ask river_cells parallel: parallel{
water_height <- water_height + water_input;
}
}
4. How should I express these lines to import and use my data instead of using random rain?
Thanks for your support,
yosef
reflex adding_input_water when: every(#day) {
float water_input <- matrixVlue;
ask river_cells parallel: parallel{
water_height <- water_height + water_input;
}
}
Hope it helps.
Cheers
Benoit
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/64641bd9-750a-491e-a183-9c9708f516e8%40googlegroups.com.
global {
/** Insert the global definitions, variables and actions here */
file RN15_file <- csv_file("../includes/rn15_data.csv", ",");
matrix RN15_matrix <- matrix(RN15_file); //convert the file into a matrix
float RN15_number <- RN15_matrix[1,0]; // extract specific data
list<string> RN15_DateTime <- RN15_matrix column_at 0;
list<float> RN15_rn15 <- RN15_matrix column_at 1;
// Checking the imported .csv file
init{
// the most easy way is by using the "write" statement. This statement prints values in the monitor
write RN15_number;
write RN15_DateTime;
write RN15_rn15;
}
}
experiment rainCSV_Trial_2 {
/** Insert here the definition of the input and output of the model */
output {
display rainCSV_Trial_2_display type: opengl{
chart "15 min Rainfall Observations" type: series{
datalist "DateTime" value: RN15_DateTime;
data "rn15" value: RN15_rn15;
}
}
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to gama-p...@googlegroups.com.
experiment rainCSV_Trial_2 {
/** Insert here the definition of the input and output of the model */
output {
display rainCSV_Trial_2_display type: opengl{
chart "15 min Rainfall Observations" type: series{
data "rn15" value: (cycle < length(RN15_rn15)) ? RN15_rn15[cycle] : 0 ;
}
}
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/a4ecbc59-5c59-4db1-ba75-558150b6c4e7%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/a4ecbc59-5c59-4db1-ba75-558150b6c4e7%40googlegroups.com.
float water_input <- rain update: every(10#cycle) ? rnd(10.0) : 0.0;
I´ll like my river to receive water directly from my rain matrix without the data been subjected to the facets update every(X#cycle) ? rnd(X) : 0.0.
If I use the following lines:
1. float water_input <- rain update: water_input + rain;
or
2. float water_input <- rain;
no rainwater flows to the river. Can you kindly guide in how I should modify my line of code in order for the river to receive this rain data, taking into account I don't want the matrix (the rain data) to be affected by -> ... update: every(10#cycle) ? rnd(10.0) : 0.0;
Thanks,
yosef
Dear Benoit/Patrick, I have another enquiry on this same topic. In the example model in GAMA: “Water flow in a river graph, using water flow in a river” I´m trying to get the poi – outlet under section “reflex water_flow” to give water to the river, but from the values of a rain matrix. I have twisted and turned this requirement without any avail, reason why after so many trials and failure I’m requested your help on this matter. Can you kindly guide with the correct syntax for getting the poi – outlet to give water instead from values in the matrix?
Warm regards,
Yosef
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/774454b4-a277-4fda-9294-b7612ba599c9%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/774454b4-a277-4fda-9294-b7612ba599c9%40googlegroups.com.