diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2017-03-09 09:16:16 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2017-03-09 09:16:16 +0100 |
commit | 938edc8728ba5254dd6d5bbe29e6308dddf48577 (patch) | |
tree | 3ffa02f57a9a19f8b9968da0f6f197123813f6c4 | |
parent | cb1005e8d4063389e7d35aa47e72ac6559888683 (diff) | |
download | ilp-scheduling-938edc8728ba5254dd6d5bbe29e6308dddf48577.tar.gz ilp-scheduling-938edc8728ba5254dd6d5bbe29e6308dddf48577.tar.bz2 ilp-scheduling-938edc8728ba5254dd6d5bbe29e6308dddf48577.zip |
-rw-r--r-- | ilpscheduling/scheduler.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ilpscheduling/scheduler.py b/ilpscheduling/scheduler.py index c854be5..1498bf1 100644 --- a/ilpscheduling/scheduler.py +++ b/ilpscheduling/scheduler.py @@ -146,12 +146,21 @@ def mainOptimize (args): hdr = [] for s in data.slotNames: if groupSize[s].X > 0: - hdr.append ('{} ({})'.format (s, groupSize[s].X)) + hdr.append ('{} ({})'.format (s, int (groupSize[s].X))) print (tabulate (tbl, headers=hdr)) + if args.output: + for s in data.slotNames: + if groupSize[s].X > 0: + with open (os.path.join (args.output, s + '.txt'), 'w') as fd: + for w in data.workerNames: + if x[w,s].X == 1: + fd.write ('{}\n'.format (w)) + def addParser (subparsers): parser = subparsers.add_parser ('optimize', help='Optimize schedule') + parser.add_argument('-o', '--output', help='Output directory for mapping files') parser.add_argument('file', help='input file') parser.set_defaults (func=mainOptimize) |