Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

helloworld.py 599 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  1. import sys
  2. import pandas as pd
  3. from docplex.mp.model import Model
  4. import lightgbm as lgb
  5. import json
  6. par_json_file = open('pars.json','r', encoding='utf-8')
  7. pars_dict = json.load(par_json_file)
  8. m = Model(name='telephone_production')
  9. desk = m.continuous_var(name='desk')
  10. cell = m.continuous_var(name='cell')
  11. m.add_constraint(desk >= pars_dict['desk'])
  12. m.add_constraint(cell >= pars_dict['cell'])
  13. ct_assembly = m.add_constraint(0.2*desk + 0.4*cell <= 400)
  14. ct_painting = m.add_constraint(0.5*desk + 0.4*cell <=490)
  15. m.maximize(12*desk+20*cell)
  16. m.print_information()
  17. m.solve()
  18. m.print_solution()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...