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

java.lang.Object
  extended by bcds.phison.sim.PmBase<V,E>
      extended by bcds.phison.multfailures.PmStatic<V,E>
All Implemented Interfaces:
ProcessingModule<V,E>, WithEnvParams

public class PmStatic<V,E>
extends PmBase<V,E>

This module implements static failures, which are defined as one-off failures that affect one or more elements (nodes or links) at any given point. It receives six parameters:

The module affects i_size elements at time step init_time. Elements are selected according to the sequencer given by the user. Elements can be nodes or links, depending on target.

The MTTR represents the average time required to repair a failed element. According to [1] and other online materials, the MTTR is usually treated as a log-normal random variable. In order to assign a MTTR to each element of the network, this module uses RndLogNormal, which needs a mean (mttr_mu) and a standard deviation (mttr_sigma). In the example shown below, the 9 given to mttr_mu could be related with any time unit, for example, hours.

The output of the module are, as a consequence of the failure:

Although this is a "processing module", it is intended to be used primarily alone. Thus, a typical way to invoke it through Sim from command-line is:

   (cat <<END
   PmStatic.target=node
   PmStatic.init_time=1
   PmStatic.i_size=3%
   PmStatic.sequencer=SequencerDegree
   PmStatic.mttr_mu=9
   PmStatic.mttr_sigma=0.5
   END
   ) | java -jar phison.jar Sim -env_file=- -stdm=false -q \
            -num_rep=10 rep_out=some_file_{%d}.out -maxtime=100 \
            -mp=bcds.phison.multfailures \
            -modules=PmStatic \
            mytopology.sgf
 

References:
[1] http://www.nasa.gov/offices/oce/llis/0840.html

Author:
mmanzano

Nested Class Summary
static class PmStatic.States
          The possible states of each element.
 
Field Summary
 java.lang.String I_SIZE
          See getEnvParams().
 java.lang.String INIT_TIME
          See getEnvParams().
 java.lang.String MTTR_MU
          See getEnvParams().
 java.lang.String MTTR_SIGMA
          See getEnvParams().
 java.lang.String SEQUENCER
          See getEnvParams().
 java.lang.String TARGET
          See getEnvParams().
 
Constructor Summary
PmStatic()
           
 
Method Summary
 void actOnPaths(java.util.HashSet<E> links)
          Forcibly releases all connections that are affected by the the fact that a element went into the state NOK.
 void collectConnectionsStats()
          Collects the lost connections statistics for this module.
 java.lang.Object[] getEnvParams()
          Returns the list of environment parameters and default values of this class.
 void reinstallLinks(java.util.HashSet<E> links, int clock)
          Links that in the previous time steps were unavailable but are now back into operation, are reactivated by calling TED.reinstallBidiLinks(java.util.Collection, int).
 void retireLinks(java.util.HashSet<E> links)
          Makes sure that all links are unavailable for traffic in the future.
 void setup(SimCore<V,E> sim)
          Saves the parameter sim, which can later be obtained by calling the sim() method.
 
Methods inherited from class bcds.phison.sim.PmBase
ctx, env, getEnviron, getId, getName, opt, run, shutdown, sim, stats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_TIME

public final java.lang.String INIT_TIME
See getEnvParams().


I_SIZE

public final java.lang.String I_SIZE
See getEnvParams().


SEQUENCER

public final java.lang.String SEQUENCER
See getEnvParams().


TARGET

public final java.lang.String TARGET
See getEnvParams().


MTTR_MU

public final java.lang.String MTTR_MU
See getEnvParams().


MTTR_SIGMA

public final java.lang.String MTTR_SIGMA
See getEnvParams().

Constructor Detail

PmStatic

public PmStatic()
Method Detail

setup

public void setup(SimCore<V,E> sim)
Description copied from class: PmBase
Saves the parameter sim, which can later be obtained by calling the sim() method. It also calls adaptTypes if the environment object is non-null (which should normally be).

Specified by:
setup in interface ProcessingModule<V,E>
Overrides:
setup in class PmBase<V,E>

collectConnectionsStats

public void collectConnectionsStats()
Collects the lost connections statistics for this module.


retireLinks

public void retireLinks(java.util.HashSet<E> links)
Makes sure that all links are unavailable for traffic in the future. This is achieved by calling TED.retireBidiLinks(java.util.Collection).


reinstallLinks

public void reinstallLinks(java.util.HashSet<E> links,
                           int clock)
Links that in the previous time steps were unavailable but are now back into operation, are reactivated by calling TED.reinstallBidiLinks(java.util.Collection, int).


actOnPaths

public void actOnPaths(java.util.HashSet<E> links)
Forcibly releases all connections that are affected by the the fact that a element went into the state NOK.


getEnvParams

public java.lang.Object[] getEnvParams()
Returns the list of environment parameters and default values of this class. They are prefixed by "PmStatic and are:

Specified by:
getEnvParams in interface WithEnvParams
Overrides:
getEnvParams in class PmBase<V,E>