Re-compiling the Model
Using the ECCO Modelling Software
This is advanced stuff, and will not be required for normal operation of the model. I include it for the adventurous modeller who wishes to poke about under the bonnet of the ECCO model.
Installation
You will need to install (in the following order). Follow the hyperlinks to each for detailed instructions:
Java Development Kit
Uncle Unc ECCO packages
Jython Scripting Language
Ant Build System
Procedure for Rebuilding the Model
The model is initially specified in Professional Dynamo syntax. Dynamo was a commercial system dynamics program, now no longer supported nor sold by its current owners. This situation is part of what led me to develop my own simulation engine. The dynamo listing is relatively easy to read, apart from the fact that variable names are restricted to seven characters. A full explanation of dynamo lies outside the scope of this document.
To execute a dynamo model inside the java simulator, I perform the following steps:
Produce a large java source file from the dynamo listing, using acustom parser program that I have written in java. This source file defines a subclass of an abstract BaseModel class, extending it to define all the relationships between variables described in the dynamo code.
Compile that source file into java bytecode using the java compiler program that ships with the Sun Java Development Kit. Rather than using the compiler directly, I invoke the Ant build tool, which compiles any generated model source code as part of my build process for the 'Uncle Unc' project.
Re-run the simulator program (either graphical or batch, or both) to interact with the altered model.
Instructions
That's the theory. Here's a 'cookbook' approach to taking each of the above steps for yourself.
Open a DOS/Command window, and change to the 'eirecco' directory copied from the CD (c:\eirecco will be assumed for the rest of these instructions). The parser is invoked from the command line in directory c:\eirecco as (all one long line):
java ulu.sim.dyn.parser.Parser (dynamo script) (java class to make listing for) (root of java source tree)
for example
java ulu.sim.dyn.parser.Parser scripts/dyn/eiapr02.dyn ulu.sim.dyn.models.eirecco src
This converts the model described in c:\eirecco\scripts\dyn\eiapr02.dyn into the source for a java executable model that describes a class called 'eirecco' in package 'ulu.sim.dyn.models', stored in the file c:\eirecco\src\ulu\sim\dyn\models\eirecco.java. In this location, it will automatically be compiled next time the ant script is invoked.
Staying in the dos prompt in c:\eirecco, enter the command:
ant -buildfile ulubuild.xml
If ant is correctly set up, this will begin a process that generates several lines of text. At the end, if ant reports success, a directory c:\unc\classes will be created. This will include the compliled 'mymodel' object, as c:\eirecco\classes\ulu\sim\dyn\models\mymodel.class, along with every other class file needed to run the graphical and command-line simulators. All the newly-generated files are in the right places, and can be run by following the instructions for the graphical or batch programs.
|