Closed NaroaCS closed 1 year ago
Hi. This is unfortunately to be expected since, even if you use x_range, you have to process more and more points (during all the processing happening before the chart is actually rendered). One possibility could be to build the list of values to draw yourself (always maintaining a constant size, when this size is reached, by removing the first one and adding the new value at the end) and draw only these values using datalist
instead of data
.
Thank you, Alexis! I really appreciate your help. I've done as you say and it does work better than what I was doing. However, the cycles eventually end up slowing down. This is more noticeable especially with several datasets per plot, but happens even with a very simple model like this one:
global{
//Initialize list
list values <- list_with(2000, 0);
//Reflex update values
reflex update_values{
if (cycle > 2000) {
//Remove last value
remove first(values) from: values;
}
//Add new value
add current_date.minute to: values;
}
}
experiment test type: gui {
output {
display dashboard type: java2D{
chart "Test Plot" type: series background: #black x_range: 2000 memorize: false {
data "Data" value:values color: #pink marker: false style: line;
}
}
}
}
@NaroaCS can you test with the fix to #3814 ? It might actually help...
Sorry for the probably very basic question, but how can I download a version of Gama with that commit? I usually download the latest pre-release from here: https://github.com/gama-platform/gama/releases but that doesn't include commit 7839e38
@NaroaCS you should be able to test it with the last release just recently released here https://github.com/gama-platform/gama/releases/tag/1.9.2
Thanks @agrignard ! 👍 Unfortunately I've just tested it with the simple test code above, and the behavior persists. Let me know if there is anything you need on my side. Thanks for all the help!
Hello - I think I've finally succeeded. But it hasn't been easy ! I have committed a possible fix for this wrong behaviour. Can you please test it in your case study ?
Hi Alexis! Thanks so much, I'll be happy to test this :) I am trying to install the Git version to test it but I get an error in launching Gama from Eclipse, I think I am doing something wrong... Would it be possible to do a new release so that I can download it directly?
Thanks @lesquoyb ! I have been testing it today, and my model run for 6h without the cycles or visualizations slowing down!! I will let you know if I find any issue in the future, but it seems to be working well :) Thanks so much for solving this issue @AlexisDrogoul, I really appreciate your help!
Describe the bug I want to have a series chart that runs continuously as part of a demo that is always on. Even if I set
memorize: false
, it keeps slowing down the simulation.To Reproduce I reproduced it on one of GAMA's library models so that it is easier to debug:
Library models > Toy Models > Traffic > models
Simple Traffic Model.gaml
experiment traffic
and add:Expected behavior I would expect it to keep running smoothly
Screenshots Here the duration was 27 ms (top left) while in the beginning it was around 17 ms.
If I let it run for a longer time, the duration of the cycle keeps increasing to 40 ms etc (top left).
Desktop: