Skip to content

How To Load A Model

Marcel Heinz edited this page Feb 3, 2017 · 1 revision

This is a small guide on how to retrieve the model information, if you want to reuse the checker's code. Basically all you have to do is look at the uploaded tests.

  1. Download the .jar file.

  2. Add the library to your build path

  3. Remember that the ModelLoader loads the Prelude using the relative file path "../models/Prelude.megal". Thus, set your project up in an appropriate folder hierarchy. I advise you to have your own project inside of the megalib folder. You have to ignore it for megalib's local Git then!

  4. Follow the instructions below:

      ModelLoader ml = new ModelLoader(); //initializes the managing object
      ml.loadFile(path); //<path> has to be replaced by the filepath to your file 
      MegaModel model = ml.getModel(); //returns the model with the dictionaries
      model.getInstanceOfMap(); //All Getters should be self-explanatory
    

Clone this wiki locally