diff options
-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) |