|
|
@ -7,11 +7,11 @@ import dimod |
|
|
|
from tqdm import tqdm |
|
|
|
|
|
|
|
def main(): |
|
|
|
instance_parameters() |
|
|
|
#instance_parameters() |
|
|
|
#wmis_results() |
|
|
|
#wmis_siman_results_alpha_num_of_assignments() |
|
|
|
#wmis_siman_results() |
|
|
|
#minisat_runs() |
|
|
|
minisat_runs() |
|
|
|
|
|
|
|
def instance_parameters(): |
|
|
|
edb = script.connect_to_experimetns_db() |
|
|
@ -20,15 +20,15 @@ def instance_parameters(): |
|
|
|
idb = script.connect_to_instance_pool() |
|
|
|
|
|
|
|
instances = queries.Instance_scope_query(idb) |
|
|
|
instances.query("c42_vLogistic_1") |
|
|
|
instances.query("c42_vLogistic_6") |
|
|
|
|
|
|
|
insert_row = ("INSERT INTO c42_vLogistic_1_instances " |
|
|
|
insert_row = ("INSERT INTO c42_vLogistic_6_instances " |
|
|
|
"(instance_id, " |
|
|
|
" number_of_clauses, " |
|
|
|
" number_of_variables) " |
|
|
|
"VALUES (%s, %s, %s)") |
|
|
|
|
|
|
|
for instance, instance_id in instances: |
|
|
|
for instance, instance_id in tqdm(instances): |
|
|
|
edb_cursor.execute(insert_row, (str(instance_id), |
|
|
|
int(instance.getNumberOfClauses()), |
|
|
|
int(instance.getNumberOfVariables()))) |
|
|
@ -60,19 +60,18 @@ def wmis_siman_results_alpha_num_of_assignments(): |
|
|
|
idb = script.connect_to_instance_pool() |
|
|
|
|
|
|
|
q = queries.WMIS_result_scope_query_raw(idb) |
|
|
|
q.query("c42_v[5-84]_1", "wmis_qbsolv_results") |
|
|
|
q.query("c42_vLogistic_6", "wmis_siman_results") |
|
|
|
|
|
|
|
insert_row = ("INSERT INTO c42_v5to84_1_wmis_qbsolv_results " |
|
|
|
insert_row = ("INSERT INTO c42_vLogistic_6_wmis_siman_results " |
|
|
|
"(result_id, " |
|
|
|
" run, " |
|
|
|
" instance_id, " |
|
|
|
" number_of_clauses, " |
|
|
|
" number_of_variables, " |
|
|
|
" number_of_found_assignments, " |
|
|
|
" chain_break_fraction, " |
|
|
|
" num_occurrences, " |
|
|
|
" energy, " |
|
|
|
" satisfiable) " |
|
|
|
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) ") |
|
|
|
"VALUES (%s, %s, %s, %s, %s, %s, %s, %s) ") |
|
|
|
|
|
|
|
for result in tqdm(q): |
|
|
|
sample_set = queries.read_raw_wmis_sample_set(result["data"]) |
|
|
@ -86,9 +85,8 @@ def wmis_siman_results_alpha_num_of_assignments(): |
|
|
|
isSatisfiable = sat.checkAssignment(model) |
|
|
|
|
|
|
|
edb_cursor.execute(insert_row, (str(result["_id"]), |
|
|
|
int(result["run"]), |
|
|
|
str(result["instance"]), |
|
|
|
int(sat.getNumberOfClauses()), |
|
|
|
int(sat.getNumberOfVariables()), |
|
|
|
int(data["number_of_assignments"]), |
|
|
|
float(data["chain_break_fraction"]), |
|
|
|
int(data["num_occurrences"]), |
|
|
@ -106,9 +104,9 @@ def minisat_runs(): |
|
|
|
idb = script.connect_to_instance_pool() |
|
|
|
|
|
|
|
runs = queries.Minisat_run_scope_query_raw(idb) |
|
|
|
runs.query("c42_v[5-84]_1", "minisat_runs") |
|
|
|
runs.query("c42_vLogistic_6", "minisat_runs") |
|
|
|
|
|
|
|
insert_row = ("INSERT INTO c42_v5to84_1_minisat_runs " |
|
|
|
insert_row = ("INSERT INTO c42_vLogistic_6_minisat_runs " |
|
|
|
"(run_id, " |
|
|
|
" instance_id, " |
|
|
|
" satisfiable) " |
|
|
|