Write Your Model

If you want to write your own model, you are free to modify the OSDEA Library. This page shows the key areas of the library to edit in order to add your own model. Because OSDEA is still a failry young library and project, please consider sharing your modifications if you can! You can find details on how to contact us on the About Page.

Code Changes
In order to code your own DEA model with OSDEA, you should follow the process detailed below. The example illustrates what could be added to the SBM model to write the SBM-GRS Model (Slack Based Model under General Return to Scale). All models extend the Model class. In order for the model to work, you will need to override the createAndSolve method.

Add the new model to the dea package in the ModelType.java enum. Following the example above, you will need to add the corresponding parameters (type of efficiency, model description...) as follows:

Create a new Model Class in the deaModels package or modify an existing class (The only changes necessary to the SBM class consisted in adding the code corresponding to the two extra rows for the GRS constraints in the SBM class):

Because the SBM class inherits its solve method from the Model class, this is all what needed to create the GRS version of the SBM model. If you are creating a new model, your own model class should extend the Model class. In most situations, you should be able to use the inherited solve method although in rare cases this is not ideal. For example, it is not a good idea to call the createAndSolve method at each evaluation for the SBM Output oriented model as the constraints array created is the same for all the optimisations. This is why the SBM_O class overrides the solve method.

Optional: you might also want to add the appropriate tests in the tests package. To do so, you can easily copy and paste an existing test class.

These modifications do not generally take very long. If you are familiar with the code and with your DEA model and if your model only requires small changes to an existing model, writing your own model should only take you between 30 minutes to an hour. If you can, don't forget to share your modifications ([mailto:opensourcedea@gmail.com email])!.