next up previous
Next: Overriding the Generate method Up: Extending BRITE's Java Version Previous: Extending BRITE's Java Version

Passing Parameters to the new model

All parameter passing is done in BRITE via a configuration file. As such, creating your own model first requires modifying the configuration file parser (located at Main/ParseConfFile.java) to handle the parameters of your model. You do not need to write your own parsing routines. The Parse method of the configuration file parser stores all parsed attribute-value pairs of a model in a Hash-table, params. All you need to do is interpret the keys and values in this Hash-table according to the semantics of your model, create your model and return it to the caller. For instance, the RouterWaxman interprets the Hash-table parameters as shown in code excerpt 8.


\begin{Program}
% latex2html id marker 689\footnotesize\begin{verbatim}priv...
...;}\end{verbatim}\caption{Parsing routine for RouterWaxman model}\end{Program}

The Model object is then returned to the main caller (usually the main entry point to BRITE, Main/Main.java), which in turn creates a Topology instance with this newly created model. See code excerpt 9 extracted from Main/Main.java.


\begin{Program}
% latex2html id marker 699\footnotesize\begin{verbatim}//cr...
...}\caption{Model-parameter parsing and Topology instantiation logic}\end{Program}



Alberto Medina 2001-04-12