|
| 1 | + Program AxTest |
| 2 | +c For testings of PD tour program. |
| 3 | +c Begun 7/19/93. Ver 1.0 begun 7/27 for nice rules as well as not nice rules |
| 4 | +c Compile: set directory. then: RUN tourexec2 -debug -saveall -ov -r |
| 5 | + |
| 6 | +c Changes to make: |
| 7 | +c Add Almost-Pavlov and Almost-TFT to col rules |
| 8 | + |
| 9 | + real Version /1.1/ |
| 10 | +c Next few lines are control parameters |
| 11 | + integer ColType/4/ ! 1=TFT, 2=TF2T, 3=Random, 4= Pavlov |
| 12 | + integer MoveReport/0/ ! 0= no report of moves, 1 = report moves |
| 13 | + integer GameReport/0/ ! 0 = no report of games 1= report games |
| 14 | + real Noise/0./ ! prob a choice will be changed |
| 15 | + integer minRow/1/ ! normally /1/ to run all rules |
| 16 | + integer maxRow/63/ ! normally /63/ to run all rules |
| 17 | + integer outcome(308) ! 1=R, 2=T, 3=S, 4=P for Column |
| 18 | + integer length(5) /63,77,151,156,308/ ! Game Lengths in Tour |
| 19 | + integer game ! Game no. with this pair, 1 to 5 |
| 20 | + integer*4 RandomSeed ! |
| 21 | + integer Row, Rank ! Row = Rank = 1..63 for 2nd round rules |
| 22 | + integer RowGameScore, ColGameScore ! Score in Current Game |
| 23 | + integer Tally(4) ! tally of col's outcomes for game |
| 24 | + integer ColOutcomeType ! 1=R, 2=T, 3=S, 4=P for Column |
| 25 | + integer RowGameSc, ColGameSc ! Scores in one game |
| 26 | + integer RowPairSc, ColPairSc ! Scores over 5 games |
| 27 | + integer MoveRecord(308) ! Moves of current game |
| 28 | + character*9 day |
| 29 | + character*8 timenow |
| 30 | + integer ActualTFTTourSc(63)/ |
| 31 | + 1 453,453,453,453,453, 453,453,452,453,453, |
| 32 | + 1 453,453,453,453,453, 449,453,452,450,453, |
| 33 | + 2 453,453,453,453,452, 453,446,453,449,453, |
| 34 | + 3 453,453,453,453,453, 453,453,453,452,453, |
| 35 | + 4 453,453,453,453,453, 452,453,443,422,452, |
| 36 | + 5 442,453,452,442,342, 398,377,388,438,155, |
| 37 | + 6 376,341,198/ |
| 38 | + integer IRowPairSc(63), IColPairSc(63) ! Integer total over 5 games |
| 39 | + real AveRowPairSc(63), AveColPairSc(63) ! real, truncated |
| 40 | + integer rowchoice, colchoice |
| 41 | + call date_and_time(day, timenow) |
| 42 | + write(6,100) Version, day, timenow |
| 43 | +100 format(' Ax TourExec Program Output, Version ',f6.2, '.', 1H, |
| 44 | + 1 A10, A10) |
| 45 | + RandomSeed = secnds(0.0) ! uses elapsed time since midnight as random seed |
| 46 | +c RandomSeed=66222 ! Uses fixed random number |
| 47 | + Write(6,103) RandomSeed |
| 48 | +103 format(' RandomSeed = ', i16) |
| 49 | +
|
| 50 | + write(6,85) noise |
| 51 | +85 format(' Noise (per choice) = ', f8.4) |
| 52 | +
|
| 53 | + write(6, 104) ColType |
| 54 | +104 format(' Col Type, 1=TFT, 2=TF2F, 3=Random, 4=Pavlov. Col Type = ' |
| 55 | + 1 , i3) |
| 56 | + if (movereport==1) write(6, 105) |
| 57 | +105 format(' Move report: 1 means R, 2 means T, 3 means S, 4 means P |
| 58 | + 1 for column.') |
| 59 | + if (GameReport==1) write(6,101) |
| 60 | +101 format(' Rank Game RScore CScore #ColR #ColT #ColS #ColP') |
| 61 | + ITotalColPoints = 0 ! Initialize Col's total points |
| 62 | + Do 30 row= minRow,maxRow ! normally 1 to 63 |
| 63 | + rank = row |
| 64 | + RowPairSc = 0 |
| 65 | + ColPairSc = 0 |
| 66 | + |
| 67 | + Do 20 Game = 1,5 |
| 68 | + RowGameSc = 0 |
| 69 | + ColGameSc = 0 |
| 70 | + JA = 0 ! Row's previous move, reported to column |
| 71 | + JB = 0 ! Col's previous move, reported to row |
| 72 | + Do 10 ColOutcomeType = 1,4 |
| 73 | + Tally(ColOutcomeType) = 0 ! Zero Col's RTSP game count |
| 74 | +10 Continue ! End Do tallyType |
| 75 | + Do 15 Move = 1, Length(Game) |
| 76 | + RandomNumber = RAN(RandomSeed) |
| 77 | + RowChoice = KRowFunction(JB,Move, RowGameSc,ColGameSc, |
| 78 | + 1 RandomNumber,Row,JA) |
| 79 | + if ( RAN(RandomSeed) < noise ) RowChoice = 1-RowChoice ! noise happened to Row |
| 80 | + RandomNumber = RAN(RandomSeed) |
| 81 | + ColChoice = KColFunction(JA,Move,ColGameSc,RowGameSc, |
| 82 | + 1 RandomNumber,ColType,JB) |
| 83 | + if ( RAN(RandomSeed) < noise ) ColChoice = 1 - ColChoice ! noise happened to Col |
| 84 | +C temp test: |
| 85 | +c Write(6, 999) Move, RowChoice, ColChoice |
| 86 | +c999 Format(' move, rowchoice, colchoice ', 3i6) |
| 87 | + ColOutcomeType = 1 + 2*RowChoice + ColChoice ! *check col: 1=R,2=T |
| 88 | + Tally(ColOutcomeType) = Tally(ColOutcomeType) + 1 |
| 89 | + JA = RowChoice ! Reported to col next time |
| 90 | + JB = ColChoice ! Reported to row next time |
| 91 | +
|
| 92 | + Select Case (ColOutcomeType) |
| 93 | + Case (1) ! Both Get R |
| 94 | + RowGameSc=RowGameSc+3 |
| 95 | + ColGameSc=ColGameSc+3 |
| 96 | + Case (2) ! Col Gets T |
| 97 | + ColGameSc=ColGameSc+5 |
| 98 | + Case (3) ! Col Gets S |
| 99 | + RowGameSc=RowGameSc+5 |
| 100 | + Case (4) ! Both Get P |
| 101 | + RowGameSc=RowGameSc+1 |
| 102 | + ColGameSc=ColGameSc+1 |
| 103 | + End Select |
| 104 | +
|
| 105 | + MoveRecord(move)=ColOutcomeType |
| 106 | +15 Continue ! End Do Move |
| 107 | +
|
| 108 | +C write game output |
| 109 | + RowPairSc=RowPairSc+RowGameSc ! sum over 5 games |
| 110 | + ColPairSc=ColPairSc+ColGameSc |
| 111 | + if (GameReport==1) Write(6, 110) Rank, Game, RowGameSc, |
| 112 | + 1 ColGameSc, Tally(1), Tally(2), Tally(3), Tally(4) |
| 113 | +110 format(9i6, 10i3) |
| 114 | + if (movereport .eq. 1) write(6, 112) (MoveRecord(ir), ir=1, |
| 115 | + 1 length(game)) |
| 116 | +112 format(' ', 10i2, 2H, 10i2, 2H, 10i2, 2H, 10i2) |
| 117 | +20 Continue ! End Do Game |
| 118 | + if (GameReport==1) write(6, 115) RowPairSc, ColPairSc |
| 119 | + IRowPairSc(Row) = RowPairSc ! total over 5 games |
| 120 | + IColPairSc(Row) = ColPairSc |
| 121 | + IColTourSc = IColTourSc +ColPairSc ! running total of col's points |
| 122 | +115 format('Totals over 5 games: RowPairSc= ',I7, ' ColPairSc = ', I7) |
| 123 | + if (GameReport==1) write (6, 120) |
| 124 | +120 format() |
| 125 | + |
| 126 | +30 Continue ! End Do Row |
| 127 | + |
| 128 | +C final report: calc tour score, write tour output |
| 129 | + |
| 130 | + Write(6, 135) |
| 131 | +135 format(' Rank RowSc ColSc AveRowSc AveColSc 2ndRndTFT |
| 132 | + 1 2ndRndTFT-Col') |
| 133 | + Do 40 Row = minRow,maxRow |
| 134 | + IRowTourPairSc = IRowPairSc(Row)/5 |
| 135 | + IColTourPairSc = IColPairSc(Row)/5 |
| 136 | + ITotalColPoints = ITotalColPoints + IColPairSc(Row) ! accumulate col points |
| 137 | + Write(6, 140) Row, IRowPairSc(Row), IColPairSc(Row), |
| 138 | + 1 IRowTourPairSc,IColTourPairSc, ActualTFTTourSc(Row), |
| 139 | + 2 ActualTFTTourSc(Row)-IColTourPairSc |
| 140 | +140 format(i6, 4i8, ' ',i8,' ',i8) |
| 141 | +40 continue ! end final report |
| 142 | + TotalColPoints = ITotalColPoints ! to make floating point (total over 63*5 games) |
| 143 | + ColTourSc =(TotalColPoints/5 )/63 ! Ave per game over 63 pairs |
| 144 | + write(6, 150) ColType, ITotalColPoints, ColTourSc |
| 145 | +150 format(' Col Type= ', i4, '. Col Pts = ', i7, ' Cols Tour Sc = ' |
| 146 | + 1 , f7.3) |
| 147 | + end ! Main Program |
0 commit comments