simulator
simulator copied to clipboard
IndexError when it draws in real time
A IndexError occurs randomly in the draw function when it is drawing in real time (while it is simulating). It could be because it reads a new line when the line is not fully written, so it splits something in a wrong way, causing that m doesn't have a correct format (there are missing elements).
Now it is catched, but with no action. Maybe we could repeat the reading of the same line in this case.
Where have you provided the catching mechanism? I could not find it in the code.
We finally commented the catching part (see simulator.py from line 347 to 363), because we force to sleep for 2 seconds before starting to draw.
Hey, I did some modifications to the code to correct the problem but I am not able to simulate it to test. By running simulator with drawing_file option nothing shows up. Are there any pre-requisites for running simulation i.e. I am doing something wrong? Or maybe can you test the modified code?
What if you try to run it separately, for example: Simulate it first:
python3 simulator.py run --number-of-monitors 1 --number-of-peers 4 --number-of-rounds 100 --set-of-rules dbs --drawing-log test.draw
And then draw it:
python3 simulator.py draw --drawing-log test.draw
Does this error happens once in a while? because when I try to draw the simulation in real time without sleeping for 2 seconds, simulation is running in fine without any errors and also I uncommented the catching part(lines 347 to 363).
It seems that the simulator does not draw with the matplotlib version 2.2.1. As simulator did not show any graph. This issue #13 also addresses the same. The older versions are also not available on the internet. Maybe will have to build the 1.5.1 version.
@utkarsh858 it works with 2.0.0 version
Hey!, when i'm running the simulation in real time, nothing is drawing up but showing Python quit unexpectedly error even though log filed created successfully . Command Used:
sachinsingh$ python3 simulator.py run --number-of-monitors 1 --number-of-peers 4 --number-of-rounds 100 --set-of-rules dbs --drawing-log test.draw --gui
Even when i'm drawing it directly from the file that i've created from previous step, it is showing nothing but freezed graphs. Command used:
python3 simulator.py draw --drawing-log test.draw
OS : MacOS Sierra 10.12.6
matplotlib 2.0.0 .
What is the problem ?
@sachinsngh165, the code which renders the graphics of the simulation does not work properly with the last versions of matplotlib. This is your problem and the title of this issue. Besides, matplotlib seems to be quite slow for plotting large experiments. For this reason, we are searching an alternative for matplotlib.