Open JasperHavenhand opened 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.
Applying a vertex predicate to a graph, using a filter like PropEquals("infected", "true")
, may be useful for monitoring the dissemination.
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);
}
}
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.
6f02aa42b8a5063c400d2599ce0a5c01b68c8ed8 Need to find a way to prevent the graph being returned until the vertices transformation process is completed.
28184c029adfa7d546672b3991b91897f726bde4 May have to move onto another issue and return to this one at a later date.
Still need to implement a way for the user to specify which vertex will begin with the token.
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.
Changed to only use "infected" and no longer takes the token name as a parameter, only the transfer probability.
Need to find how to implement token dissemination within Gradoop.