This is an old revision of the document!


PHP's gd library is missing or unable to create PNG images

Dinamica EGO script language and console launcher

What will you learn?

  • Naming variables with alias
  • Dinamica EGO programming language
  • Dinamica EGO Console launcher

As a model becomes more and more complex, you may find useful to save it in EGO format to keep developing the model using EGO programming language on a text editor, (e.g. NotePador Context). For example, the Amazon logging model [[http://dx.doi.org/10.1007/s00267-009-9337-1 format, e.g. Notepad++, available on http://notepad-plus.sourceforge.net) the model “simulate_deforestation_from_1997_2000_30years_ahead.ego”. The EGO script is as follows:

Now that you have learned a bit about programming with EGO script language, another resource available in Dinamica EGO is the Console Launcher. Any model saved in Dinamica EGO, either XML or EGO, can be run from the command prompt. Running the model from the command prompt increases model performance, as the model becomes free of the burden of the graphical interface. In addition, from the command prompt, Dinamica EGO takes advantage of multiprocessor architecture, either splitting execution pipelines on different processors or running several functors’ internal algorithms using parallel processing. Therefore, execution becomes much faster. Depending on the amount of data loaded in the memory, it is also possible to disable disk swapping.

TIP: Windows 32 bits only handles up to 3 gigabytes of memory for a single process.

To facilitate running a model from the command prompt, we have developed a Console Launcher tool. Its use is strongly advised for complex models and others with large amount of data. Also, Console Launcher allows for queuing models and running them sequentially Call the Console Launcher from the tools subfolder in the Start/Programs/Dinamica EGO shortcut. It will open the following interface.

Some parameters of Console Launcher are:

-Model: name of the model

-Scheduler: how the model functors are going be sequenced

-Verifier: Type of script verification

-Log Level: Maximum level of log report

-Use Predefined seed: Check it to use a predefined seed to generate random numbers

-Processors: number of processors that model will use ( Use 0 to automatically detect the number available)

-Run Model: Check it to run model completely

You can save the Console Launcher configuration into a batch file too. This is useful in case you want to couple Dinamica EGO with other software.

TIP: another way to loosely couple other computer programs with Dinamica EGO is by means of functor Run External Process, available in the Control Tab. By using this functor, you will be able to make a call to an external program from within Dinamica, pass to this program intermediate results and feed its output back again into the Dinamica EGO model.

Next Session