add data file to rcpsp notebook
This commit is contained in:
@@ -3,9 +3,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from __future__ import print_function\n",
|
||||
@@ -13,6 +11,7 @@
|
||||
"import argparse\n",
|
||||
"from collections import defaultdict\n",
|
||||
"from ortools.sat.python import cp_model\n",
|
||||
"from ortools.sat.python import visualization\n",
|
||||
"from ortools.data import rcpsp_pb2\n",
|
||||
"from ortools.data import pywraprcpsp\n",
|
||||
"import time\n",
|
||||
@@ -265,14 +264,46 @@
|
||||
" parser.ParseFile(args.input)\n",
|
||||
" problem = parser.Problem()\n",
|
||||
" SolveRcpsp(problem, args.output_proto)\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" \n",
|
||||
"class FakeArgs(object):\n",
|
||||
" def __init__(self):\n",
|
||||
" self.output_proto = ''\n",
|
||||
" self.input = '../data/rcpsp/single_mode/j301_1.sm'\n",
|
||||
" \n",
|
||||
"\n",
|
||||
"if __name__ == '__main__':\n",
|
||||
" main(parser.parse_args())"
|
||||
" arguments = FakeArgs() if visualization.RunFromIPython() else parser.parse_args()\n",
|
||||
" main(arguments)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user