This commit is contained in:
YuhangQ 2023-05-10 21:54:43 +08:00
parent 268b2b2c80
commit 49f0eb5674
2 changed files with 16 additions and 5 deletions

BIN
atpg

Binary file not shown.

View File

@ -123,23 +123,34 @@ void Circuit::ls_update_weight() {
}
}
for(Gate* g : gates) {
if(!g->fault_detected[0]) {
g->fault_detected_weight[0] += 1;
g->fault_propagated_weight[0] += 1;
}
if(!g->fault_detected[1]) {
g->fault_detected_weight[1] += 1;
g->fault_propagated_weight[1] += 1;
}
}
for(Gate* g : detected_unsatisfied_vars) {
g->fault_detected_unsatisfied_cost[0] += g->level;
g->fault_detected_unsatisfied_cost[1] += g->level;
g->fault_detected_unsatisfied_cost[0] += 1;
g->fault_detected_unsatisfied_cost[1] += 1;
for(Gate* r : g->score_reigon) {
gates_need_recal_score.insert(r);
}
}
for(Gate* g : propagated_unsatisfied_vars) {
g->fault_propagated_unsatisfied_cost[0] += g->level;
g->fault_propagated_unsatisfied_cost[1] += g->level;
g->fault_propagated_unsatisfied_cost[0] += 1;
g->fault_propagated_unsatisfied_cost[1] += 1;
for(Gate* r : g->score_reigon) {
gates_need_recal_score.insert(r);
}
}
for(Gate *g : gates_need_recal_score) {
for(Gate *g : gates) {
g->cal_score();
}