mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Add an example that uses directed graphs in Mesa

Open jackiekazil opened this issue 6 years ago • 7 comments

RE: #653

Seems like we need to add an example of directed graphs to Mesa. This might be adjusting how the network module works as well.

You could do this one of two ways.

  1. You could create a directed version of the existing virus on a network example, which would mean that the virus could only move in certain directions.

  2. You could recreate this model: http://ccl.northwestern.edu/netlogo/models/DiffusiononaDirectedNetwork

It seems like #1 would be an easier lift, but I will let you decided what you prefer.

jackiekazil avatar Apr 29 '19 03:04 jackiekazil

I'll work on this.

kennethells avatar May 07 '19 20:05 kennethells

Diffusion on a directed network's code: https://github.com/NetLogo/models/blob/master/Sample%20Models/Networks/Diffusion%20on%20a%20Directed%20Network.nlogo (it's kind of hard to parse because everything is in 1 file without boundaries)

I think it would cover more systems by porting 2) instead.

rht avatar May 22 '19 16:05 rht

I've chipped in by creating a PR that adds arrowheads to the D3.js visualization when "directed": True is added to edge in the portrayal dict inserted in NetworkModule. If this is the desired behavior, I could also code it for sigma. As the initial issue suggested implementing a "directed virus network" example, I've included this as well.

rozenlicht avatar May 17 '20 13:05 rozenlicht

This should be very easy to do with the new pure Python/Solara frontend, since it is essentially doing a NetworkX draw.

rht avatar Sep 26 '23 09:09 rht

@ankitk50 this is another low hanging fruit for warming up. The hardest part would be to find a model that behaves differently with a directed network instead of undirected network. This doesn't have to be from that NetLogo model I linked above.

rht avatar Sep 26 '23 09:09 rht

this sounds interesting, but also complex, I can add this to my list.

ankitk50 avatar Sep 26 '23 11:09 ankitk50

I think one of the version proposed by @jackiekazil should do:

You could create a directed version of the existing virus on a network example, which would mean that the virus could only move in certain directions.

So it is not going to be a drastic modification over virus on a network.

rht avatar Sep 26 '23 13:09 rht