Syntax for Mosel PREINTSOL callbacks?

140 Views Asked by At

I'm new to Xpress Mosel after working with CPLEX with quite some time. I want to solve a vehicle routing problem with callbacks in Mosel and Xpress natively.

model VRPSPD
uses "mmxprs", "mmsystem", "mmsheet"   
forward procedure break_subtours(isheur:boolean,cutoff:real) 
!implementation VRP except subtours
setcallback(XPRS_CB_PREINTSOL, "break_subtours(false,0.01)") 
minimize(obj)
procedure break_subtours(isheur:boolean,cutoff:real)
!subtour separation
!insert cuts
end-procedure 

So far, I get the error message: "Wrong procedure type for callback PREINTSOL" (but https://www.fico.com/fico-xpress-optimization/docs/latest/mosel/mosel_lang/dhtml/setcallback.html specifies to use exactly this) I found that there is something like cbsetcutoff, but I don't know how to use it just yet.

I haven't found any code example for using PREINTSOL. Can you point me to an example implementation which I can use?

THANK YOU :)

1

There are 1 best solutions below

0
On BEST ANSWER

Subroutines used in callbacks need to be 'public', so in your example:

forward public procedure break_subtours(isheur:boolean,cutoff:real)

...

public procedure break_subtours(isheur:boolean,cutoff:real)

You can find several Mosel examples implementing callbacks for cut generation here:

Xpress Examples Database - Mosel - Solving techniques ( https://examples.xpress.fico.com/example.pl#mosel_solv )