最初版本完工
This commit is contained in:
parent
c8031934fb
commit
5a49af7c9f
30
ls.cpp
30
ls.cpp
@ -187,23 +187,25 @@ void Circuit::ls_update_weight() {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i<=1; i++) {
|
||||
if(!fault_weight[g->id][i]) continue;
|
||||
for(Gate* suc : g->suc_stems) {
|
||||
int inc = std::max(1, fault_weight[g->id][i]);
|
||||
// for(int i=0; i<=1; i++) {
|
||||
// if(!fault_weight[g->id][i]) continue;
|
||||
// for(Gate* suc : g->suc_stems) {
|
||||
// int inc = 0.2 * fault_weight[g->id][i];
|
||||
|
||||
if(fault_weight[suc->id][0] + inc <= FAULT_WEIGHT_MAX) {
|
||||
fault_weight[suc->id][0] += inc;
|
||||
if(suc->sa[0]) fault_total_weight += inc;
|
||||
}
|
||||
// inc = std::max(inc, 1);
|
||||
|
||||
if(fault_weight[suc->id][1] + inc <= FAULT_WEIGHT_MAX) {
|
||||
fault_weight[suc->id][1] += inc;
|
||||
if(suc->sa[1]) fault_total_weight += inc;
|
||||
}
|
||||
// if(fault_weight[suc->id][0] + inc <= FAULT_WEIGHT_MAX) {
|
||||
// fault_weight[suc->id][0] += inc;
|
||||
// if(suc->sa[0]) fault_total_weight += inc;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
// if(fault_weight[suc->id][1] + inc <= FAULT_WEIGHT_MAX) {
|
||||
// fault_weight[suc->id][1] += inc;
|
||||
// if(suc->sa[1]) fault_total_weight += inc;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
if(!g->sa[0] && fault_weight[g->id][0] > 0 && (fault_weight[g->id][0] + FAULT_INC < FAULT_WEIGHT_MAX)) {
|
||||
fault_weight[g->id][0] += FAULT_INC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user