Conversation
|
@HSMarieK: If I see correctly, |
|
@windisch: That is the case, the |
|
@windisch: Should I clean up the rest of the (now) redundant |
windisch
left a comment
There was a problem hiding this comment.
@HSMarieK: This is just awesome work - thanks a lot for your contribution!
I refactored things a bit and gave the methods more speaking names. Moreover, I also reworked how the visualization-data is handled (formerly, a data list was send to methods and they appended, which I think is not required) - please have a careful look!
| self._view.y += 10 | ||
| class Visualization: | ||
|
|
||
| def __init__( |
There was a problem hiding this comment.
is it possible to have the initial center on the "average position"?
For instance, we could set it to None initially and than use the first data package to compute the average position of stationary objects?
There was a problem hiding this comment.
That could be done. Might be a really simple calculation. I will look into that.
| except Empty: | ||
| break | ||
|
|
||
| def sort_connection_data(self): |
There was a problem hiding this comment.
The data structure looks a bit wired at first glance. At the line object, we stack everything in a big list and then we have to sort it out. Do not have a suggestions right now how to make this smoother - thus fine for now!
There was a problem hiding this comment.
If someone has a better idea, I am open for suggestions. This felt like the most obvious approach to me.
There was a problem hiding this comment.
Instead of sending a list of dicts, we could send an object of a (yet to be implemented) class VisualizationData (or ConnectionData, but I like VisualizationData more, its what it is :-)) where everything can be accessed using attributes?
There was a problem hiding this comment.
Maybe. I went with dicts since I knew they could be serialized. I thought of using a dataclass instead, but I wanted it to work first.
There was a problem hiding this comment.
We can refactor this later - should be no problem to serialize a own class if everything stays pure python.
|
Hey @HSMarieK, You can reproduce it by yourself if you turn up the factor parameter of a line (for example 20 -> 20 seconds until you see the line). |
|
@peerplexit Thanks. I will look into the visualized simulation states. But the halting process by pressing Shift+H is working as intended. This seems slow, since the simulation is sleeping and thus not reacting to user input until it steps again. |
Complete overhaul of the visualization for better human interface.