AnsweredAssumed Answered

distinct submodels

Question asked by mahbeens@gmail.com on Jun 8, 2015
Latest reply on Jun 11, 2015 by mahbeens@gmail.com

Dear all,

 

I recently started working with Xpress and I am trying to solve a branch and price model with two distinct pricing problems, where one submodel corresponds to variables k if k is smaller than a particular value and the other if k is greater than a particular value. Is it possible to create such two models and let them run and correspond to the master model simultaneously? For instance, (a part of the code of) what I tried to do is:

 

parameters:

NCRANEL = 2

NCRANER = 2

 

SUBMOD1 = "Sub1"

SUBMOD2 = "Sub2"

end-parameters

 

declarations

CRANEL=1..NCRANEL

CRANER=NCRANEL+1..NCRANER+NCRANEL

end-declarations

 

res1:= compile("g", SUBMOD1 + ".mos")
res2:= compile("g", SUBMOD2 + ".mos")

 

 

forall(k in CRANEL) do
load(submod(k), SUBMOD1 + ".bim")
modid(getid(submod(k))):=k
run(submod(k), "Crane=" + k + ", CRANEL=" + NCRANEL + ",BAY="+HBAY + ",BLOCK="+BBLOCK)
end-do
forall(k in CRANER) do
load(submod(k), SUBMOD2 + ".bim")
modid(getid(submod(k))):=k
run(submod(k), "Crane=" + k + ", CRANER=" + NCRANER + ",BAY="+HBAY + ",BLOCK="+BBLOCK)
end-do

 

But that does not seem to be the right way. How do I need to tackle such a problem?

 

Thanking you in advance!

 

Marie-Anne

Outcomes