Quantcast

How to use: createComplementaryEdges() and synchEdges()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to use: createComplementaryEdges() and synchEdges()

Martin Dimitrov
Hello, 

I have a graph, in which edges are created between local and non-local agents. 
I have been following the example from RepastHPC Tutorial on how to "connectAgentNetwork()" (https://repast.github.io/hpc_tutorial/RepastHPC_Demo_02_Step_02.html, but I have had issues with this approach - I believe that not all edges get added correctly, even thought I do request all the remote agents before adding edges. 

After further reading of the documentation and the API, I think that the "connectAgentNetwork()" example in the Tutorial only works if all the agents are local. It appears to me, that I should use createComplementaryEdges() and synchEdges() if I need to create edges between local and remote agents. Is that correct? 

Unfortunately, I am getting a bit confused with how exactly to incorporate those 2 functions in my code. I realize that this is a huge ask, but would it be at all possible to provide a "connectAgentNetwork" example in the case that some agents are remote? 


Also, a quick question on a separate topic. If I use the function moveAgent( const AgentId & id, int process)  to move an agent to a different rank, does that automatically update the AgentId.CurrentRank ? 


Thank you so much!
Martin


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use: createComplementaryEdges() and synchEdges()

Murphy, John T.

Martin,

 

createComplementaryEdges and synchEdges are deprecated. They remain in the code but should not be used.

 

There is an important step that is omitted in the tutorial. After connecting the edges that involve non-local agents, you must call synchronizeProjectionInfo:

 

    repast::RepastProcess::instance()->synchronizeProjectionInfo<RepastHPCDemoAgent, RepastHPCDemoAgentPackage, RepastHPCDemoAgentPackageProvider, RepastHPCDemoAgentPackageReceiver>(context, *provider, *receiver, *receiver);

 

This is included in steps 3 and 4 of the tutorial, but missing in step 2. We will fix this. An updated version of the tutorial will be posted that will include the revision (however it may take some time- next week is likely). In the absence of a complete example, I hope the text of this email helps you resolve the issue.

 

The process of synchronizing projection information acts on spatial and network projections. In both cases, non-local agents are (or may be) discarded from the local process during synchronization. Agents that are non-local are retained on the process if:

 

-          They are nearby in space, i.e. within the ‘buffer zone’ of the process’s spatial boundaries (on any spatial projection)

-          They are connected by a network link to a local agent in any network projection

 

Note that the agents are not necessarily ‘retained’; they may (or may not) be deleted and replaced with more current copies from their original processes.

 

Your issue should be resolved with the following sequence:

 

Request the non-local agents from other processes

Make network links from local to non-local agents (also local-local, but this doesn’t affect your example. However, connections from non-local to other non-local agents are NOT retained.)

Call ‘synchronizeProjectionInfo’ as above.

 

Non-local agents that are not involved in network links to local agents will be removed (unless they are required by another spatial or network projection; for the tutorial, however, there is only one projection).

 

Additionally, when links are synchronized on a given process, and a link involves a non-local agent from another process, the synchronization algorithm creates a complementary link on the other process, which will thereafter have a copy of the original ‘local’ agent. (That is, On process X a local agent A is connected to a non-local agent B from process Y; after synchronization, process X includes the local A, the non-local B, and the link between them; process Y also contains its local agent B, the non-local agent A, and the link between them.)

 

Thereafter, whenever the network is changed (adding or removing links), another call to synchronize is required. Typically this is done every time step, but may also be done multiple times within a time step. When other projection information also changes- say, agents moving in space- the call to synchronize projection information will make all relevant changes so that all processes have the current image of the network and all projections.

 

Hope this helps- sorry about the confusion.

 

Best,

John

 

 

John T. Murphy
Computational Social Scientist
Argonne National Laboratory
& University of Chicago
Computation Institute
[hidden email]
630-252-3453

 

From: Martin Dimitrov <[hidden email]>
Date: Sunday, April 30, 2017 at 2:26 PM
To: "[hidden email]" <[hidden email]>
Subject: [Repast-interest] How to use: createComplementaryEdges() and synchEdges()

 

Hello, 

 

I have a graph, in which edges are created between local and non-local agents. 

I have been following the example from RepastHPC Tutorial on how to "connectAgentNetwork()" (https://repast.github.io/hpc_tutorial/RepastHPC_Demo_02_Step_02.html) , but I have had issues with this approach - I believe that not all edges get added correctly, even thought I do request all the remote agents before adding edges. 

 

After further reading of the documentation and the API, I think that the "connectAgentNetwork()" example in the Tutorial only works if all the agents are local. It appears to me, that I should use createComplementaryEdges() and synchEdges() if I need to create edges between local and remote agents. Is that correct? 

 

Unfortunately, I am getting a bit confused with how exactly to incorporate those 2 functions in my code. I realize that this is a huge ask, but would it be at all possible to provide a "connectAgentNetwork" example in the case that some agents are remote? 

 

 

Also, a quick question on a separate topic. If I use the function moveAgent( const AgentId & id, int process)  to move an agent to a different rank, does that automatically update the AgentId.CurrentRank ? 

 


Thank you so much!

Martin

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...