Skip to content

Neighbour representation needs to be changed #6

@cpranav93

Description

@cpranav93

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions