|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.multfailures.SID<V,E>
public class SID<V,E>
This class implements the spreading of epidemics on a network as defined by the SID model. That model is described in:
E. Calle, J. Ripoll, J. Segovia, P. Vila and M. Manzano. "A multiple failure propagation model in GMPLS-based networks". Network, IEEE 24(6):17-22, November-December 2010.
By design, this class is minimalistic: it covers the state transitions
experimented by individuals as the epidemic evolves, but the effects
of such transitions on the traffic dynamics over the network are not taken
into account. Instead, that aspect is implemented by
SIDxPathFailures
.
Several alternatives where evaluated to represent the node states (a byte array, a "bit-field" array, several bitsets, etc.) and this one came out the fastest (and the simplest): it uses two HashMap objects to represent the current and previous state of nodes.
In this class, "node" and "individual" are used interchangeably.
Nested Class Summary | |
---|---|
static class |
SID.States
The possible states of each node. |
Constructor Summary | |
---|---|
SID(SimGraph<V,E> g,
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 | |
---|---|
java.util.Map<SID.States,java.lang.Integer> |
getCompartmentSizes()
Returns the number of nodes per state, that is, the size of the compartments into which the population is decomposed. |
SID.States |
getPrevState(V v)
Returns the previous state of node v . |
java.util.Random |
getRandomGen()
Returns the current random number generator. |
SID.States |
getState(V v)
Returns the current state of node v , or null
if v does not exist (seemingly a programming error). |
void |
nextGeneration()
Computes the new state for each node, that is, produces a new "generation" of the epidemic. |
void |
setRandomGen(java.util.Random rnd)
Sets rnd as the random number generator to be used
afterwards. |
void |
setState(V v,
SID.States st)
Sets the current state of the node v to
st . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SID(SimGraph<V,E> g, float beta, float delta_1, float tau, float delta_2)
setRandomGen(java.util.Random)
.
Method Detail |
---|
public void setRandomGen(java.util.Random rnd)
rnd
as the random number generator to be used
afterwards. It must not be null.
public java.util.Random getRandomGen()
public SID.States getState(V v)
v
, or null
if v does not exist (seemingly a programming error).
public void setState(V v, SID.States st)
v
to
st
. The previous state remains unchanged.
public SID.States getPrevState(V v)
v
.
public void nextGeneration()
public java.util.Map<SID.States,java.lang.Integer> getCompartmentSizes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |