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

Neighbour representation needs to be changed #6

Open
cpranav93 opened this issue Jun 27, 2023 · 1 comment
Open

Neighbour representation needs to be changed #6

cpranav93 opened this issue Jun 27, 2023 · 1 comment

Comments

@cpranav93
Copy link
Contributor

Currently, there are multiple for loops required in order to identify neighbours of any given agent. This is because the network ids and the agent unique_ids do not correlate with each other and thus requires an extensive search through the whole list to identify the correct agent associated with a neighbour node.

This could be fixed using (we need to try!):

  1. Networkx: set_node_attributes function which might present a 1-1 relation between agent and network nodes
  2. Use dgl to redefine the network so that this is no longer necessary.

Currently we saw a 10% speedup by adding a break statement in the for loops to remove unnecessary iterations. We foresee another 10% speedup by changing the above.*

    • The change was noted for 500 agents simulated for 125 time-steps. Time went from 615s down to 540s
@vmgaribay
Copy link
Contributor

I think it would be excellent if we could move forward with DGL, since that seems to be the direction most suited to future activities as well.

cpranav93 pushed a commit that referenced this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants