added constraint for tracks in same room, takes forever to run (not save for usage)
This commit is contained in:
parent
ae6b2abf66
commit
3480569b67
|
@ -221,8 +221,11 @@ for workgroup in workgroups:
|
|||
rules += f':- schedule({workgroup.id}, TIMESLOT, _), timeslot(TIMESLOT, ORDER, _, _, _), ORDER >= {first_timeslot}, ORDER <= {last_timeslot}.\n'
|
||||
|
||||
rules += "pool_schedule(ROOM) :- schedule(_,_,ROOM), pool(ROOM).\n"\
|
||||
"poolpen(T) :- T = {pool_schedule(_)}.\n"\
|
||||
"#minimize { T : poolpen(T) }.\n" \
|
||||
"poolpen(T) :- T = {pool_schedule(_)}.\n"\
|
||||
"otherroomsametrack(AK1, AK2) :- ak(AK1,_, TRACK, _,_,_), schedule(AK1, _, ROOM1), ak(AK2,_, TRACK, _,_,_), schedule(AK2, _, ROOM2), ROOM1 != ROOM2.\n"\
|
||||
"otherroomsametrackpen(T) :- T = {otherroomsametrack(_, _)}.\n"\
|
||||
"finalpen(T) :- poolpen(P),otherroomsametrackpen(O), T = P+O.\n"\
|
||||
"#minimize { T : finalpen(T) }.\n"\
|
||||
"#show schedule/3."
|
||||
|
||||
#######################
|
||||
|
@ -238,6 +241,7 @@ process = ['clingo', output_file_name, '--outf=2']
|
|||
|
||||
# run subprocess, not sure, if busy-waiting..
|
||||
completed_process = subprocess.run(process, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||
|
||||
output = completed_process.stdout
|
||||
|
||||
open('solver_output.json', 'w').write(output)
|
||||
|
|
Loading…
Reference in a new issue