Auto-compiler

Last updated on 16th July 2024

This is an experimental feature!

Experimental features are early versions for users to test before final release. We work hard to ensure that every available Simudyne SDK feature is thoroughly tested, but these experimental features may have minor bugs we still need to work on.

If you have any comments or find any bugs, please share with support@simudyne.com.

Overview

Modelling is an iterative process. Often you will find yourself making many small tweaks during the building and calibrating process. Restarting your server multiple times in a short space of time can be a slow and cumbersome process. The Simudyne auto-compiler allows models to be automatically compiled when changes are made.

Set up

Enabling auto-compilation is as simple as seting a property in the simudyneSDK.properties file.

simudyneSDK.properties

nexus-server.autocompile-root=<root-to-models>

Model duplicate

The path specified here is the location to your model directories. This will cause models to be searched for in this directory automatically. It is, therefore, unnecessary to manually register your models with the server, doing so will mean duplicate models will appear in the console, half of which will not auto-compile.

Directory structure

src/
    main/
        java/
            models/
                mortgagemodel/
                    MortgageModel.java
                tradingmodel/
                    TradingModel.java
                CreditCardModel.java    
            Main.java

If you set the autocompile root to the path src/main/java/models, the autocompiler will search each sub folder, (mortgagemodel, tradingmodel) for models. It will find the MortgageModel and the TradingModel which will both be autocompiled. The CreditCardModel, which is not in a folder will not be found.

Each sub folder inside the autocompile root path is treated as a group. Therefore, if you have multiple models in one subfolder, a change in one of them will cause all of the models in that folder to be recompiled and restarted.

Directory structure

src/
    main/
        java/
            models/
                mortgagemodel/
                    MortgageModel.java
                    TradingModel.java
                    HelpfulClass.java
                credit/
                    CreditCardModel.java  

nexus-server.autocompile-root=src/main/java/models

If any of the three classes (MortgageModel.java, TradingModel.java or HelpfulClass.java) are changed, both MortgageModel and TradingModel will be recompiled and restared, but CreditCardModel will not be recompiled.