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

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

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

This module loads an ElemsSequencer, whose name is provided by the user, and prints to stdout the list of elements (either nodes or links) in the order determined by the sequencer.

Elements are always printed one per line. For nodes, the id is printed, as returned by node.toString(). For links, the two end-nodes are printed, separated by a space character.

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
   PmElemsSequencer.sequencer=SequencerDegree
   PmElemsSequencer.target=link
   END
   ) | java -jar lib/phison.jar Sim -env_file=- -stdm=false -q \
            -num_rep=10 rep_out=some_file_{%d}.out -maxtime=1 \
            -mp=bcds.phison.multfailures \
            -modules=PmElemsSequencer \
            mytopology.sgf
 

Author:
Juan Segovia S.

Field Summary
 java.lang.String DIRECTED
          See getEnvParams().
 java.lang.String SEQUENCER
          See getEnvParams().
 java.lang.String TARGET
          See getEnvParams().
 java.lang.String USE_RANDOM
          See getEnvParams().
 
Constructor Summary
PmElemsSequencer()
           
 
Method Summary
 java.lang.Object[] getEnvParams()
          Returns the list of environment parameters and default values of this class.
 void setup(SimCore<V,E> sim)
          Saves the parameter sim, which can later be obtained by calling the sim() method.
 void shutdown()
          Prints to System.out the elements (nodes or links) in the order determined by the selected sequencer.
 
Methods inherited from class bcds.phison.sim.PmBase
ctx, env, getEnviron, getId, getName, opt, run, sim, stats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEQUENCER

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


TARGET

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


DIRECTED

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


USE_RANDOM

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

Constructor Detail

PmElemsSequencer

public PmElemsSequencer()
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>

shutdown

public void shutdown()
Prints to System.out the elements (nodes or links) in the order determined by the selected sequencer. Elements ared printed one per line.

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

getEnvParams

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

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