PIANOS.io
Class ComputationalModelParser

java.lang.Object
  extended by PIANOS.io.ComputationalModelParser

public class ComputationalModelParser
extends java.lang.Object

The PIANOS parser Reads input files with readModel and returns the corresponding model.


Field Summary
static java.util.HashMap<Variable,java.lang.String> spatAffectedMap
          Public for testing purposes, do not modify.
static java.util.ArrayList<Variable> toBeChecked
          Public for testing purposes, do not modify.
 
Method Summary
static ComputationalModel modelTestOnly(java.lang.String modelFileName, java.lang.String proposalFileName, DistributionFactory factory)
           
static Variable parseVariable(java.io.File file, boolean isInteger, java.lang.String toParse, java.util.HashMap<java.lang.String,Variable> variableMapper, DistributionFactory fact)
          Reads a variable definition line and returns a representation of the variable, public for testing purposes.
static ComputationalModel readModel(java.lang.String modelFileName, java.lang.String initialValueFileName, java.lang.String simulationFileName, java.lang.String proposalFileName, java.lang.String updateFileName, java.lang.String toOutputFileName, DistributionFactory factory)
          The main interface for the Parser.
static ComputationalModel testNoInitialValues(java.lang.String modelFileName, java.lang.String simulationFileName, java.lang.String proposalFileName, java.lang.String updateFileName, java.lang.String toOutputFileName, DistributionFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toBeChecked

public static java.util.ArrayList<Variable> toBeChecked
Public for testing purposes, do not modify.


spatAffectedMap

public static java.util.HashMap<Variable,java.lang.String> spatAffectedMap
Public for testing purposes, do not modify.

Method Detail

modelTestOnly

public static ComputationalModel modelTestOnly(java.lang.String modelFileName,
                                               java.lang.String proposalFileName,
                                               DistributionFactory factory)
                                        throws java.io.IOException,
                                               SyntaxException,
                                               MissingDistributionException
Throws:
java.io.IOException
SyntaxException
MissingDistributionException

testNoInitialValues

public static ComputationalModel testNoInitialValues(java.lang.String modelFileName,
                                                     java.lang.String simulationFileName,
                                                     java.lang.String proposalFileName,
                                                     java.lang.String updateFileName,
                                                     java.lang.String toOutputFileName,
                                                     DistributionFactory factory)
                                              throws java.io.IOException,
                                                     SyntaxException,
                                                     MissingDistributionException
Throws:
java.io.IOException
SyntaxException
MissingDistributionException

readModel

public static ComputationalModel readModel(java.lang.String modelFileName,
                                           java.lang.String initialValueFileName,
                                           java.lang.String simulationFileName,
                                           java.lang.String proposalFileName,
                                           java.lang.String updateFileName,
                                           java.lang.String toOutputFileName,
                                           DistributionFactory factory)
                                    throws java.io.IOException,
                                           SyntaxException,
                                           MissingDistributionException
The main interface for the Parser. All filenames are valid with a relative path.

Parameters:
modelFileName - the name of the model file
initialValueFileName - the name of the initial values file
simulationFileName - the name of the model file
proposalFileName - the name of the proposal distributions file
updateFileName - the name of the variables update strategy file
toOutputFileName - the name of the to_output file
factory - the DistributionFactory with the user distributions used
Returns:
the complete model data structure constructed from the files given.
Throws:
java.io.IOException
SyntaxException
MissingDistributionException

parseVariable

public static Variable parseVariable(java.io.File file,
                                     boolean isInteger,
                                     java.lang.String toParse,
                                     java.util.HashMap<java.lang.String,Variable> variableMapper,
                                     DistributionFactory fact)
                              throws SyntaxException,
                                     MissingDistributionException
Reads a variable definition line and returns a representation of the variable, public for testing purposes. Do not call directly.

Throws:
SyntaxException
MissingDistributionException