|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.multfailures.ElemsSequencerBase<V,E>
bcds.phison.multfailures.SequencerFromFile<V,E>
public class SequencerFromFile<V,E>
This class returns nodes and links in the order they appear in files (one file for nodes, and another for links). Filenames are passed through environment parameters. Note that, contrary to other sequencers, this class may not return all the nodes or links in the topology; it returns those found in the provided files.
Field Summary | |
---|---|
java.lang.String |
LINKS_FILENAME
See getEnvParams() . |
java.lang.String |
NODES_FILENAME
See getEnvParams() . |
Constructor Summary | |
---|---|
SequencerFromFile()
Default constructor. |
|
SequencerFromFile(TED<V,E> ted,
Environ env)
Creates a new instance and calls setup to complete the initialization. |
Method Summary | |
---|---|
java.util.List<E> |
arrangeDirectedLinks(java.util.Random rnd)
Returns a list of links, just as arrangeUndirectedLinks(java.util.Random) , but links
are treated as directed, that is, only the links that effectively
appear in the file are returned. |
java.util.List<V> |
arrangeNodes(java.util.Random rnd)
Returns a list of nodes read from the file whose name is given in the environment parameter SequencerFromFile.nodes_filename. |
java.util.List<E> |
arrangeUndirectedLinks(java.util.Random rnd)
Returns a list of links read from the file whose name is given in the environment parameter SequencerFromFile.links_filename. |
java.lang.Object[] |
getEnvParams()
Returns the list of environment parameters and default values of this class. |
Methods inherited from class bcds.phison.multfailures.ElemsSequencerBase |
---|
getEnviron, getName, setup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String NODES_FILENAME
getEnvParams()
.
public final java.lang.String LINKS_FILENAME
getEnvParams()
.
Constructor Detail |
---|
public SequencerFromFile()
public SequencerFromFile(TED<V,E> ted, Environ env)
Method Detail |
---|
public java.util.List<V> arrangeNodes(java.util.Random rnd)
DataFileReader
.
Node ids must appear one per line.
The parameter rnd
is ignored; it may be null.
arrangeNodes
in interface ElemsSequencer<V,E>
arrangeNodes
in class ElemsSequencerBase<V,E>
IOException
- wrapped in AnyException if the
file cannot be read, or any exception is thrown while
reading it.
java.lang.IllegalArgumentException
- if a given node id cannot be found
in the topology, or a node appears more than once in the file.public java.util.List<E> arrangeUndirectedLinks(java.util.Random rnd)
DataFileReader
.
Links are given by a pair of node ids, one pair per line, and
are considered "undirected" in the sense that the pair of nodes
a b implies the pair b a.
If preserving link directionality is important, use
arrangeDirectedLinks(java.util.Random)
instead. Note, however, that that
method is not part of the ElemsSequencer interface.
The parameter rnd
is ignored; it may be null.
arrangeUndirectedLinks
in interface ElemsSequencer<V,E>
arrangeUndirectedLinks
in class ElemsSequencerBase<V,E>
IOException
- wrapped in AnyException if the
file cannot be read, or any exception is thrown while
reading it.
java.lang.IllegalArgumentException
- if the environment parameter
links_filename is empty, a given link cannot be found
in the topology, or a link appears more than once in the file.public java.util.List<E> arrangeDirectedLinks(java.util.Random rnd)
arrangeUndirectedLinks(java.util.Random)
, but links
are treated as directed, that is, only the links that effectively
appear in the file are returned.
arrangeDirectedLinks
in interface ElemsSequencer<V,E>
arrangeDirectedLinks
in class ElemsSequencerBase<V,E>
public java.lang.Object[] getEnvParams()
nodes_filename
: Filename containing the node id to be read.
links_filename
: Filename containing the edges to be read.
getEnvParams
in interface WithEnvParams
getEnvParams
in class ElemsSequencerBase<V,E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |