同步
This commit is contained in:
parent
268b2b2c80
commit
49f0eb5674
21
src/ls.cpp
21
src/ls.cpp
@ -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) {
|
for(Gate* g : detected_unsatisfied_vars) {
|
||||||
g->fault_detected_unsatisfied_cost[0] += g->level;
|
g->fault_detected_unsatisfied_cost[0] += 1;
|
||||||
g->fault_detected_unsatisfied_cost[1] += g->level;
|
g->fault_detected_unsatisfied_cost[1] += 1;
|
||||||
for(Gate* r : g->score_reigon) {
|
for(Gate* r : g->score_reigon) {
|
||||||
gates_need_recal_score.insert(r);
|
gates_need_recal_score.insert(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Gate* g : propagated_unsatisfied_vars) {
|
for(Gate* g : propagated_unsatisfied_vars) {
|
||||||
g->fault_propagated_unsatisfied_cost[0] += g->level;
|
g->fault_propagated_unsatisfied_cost[0] += 1;
|
||||||
g->fault_propagated_unsatisfied_cost[1] += g->level;
|
g->fault_propagated_unsatisfied_cost[1] += 1;
|
||||||
for(Gate* r : g->score_reigon) {
|
for(Gate* r : g->score_reigon) {
|
||||||
gates_need_recal_score.insert(r);
|
gates_need_recal_score.insert(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Gate *g : gates_need_recal_score) {
|
for(Gate *g : gates) {
|
||||||
g->cal_score();
|
g->cal_score();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user