{ "info": { "author": "qx3501332", "author_email": "x.qiu@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# bankrupt\n\n\nInstallation\n---------------\n\nUse one of the following method:\n\n* pip install\n```bash\npip --install bankrupt\npip --install bankrupt --upgrade\n```\n* clone repository and install with:\n```bash\npython setup.py install\n``` \nUsage\n-------\n\n* Solve the balanced transportation problem.\n\n```python\nfrom transportmodels import Transport\nt = Transport()\nt.set_supplies([200, 250])\nt.set_demands([100, 150, 200])\nt.set_cost_matrix([[90, 70, 100], [80, 65, 75]])\nt.solve()\nprint(t.get_solution())\nprint(t.get_objective_value())\n```\n\n* Solve a batch of the balanced transportation problem, using multiple processors.\n\n```python\nfrom transportmodels import TransModel\n# data\nquota_vectors = [[5, 7, 3, -7, -3, -5],\n [5, -7, 3, 7, -3, -5],\n [5, 7, -3, -7, 3, -5],\n [-5, 7, 3, -7, -3, 5]\n ]\n\ncost_matrix = [[0, 0, 0, 3, 1, 100], [0, 0, 0, 4, 2, 4], [0, 0, 0, 100, 3, 3],\n [3, 4, 100, 0, 0, 0], [1, 2, 3, 0, 0, 0], [100, 4, 3, 0, 0, 0]]\n# solver\nt = TransModel()\nt.set_processors(2)\nt.set_quota_vectors(quota_vectors)\nt.set_cost_matrix(cost_matrix)\nt.solve()\n# solutions and objective values\nsolutions = t.get_solutions()\nobjective_values = t.get_objective_values()\n# print info\nfor i in range(len(solutions)):\n print(\"--- problem %d ---\" % i)\n print(\"solution\", solutions[i])\n print(\"objective value\", objective_values[i])\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/xianqiu/TransportModels", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "transportmodels", "package_url": "https://pypi.org/project/transportmodels/", "platform": "", "project_url": "https://pypi.org/project/transportmodels/", "project_urls": { "Homepage": "https://github.com/xianqiu/TransportModels" }, "release_url": "https://pypi.org/project/transportmodels/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Solve the balanced transportation problem with LP (using ortools).", "version": "0.1.0" }, "last_serial": 4510921, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "367f408163a097f828422e63a0a739c7", "sha256": "602b9b39d09ee02ff6d5dd8be3b32cf49879916e1d2a1d086782a13457ea9303" }, "downloads": -1, "filename": "transportmodels-0.1.0.tar.gz", "has_sig": false, "md5_digest": "367f408163a097f828422e63a0a739c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4150, "upload_time": "2018-11-21T06:15:20", "url": "https://files.pythonhosted.org/packages/e2/c4/0099bc89297a9a529208337972e6db997823fb5a830f445a724c5707ccd5/transportmodels-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "367f408163a097f828422e63a0a739c7", "sha256": "602b9b39d09ee02ff6d5dd8be3b32cf49879916e1d2a1d086782a13457ea9303" }, "downloads": -1, "filename": "transportmodels-0.1.0.tar.gz", "has_sig": false, "md5_digest": "367f408163a097f828422e63a0a739c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4150, "upload_time": "2018-11-21T06:15:20", "url": "https://files.pythonhosted.org/packages/e2/c4/0099bc89297a9a529208337972e6db997823fb5a830f445a724c5707ccd5/transportmodels-0.1.0.tar.gz" } ] }