Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError when it draws in real time #1

Open
cristobalmedinalopez opened this issue Mar 23, 2017 · 9 comments
Open

IndexError when it draws in real time #1

cristobalmedinalopez opened this issue Mar 23, 2017 · 9 comments
Labels

Comments

@cristobalmedinalopez
Copy link
Member

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.

@utkarsh858
Copy link

Where have you provided the catching mechanism? I could not find it in the code.

@cristobalmedinalopez
Copy link
Member Author

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.

@utkarsh858
Copy link

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?

@cristobalmedinalopez
Copy link
Member Author

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

@abhay44
Copy link

abhay44 commented Feb 16, 2018

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).

@utkarsh858
Copy link

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.

@abhay44
Copy link

abhay44 commented Feb 17, 2018

@utkarsh858 it works with 2.0.0 version

@sachinsngh165
Copy link
Contributor

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 ?

@vicente-gonzalez-ruiz
Copy link
Member

@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.

vicente-gonzalez-ruiz pushed a commit that referenced this issue Mar 2, 2018
Creado gitignore para el proyecto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants