Open aPlacuzzi opened 3 years ago
The problem here is currently unavoidable: Alchemist requires LinkingRules to be bi-directional. I'm converting this issue to a call for asymmetric neighborhoods: fixing the issue reported would break the simulator, as the engine and its dependency management system assumes an undirected graph.
When a node is removed, all the nodes in its neighbourhood are notified of this event and remove it from their neighbourhood. With an asymmetric
linkingRule
policy a node (N) can have the node to remove (NR) in its neighbourhood, but N could not be in the neighbourhood of NR. So, N continues to believe that NR is its neighbour. If this happens and N changes position, the neighbourhoods are updated, and also the NR neighbourhood is updated, but it doesn't exist anymore andAbstractEnironment.getNeighborhood
throw theIllegalArgumentException
.