0

I am using jupyter notebook to animate a marker that moves along an ant path. I am using ipyleaflet and ipywidgets. I have added a slider widget (speed_slider) to my map, to allow me change the speed of the animation. My animation is using a for loop code as shown in below code.

for i in ant_path.locations:
    mark.location = i
    sleep(speed_slider.value)

I am able to set the animation speed before running the cell that contains the above for loop code, but I am not able to change the speed during animation. Please any suggestions on how change the animation speed during the animation runtime, using the slider.

Oao
  • 121
  • 7
  • Please share your whole code. If the animation is causing blocking then the speed will not be able to be changed whilst the animation is running. – ac24 Sep 13 '21 at 17:01
  • @ac24, thanks for your request. The full code is uploaded on github https://github.com/Oao2021/simulation-edge-computing.git The slider(Run Speed) and other sliders are only adjustable before running the python script for the simulation (in cell 22). I want to adjust the speed and other sliders during simulation run time, i.e. the sliders should be able to adjust the model parameters during run time – Oao Sep 15 '21 at 09:50
  • the base-model.ipynb can be used – Oao Sep 15 '21 at 09:51

0 Answers0