| 904 | // the -a list, except the influences are different.) |
| 905 | |
| 906 | void ChartInDayInfluence(void) |
| 907 | { |
| 908 | int source[MAXINDAY], aspect[MAXINDAY], dest[MAXINDAY], ca[cAspect + 1], |
| 909 | co[objMax], occurcount = 0, i, j, k, l, nSav; |
| 910 | real power[MAXINDAY], rPowSum = 0.0, rT; |
| 911 | char sz[cchSzDef], *pch; |
| 912 | flag fDistance = us.fDistance && !us.fParallel, f; |
| 913 | |
| 914 | ClearB((pbyte)ca, sizeof(ca)); |
| 915 | ClearB((pbyte)co, sizeof(co)); |
| 916 | |
| 917 | // Go compute the aspects in the chart. |
| 918 | |
| 919 | if (!FCreateGrid(fFalse)) |
| 920 | return; |
| 921 | |
| 922 | // Search through the grid and build up the list of aspects. |
| 923 | |
| 924 | for (j = 1; j <= is.nObj; j++) { |
| 925 | if (FIgnore(j)) |
| 926 | continue; |
| 927 | for (i = 0; i < j; i++) { |
| 928 | if (FIgnore(i) || (k = grid->n[i][j]) == 0 || occurcount >= MAXINDAY) |
| 929 | continue; |
| 930 | source[occurcount] = i; aspect[occurcount] = k; dest[occurcount] = j; |
| 931 | rT = grid->v[i][j]; |
| 932 | power[occurcount] = (RTransitInf(i)/4.0) * (RTransitInf(j)/4.0) * |
| 933 | rAspInf[k]*(1.0-(real)RAbs(rT)/GetOrb(i, j, k)); |
| 934 | rPowSum += power[occurcount]; |
| 935 | ca[k]++; |
| 936 | co[i]++; co[j]++; |
| 937 | occurcount++; |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | // Sort aspects by order of influence. |
| 942 | |
| 943 | for (i = 1; i < occurcount; i++) { |
| 944 | j = i-1; |
| 945 | while (j >= 0) { |
| 946 | k = j+1; |
| 947 | switch (us.nAspectSort) { |
| 948 | default: f = power[j] > power[k]; break; |
| 949 | case aso: f = RAbs(grid->v[source[j]][dest[j]]) < |
| 950 | RAbs(grid->v[source[k]][dest[k]]); break; |
| 951 | case asn: f = grid->v[source[j]][dest[j]] < |
| 952 | grid->v[source[k]][dest[k]]; break; |
| 953 | case asO: f = rgobjList2[source[j]]*cObj + rgobjList2[dest[j]] < |
| 954 | rgobjList2[source[k]]*cObj + rgobjList2[dest[k]]; break; |
| 955 | case asP: f = rgobjList2[dest[j]]*cObj + rgobjList2[source[j]] < |
| 956 | rgobjList2[dest[k]]*cObj + rgobjList2[source[k]]; break; |
| 957 | case asA: f = aspect[j]*cObj*cObj + source[j]*cObj + dest[j] < |
| 958 | aspect[k]*cObj*cObj + source[k]*cObj + dest[k]; break; |
| 959 | case asC: f = planet[source[j]] < planet[source[k]]; break; |
| 960 | case asD: f = planet[dest[j]] < planet[dest[k]]; break; |
| 961 | case asM: f = Midpoint(planet[dest[j]], planet[source[j]]) < |
| 962 | Midpoint(planet[dest[k]], planet[source[k]]); break; |
| 963 | } |
no test coverage detected