Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sthiele committed Mar 4, 2014
1 parent ec6aadd commit 9bb4b72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 238 deletions.
14 changes: 5 additions & 9 deletions src/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def get_mapping_ireaction(termset):
#print revdict
#quit()
return dict, revdict



def map_reaction_ids(termset, dict):
mapped = TermSet()
for a in termset:
Expand Down Expand Up @@ -95,8 +96,7 @@ def unmap_reaction_ids(termset, revdict):

return unmapped




def get_unproducible(draft, seeds, targets):
draft_f = draft.to_file()
seed_f = seeds.to_file()
Expand All @@ -109,6 +109,7 @@ def get_unproducible(draft, seeds, targets):
os.unlink(target_f)
return models[0]


def compute_ireactions(instance):
instance_f = instance.to_file()
prg = [ ireaction_prg, instance_f]
Expand All @@ -128,11 +129,9 @@ def get_minimal_completion_size(draft, repairnet, seeds, targets):
instance_f= instance.to_file()
#prg = [minimal_completion_prg, heuristic_prg, instance_f]
#co="--heu=domain"
#solver = GringoHClaspOpt(clasp_options=co)
#solver = GringoHClasp(clasp_options=co)
prg = [minimal_completion_prg, instance_f]

#solver = GringoUnClasp()

co="--opt-strategy=5"
solver = GringoClasp(clasp_options=co)

Expand All @@ -141,7 +140,6 @@ def get_minimal_completion_size(draft, repairnet, seeds, targets):
return optimum



def get_intersection_of_optimal_completions(draft, repairnet, seeds, targets, optimum):
draftfact = String2TermSet('draft("draft")')
ubfact = String2TermSet('ub('+str(optimum)+')')
Expand All @@ -156,7 +154,6 @@ def get_intersection_of_optimal_completions(draft, repairnet, seeds, targets, op
#print revdict
#exit()
prg = [minimal_completion_wb_prg , instance_f ]
#options='-t 2 --enum-mode cautious --opt-all='+str(optimum)
options='--configuration jumpy --enum-mode cautious --opt-mode=optN'

solver = GringoClasp(clasp_options=options)
Expand All @@ -178,7 +175,6 @@ def get_union_of_optimal_completions(draft, repairnet, seeds, targets, optimum):
instance = map_reaction_ids(instance.union(ireactions), dict)

prg = [minimal_completion_wb_prg , instance.to_file() ]
#options='-t 2 --enum-mode brave --opt-all='+str(optimum)
options='--configuration jumpy --enum-mode brave --opt-mode=optN'

solver = GringoClasp(clasp_options=options)
Expand Down
229 changes: 0 additions & 229 deletions src/query.py~

This file was deleted.

0 comments on commit 9bb4b72

Please sign in to comment.