from docplex.mp.model import Model

mdl = Model(name='buses')
nbbus40 = mdl.integer_var(name='nbBus40')
nbbus30 = mdl.integer_var(name='nbBus30')
mdl.add_constraint(nbbus40*40 + nbbus30*30 >= 300, 'kids')
mdl.minimize(nbbus40*460 + nbbus30*360)

sol=mdl.solve()

for v in mdl.iter_integer_vars():
    print(v," = ",v.solution_value)

sol.export_as_mst(path="C:/temp/", basename="file.mst")

"""

generates mst file

<?xml version = "1.0" standalone="yes"?>
<!-- This file has been generated by DOcplex version 2.11.176  -->
<!-- Write level is WriteLevel.Auto -->
<CPLEXSolution version="1.0">
 <header
   problemName="buses"
   objectiveValue="3480"
  />
 <variables>
  <variable name="nbBus40" index="0" value="6"/>
  <variable name="nbBus30" index="1" value="2"/>
 </variables>
</CPLEXSolution>

"""
