bcds.phison.multfailures
Class SIDxPathFailures<V,E>

java.lang.Object
  extended by bcds.phison.multfailures.SID<V,E>
      extended by bcds.phison.multfailures.SIDxPathFailures<V,E>

public class SIDxPathFailures<V,E>
extends SID<V,E>

This class reproduces the effects that the spreading of epidemics according to the SID model have on traffic in a path-oriented network. The methods are designed so that actions are not triggered automatically: the caller is responsible for activating the methods that disable links and remove affected connections.

Author:
Juan Segovia S., based on work originally by Marc Manzano.

Nested Class Summary
 
Nested classes/interfaces inherited from class bcds.phison.multfailures.SID
SID.States
 
Constructor Summary
SIDxPathFailures(TED<V,E> ted, float beta, float delta_1, float tau, float delta_2)
          Creates a new instance that will operate on the given graph and with given rates.
 
Method Summary
 void actOnLinks(int clock)
          Makes sure that all links whose nodes entered into the INFECTED or DISABLED states are also unavailable for traffic in the future.
 void actOnPaths()
          Forcibly releases all connections that are affected by the the fact that a node went into the state DISABLED.
 java.util.Set<V> getNodesPerTransition(SID.States s1, SID.States s2)
          Returns the set of nodes that in this generation transitioned from the state s1 to the state s2.
 java.util.Set<ConnectionInfo<V,E>> getRemovedConnections()
          Returns the set of connections that were forcibly as a consequence of nodes entering the DISABLED state.
 void nextGeneration()
          Produces a new generation of the epidemic by calling SID.nextGeneration() and updates the information of which nodes transitioned from one state to the other.
 
Methods inherited from class bcds.phison.multfailures.SID
getCompartmentSizes, getPrevState, getRandomGen, getState, setRandomGen, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIDxPathFailures

public SIDxPathFailures(TED<V,E> ted,
                        float beta,
                        float delta_1,
                        float tau,
                        float delta_2)
Creates a new instance that will operate on the given graph and with given rates. All nodes are put into the SUSCEPTIBLE state. An instance of java.util.Random is created with default seed. The random number generator can be changed later by calling SID.setRandomGen(java.util.Random).

Method Detail

nextGeneration

public void nextGeneration()
Produces a new generation of the epidemic by calling SID.nextGeneration() and updates the information of which nodes transitioned from one state to the other. Additionally, the set of connections affected in the previous generation is cleared.

Overrides:
nextGeneration in class SID<V,E>

getNodesPerTransition

public java.util.Set<V> getNodesPerTransition(SID.States s1,
                                              SID.States s2)
Returns the set of nodes that in this generation transitioned from the state s1 to the state s2. The caller MUST NOT modify the returned set. Returns null if the given transition is invalid according the SID model (for example, DISABLED->INFECTED).


actOnLinks

public void actOnLinks(int clock)
Makes sure that all links whose nodes entered into the INFECTED or DISABLED states are also unavailable for traffic in the future. This is achieved by calling TED.retireBidiLinks(java.util.Collection). Likewise, links that in the previous generation were unavailable but are now back into operation, are reactivated by calling TED.reinstallBidiLinks(java.util.Collection, int).


actOnPaths

public void actOnPaths()
Forcibly releases all connections that are affected by the the fact that a node went into the state DISABLED. Afterwards, the set of affected connections can be obtained by calling getRemovedConnections().


getRemovedConnections

public java.util.Set<ConnectionInfo<V,E>> getRemovedConnections()
Returns the set of connections that were forcibly as a consequence of nodes entering the DISABLED state. This is only valid after a call to actOnPaths().