JasperHavenhand / Honours-Year-Project

COMP390 - Honours Year Project: Temporal Network (Re-)Design Strategies for Early Epidemic Containment
0 stars 0 forks source link

Token dissemination #8

Open JasperHavenhand opened 3 years ago

JasperHavenhand commented 3 years ago

Need to find how to implement token dissemination within Gradoop.

JasperHavenhand commented 3 years ago

Could use the metadata.csv to define a Boolean "infected" property for the vertices. The PropagatePropertyToNeighbor operator may be useful for disseminating this.

JasperHavenhand commented 3 years ago

Applying a vertex predicate to a graph, using a filter like PropEquals("infected", "true"), may be useful for monitoring the dissemination.

JasperHavenhand commented 3 years ago

The PropagatePropertyToNeigbor operator copies the property from vertices with a given label. The issue is that, currently, the vertices all have the same label. Another approach may be to see if a pattern matching query can be constructed which returns all vertices with infected neighbours. It may then be possible to iterate through these, which would allow for applying a percentage chance of each one becoming infected, i.e.:

for (TemporalVertex vertex: filteredGraph.getVertices().collect()) {
    int randomPercent;
    // set randomPercent
    if (randomPercent <= infectionRate) {
        vertex.setProperty("infected", true);
    }
}
JasperHavenhand commented 3 years ago

Current idea is to create a TemporalGraphHandler class that takes a TemporalGraph and an transmission risk as its parameters. It can then store this a private variable called something like completeGraph . There can then be a method called nextTimeStep that updates a currentGraph variable to a snapshot of the completeGraph for the next timestep. That is, all edges that are active at that time. In the same method, it can perform the token dissemination with the given transmission risk used as the probability for each infection occurring.

JasperHavenhand commented 3 years ago

6f02aa42b8a5063c400d2599ce0a5c01b68c8ed8 Need to find a way to prevent the graph being returned until the vertices transformation process is completed.

JasperHavenhand commented 3 years ago

28184c029adfa7d546672b3991b91897f726bde4 May have to move onto another issue and return to this one at a later date.

JasperHavenhand commented 3 years ago

Still need to implement a way for the user to specify which vertex will begin with the token.

JasperHavenhand commented 3 years ago

Realised that the vertices are given the Boolean property "infected" when a graph is created but the disseminate method uses the name of the user specified token as the property.

JasperHavenhand commented 3 years ago

Changed to only use "infected" and no longer takes the token name as a parameter, only the transfer probability.