| 626 | }; |
| 627 | |
| 628 | void Scheduler::SortTrace() |
| 629 | { |
| 630 | listType * lp; |
| 631 | handType * hp; |
| 632 | int strain, key, index; |
| 633 | |
| 634 | for (int g = 0; g < numGroups; g++) |
| 635 | { |
| 636 | strain = group[g].strain; |
| 637 | key = group[g].hash; |
| 638 | lp = &list[strain][key]; |
| 639 | index = lp->first; |
| 640 | hp = &hands[index]; |
| 641 | |
| 642 | // Taking into account repeat times. |
| 643 | |
| 644 | int repeatNo = 0; |
| 645 | int firstPrev = -1; |
| 646 | group[g].pred = 0; |
| 647 | do |
| 648 | { |
| 649 | // Skip complete duplicates, as we won't solve them again. |
| 650 | if (hands[index].first != firstPrev) |
| 651 | { |
| 652 | group[g].pred += SORT_TRACE_TIMES[hp->NTflag][repeatNo]; |
| 653 | if (repeatNo < 7) |
| 654 | repeatNo++; |
| 655 | firstPrev = hands[index].first; |
| 656 | } |
| 657 | |
| 658 | index = hands[index].next; |
| 659 | } |
| 660 | while (index != -1); |
| 661 | |
| 662 | double depthFactor; |
| 663 | int depth = hp->depth; |
| 664 | double * slist = SORT_TRACE_DEPTH[hp->NTflag]; |
| 665 | |
| 666 | if (depth <= 1) |
| 667 | depthFactor = slist[0]; |
| 668 | else if (depth <= 15) |
| 669 | depthFactor = slist[1]; |
| 670 | else if (depth >= 49) |
| 671 | depthFactor = slist[3]; |
| 672 | else |
| 673 | depthFactor = slist[1] + (depth - 15) * slist[2]; |
| 674 | |
| 675 | group[g].pred = static_cast<int>( |
| 676 | (depthFactor * static_cast<double>(group[g].pred))); |
| 677 | |
| 678 | // Taking into account fanout. |
| 679 | |
| 680 | int fanout = hp->fanout; |
| 681 | slist = SORT_TRACE_FANOUT[hp->NTflag]; |
| 682 | double fanoutFactor; |
| 683 | |
| 684 | if (fanout < slist[0]) |
| 685 | fanoutFactor = 0.; // A bit extreme... |
nothing calls this directly
no outgoing calls
no test coverage detected