Skip to content

Commit

Permalink
Remove init that makes a small glitch in the series
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitgaudou committed Feb 15, 2020
1 parent 1cf7868 commit 5c02210
Showing 1 changed file with 10 additions and 30 deletions.
Expand Up @@ -6,30 +6,15 @@
*/
model long_series


global
{
global {
int serie_length <- 1000;
list<float> xlist <- [];
list<float> coslist <- [];
list<float> sinlist <- [];
float base;
init
{
loop i from: 0 to: serie_length
{
base <- float(i);
add base to: xlist;
add cos(base / 1000) to: coslist;
add sin(base / 1000) to: sinlist;
}

}

reflex update_sinchart
{
loop i from: 0 to: serie_length
{
reflex update_sinchart {
loop i from: 0 to: serie_length {
base <- float(serie_length * cycle + i);
add base to: xlist;
add cos(base / 1000) to: coslist;
Expand All @@ -40,21 +25,16 @@ global

}

experiment "Long series" type: gui
{
output
{
display "long_series" type: java2D synchronized: true
{
chart "Long series values" type: series x_label: "#points to draw at each step"

{
data "Cosinus" value: coslist color: # blue marker: false style: line;
data "Sinus" value: sinlist color: # red marker: false style: line;
experiment "Long series" type: gui {
output {
display "long_series" type: java2D synchronized: true {
chart "Long series values" type: series x_label: "#points to draw at each step" {
data "Cosinus" value: coslist color: #blue marker: false style: line;
data "Sinus" value: sinlist color: #red marker: false style: line;
}

}

}

}
}

0 comments on commit 5c02210

Please sign in to comment.