Demo models‎ > ‎MacroABM‎ > ‎

The JAS-mine File Structure

The JAS-mine package and class structure of the MacroABM model is organised as in Table 1. 

Table 1: Class structure

The core of the simulation lies in the model package, which contains the classes MacroModelBank, CFirm and KFirm.  Both the CFirm and KFirm classes are derived from the Firm class, which is itself derived from the Agent class (for more information, see The Class Hierarchy of 'Agents').  The experiment package contains the MacroStart class that specifies to run the simulation in interactive mode, the MacroCollector class that collects all the statistics needed to monitor the simulation and updates the output database, and the MacroObserver class that creates and manages the graphical objects for run-time monitoring (i.e. charts in the Graphical User Interface).  Parameters and coefficients are loaded into the Parameters class in the data package.  The object package contains Java objects of use in the simulation that are not themselves considered 'active' agents, and so are kept separate from the model package.  In fact, classes in this package are in a 'has a' relationship with the agents of the model package; for example, the KFirms make Machine objects to be bought by the CFirms, while the CFirms each have one BalanceSheetCFirm object and the KFirms each have one BalanceSheetKFirm object.  Finally, the algorithms package contains classes that perform technical tasks (in the example, MapSorting has utility methods to sort a map by its values in ascending and descending order, while the APosterioriAdjustments and APrioriAdjustments  contain methods used by CFirms to optimize their investment decisions).  Classes in the algorithms package are meant to be of general use beyond the specific model being developed, and are candidates for inclusion in the core libraries in future releases of JAS-mine.

The project is organised in the standard JAS-mine folder structure, as described in Table 2.

Table 2: File structure

The Java classes are contained in the src folder. The input folder is the directory used to store any input data files needed to run the simulation, such as MS Excel parameter files and the initial population, stored as an h2 database (input.h2). For the MacroABM, no additional input files are required as the initial population is created programmatically within the codebase, and the parameters describing relationships are contained within the Parameters class in the data package.  The output folder is initially empty. For each new simulation experiment, a new subfolder is created with the appropriate time stamp, so as to uniquely identify the experiment (e.g. 20141218151116, for experiments initiated on the 18th December 2014, at 16 seconds after 3.11pm). The subfolder contains a copy of all the input files in the input directory (if any exist) and output data stored in either an output database (out.h2, in the database directory) or .csv file format.

The target folder contains technical content of no immediate interest to the modeller. The root folder also contains a pom (project object model) file, which contains information on the JAS-mine version used for the project. Apache Maven, an open source software project management and comprehension tool uses this information to manage all the project's build, reporting and documentation. In particular, by specifying in the pom file the desired release for each library used (including the JAS-mine libraries), Maven automatically downloads the relevant libraries from the appropriate repositories.  This implies that each JAS-mine project has its own copy of all the libraries used, ensuring that the project is self-contained and that it keeps working exactly as intended even when new versions of the libraries are released (and even if backward compatibility is not respected). 

Previous: Timeline of Events (the Schedule)        Next: The Class Hierarchy of 'Agents'