Update of /cvsroot/icamodel/icamodel/src/icamodel
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv11230/src/icamodel
Modified Files:
ICAModel.java
Log Message:
First steps towards an XML parameter file
Index: ICAModel.java
===================================================================
RCS file: /cvsroot/icamodel/icamodel/src/icamodel/ICAModel.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ICAModel.java 23 Jun 2007 18:20:20 -0000 1.5
--- ICAModel.java 24 Jun 2007 10:45:12 -0000 1.6
***************
*** 116,122 ****
--- 116,141 ----
/*
* Set up the parameters by hand. Change this to change the parameters.
+ * TODO: allow user to specify which parameter file to use
*/
private static void setParameters() throws ModelException {
+ // Look for the parameter file. Should be data/params.xml
+ String fileName = "params.xml";
+ String dirName = "data";
+ File paramFile = new File(dirName + File.separator + fileName);
+
+ System.out.println("Reading parameter file " + fileName);
+ Parameters theParams = Parameters.getInstance();
+ theParams.readParamFile(paramFile);
+
+ // We now have a DOM Document containing all the parameters.
+ // we could look at it, but the viewer isn't that helpful
+ // Also, it disappears when the program exits
+ // TODO: different option for running the system, just lets you view
+ // the model set up.
+ // TODO: extend the viewer so you can edit the param file?
+ // DOMEcho.makeFrame(theParams.getParamTree());
+
+
// global parameters
ModelRoot root = ModelRoot.getInstance();
|