FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Adding the message callback in Java

The examples demonstrates how to define a messaging callback for the Xpress Optimizer in Java.[download all files]

Source Files
By clicking on a file name, a preview is opened at the bottom of this page.[download]

import com.dashoptimization.*;

public class Callback {
    public void run(String model)
        try (XPRSprob problem = new XPRSprob(null)) {
            problem.setIntControl (XPRS.LPLOG, 1);
            problem.addMessageListener(new DefaultMessageListener());

            problem.readProb (model);
            problem.lpOptimize ("");

    public static void main(String [] args)
        String model = args.length == 0 ? "../data/callback" : args[0];
        Callback c = new Callback (); (model);

Back to examples browserPrevious exampleNext example