Tools
Mathematik: das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche - ein Zwischenstand
Released by matroid on Fr. 17. Februar 2023 22:38:47 [Statistics] [Comments]
Written by Delastelle - 151 x read [Outline] Printable version Printer-friendly version -  Choose language   
Spiele+RätselThis is the outline view of the article [Show content view]

 

 

Section Kopf
Title das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche - ein Zwischenstand
Created 2023-02-17 22:38:47 by Delastelle [Änderungshistorie]
contains 490 Bytes

Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche
Created 2023-02-09 07:00:17 by Delastelle [Änderungshistorie]
contains 2455 Bytes

2945 charactes in tolal


Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche
Created 2023-02-14 09:29:37 by Delastelle [Änderungshistorie]
contains 1145 Bytes

4090 charactes in tolal


Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche -
Created 2023-02-16 10:46:35 by Delastelle [Änderungshistorie]
contains 992 Bytes

5082 charactes in tolal


Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche -
Created 2023-02-16 11:01:42 by Delastelle [Änderungshistorie]
contains 14993 Bytes

20075 charactes in tolal


Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche -
Created 2023-02-16 11:01:51 by Delastelle [Änderungshistorie]
contains 50444 Bytes

70519 charactes in tolal


Section 99
Title Neuer Abschnitt in das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche -
Created 2023-02-16 11:02:00 by Delastelle [Änderungshistorie]
contains 1841 Bytes

72360 charactes in tolal

Get link to this article Get link to this article  Printable version Printer-friendly version -  Choose language     Kommentare zeigen Comments  
pdfFür diesen Artikel gibt es keine pdf-Datei


Write a comment

Arbeitsgruppe Alexandria Dieser Artikel ist nicht im Verzeichnis der Arbeitsgruppe Alexandria eingetragen.
[Die Arbeitsgruppe Alexandria katalogisiert die Artikel auf dem Matheplaneten]
 


 
 
Aufrufzähler 151




[Top of page]



"Mathematik: das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche - ein Zwischenstand" | 2 Comments
The authors of the comments are responsible for the content.

Re: das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche - ein Zwischenstand
von: Delastelle am: Mi. 22. Februar 2023 14:55:28
\(\begingroup\)Hallo, zur Beschleunigung der Programme. Benutze jetzt für Tiefe 5 die Information der Tiefe 3. Laufzeit 8x6 Brett: (a) 3(5) vs 3(3) -> 20x = 18035,1 Sekunden (100 % Rechnenzeit) (b) mit Hauptvariante. Dazu berechne in Tiefe 3 3x und speichere die 3 Züge dann Tiefe 5: in Tiefe 1 bewege die 3 gespeicherten Züge auf Position 1 bis 3 bei den Zügen vor der Berechnung 3(5) vs 3(3) mit hv 3x -> 20x = 13197,1 Sekunden (73,1 % Rechenzeit) (c) setzte bewert = bewert + 20 in Kommentare (auch ohne diese Verschiebung geht Programm -> "schnell") 2. compiliere mit optimise ftn95 -optimise -link Programm Programm.f90 3(5) vs 3(3) mit hv 3x schnell optim -> 20x = 5522,4 Sekunden (30,6 % Rechenzeit) Dazu muss der Code nur in 2 Routinen geändert werden: \showon \sourceon Fortran 90 ! *********** ! 111 ! Zug von Spieler 1 rot ! *********** subroutine AlphaBetaMax(brett,zug8,zugnr,rot,blau,h,alpha,beta,erg) implicit none integer feld(352,3) integer brett(80),brett2(80),zug8(8),zug99(2) integer hauptvariante(2),hauptvariante2(2),hauptvariante3(2) integer value,value2 integer azzuege,erg,zugnr,h integer i,j,rot,blau,rotneu,gedrueckt integer rotfelder,lala1,lala2 integer alpha,beta,strategie,suchtiefe common /isola4/ strategie common /isola5/ suchtiefe common /isola6/ zug99 common /isola8/ hauptvariante common /isola9/ hauptvariante2 common /isola10/ hauptvariante3 !common /isola6/ zugnr !maxValue = -9999 !minValue = 9999 !CIRCLE = 1 !CROSS = -1 !print *,'vor bewert h suchtiefe',h,suchtiefe !print *,brett !print *,rot,blau !print *,rotstrategie,rot,blau !print *,h !if (spieler == 1) then ! Spieler 2 call rotbewegtfelder(brett,zug8,rot,blau,rotfelder) if (rotfelder == 0) then erg = -1000 !print *,'Min bewert ',bewert return endif !print *,'nach rotbewegtfelder' !else ! geloescht !endif !call bewertestellung(brett,zug8,rotstrategie,zugnr,rot,blau,bewert) !print *,'nach bewert' !if ((h == (suchtiefe+1))) then ! call bewertestellung(brett,zug8,strategie,zugnr,rot,blau,bewert) ! erg = bewert !print *,'Max bewert ',bewert ! return !endif ! (1) Zuege ermitteln azzuege = 0 !if (spieler == 1) then do i = 1,8 !print *,'i ',i rotneu = rot+zug8(i) if ((brett(rotneu) == 1).and.(rotneu.ne.blau)) then do j = 12,69 !print *,'j ',j gedrueckt = j if ((brett(gedrueckt) == 1).and.(rotneu.ne.gedrueckt).and.(blau.ne.gedrueckt)) then ! zug zulaessig azzuege = azzuege + 1 feld(azzuege,1) = rotneu feld(azzuege,2) = gedrueckt ! brett(gedrueckt) = 0 !call bewertestellung(brett,zug8,rotstrategie,zugnr,rotneu,blau,bewert) !feld(azzuege,3) = bewert ! mache Zug rueckgaengig !brett(gedrueckt) = 1 endif end do endif end do !else ! geleert !print *,'Zuege ermittelt' !if (spieler == 1) then do i = 1,azzuege feld(i,3) = i end do if (h == 1) then call mischen(feld,azzuege) if (suchtiefe == 5) then do i = 2,azzuege if ((feld(i,1) == hauptvariante(1)).and.(feld(i,2) == hauptvariante(2))) then ! tausche nach vorne lala1 = feld(1,1) lala2 = feld(1,2) feld(1,1) = hauptvariante(1) feld(1,2) = hauptvariante(2) feld(i,1) = lala1 feld(i,2) = lala2 endif end do do i = 3,azzuege if ((feld(i,1) == hauptvariante2(1)).and.(feld(i,2) == hauptvariante2(2))) then ! tausche nach vorne lala1 = feld(2,1) lala2 = feld(2,2) feld(2,1) = hauptvariante2(1) feld(2,2) = hauptvariante2(2) feld(i,1) = lala1 feld(i,2) = lala2 endif end do do i = 4,azzuege if ((feld(i,1) == hauptvariante3(1)).and.(feld(i,2) == hauptvariante3(2))) then ! tausche nach vorne lala1 = feld(3,1) lala2 = feld(3,2) feld(3,1) = hauptvariante3(1) feld(3,2) = hauptvariante3(2) feld(i,1) = lala1 feld(i,2) = lala2 endif end do endif endif value = alpha !erg = beta do i = 1,azzuege do j = 1,80 brett2(j) = brett(j) end do rotneu = feld(i,1) brett2(feld(i,2)) = 0 zugnr = zugnr + 1 !call Minimax_Value(brett2,h+1,dran,value) !print *,rot,blauneu call AlphaBetaMin(brett2,zug8,zugnr,rotneu,blau,h+1,value,beta,value2) ! value = max(value,value2) !print *,h if (h == 1) then feld(i,3) = value2 !print *,'Max Tiefe 0: i feld ',i,feld(i,1:3) !print *,'alpha beta ',alpha,beta !if (value2 > value) then ! azzuege99 = 1 ! feld99(1,1) = rotneu ! feld99(1,2) = feld(i,2) !else ! azzuege = azzuege + 1 ! feld99(azzuege,1) = rotneu ! feld99(azzuege,2) = feld(i,2) !endif endif zugnr = zugnr - 1 if (value2 > value) then value = value2 if (h == 1) then zug99(1) = rotneu zug99(2) = feld(i,2) endif endif !brett2(feld(i,2)) = 1 !zugnr = zugnr - 1 !if (h > 1) then if (value >= beta) then erg = value !print *,'in Max ',value,i,zugnr brett2(feld(i,2)) = 1 !zugnr = zugnr - 1 return !zug(1) = zug2(1) !zug(2) = zug2(2) endif !endif brett2(feld(i,2)) = 1 !zugnr = zugnr - 1 end do !zugnr = zugnr + 1 erg = value end \sourceoff und \sourceon Fortran 90 ! *********** ! Suche für Tiefe 3 und 5 ! erst Tiefe 1, dann 3, dann ev. 5 ! *********** subroutine IsolaSuche(brett,zug8,rot,blau,zug,zugnr) implicit none integer brett(80),zug8(8),zug(2),hauptvariante(2),hauptvariante2(2),hauptvariante3(2) integer zugnr,rot,blau,rotalt integer strategie,suchtiefe,merk integer blauerg,blauerg2 common /isola4/ strategie common /isola5/ suchtiefe common /isola8/ hauptvariante common /isola9/ hauptvariante2 common /isola10/ hauptvariante3 blauerg = 0 merk = suchtiefe if (merk == 3) then ! Suchtiefe 3 call rotzugTiefe1(brett,zug8,rot,blau,zug,zugnr,strategie) !print *,'T1: ',zug rotalt = rot rot = zug(1) brett(zug(2)) = 0 call blaumatt(brett,zug8,rot,blau,blauerg) if (blauerg == 0) then brett(zug(2)) = 1 rot = rotalt call AlphaBetaHauptprogramm(brett,zug8,rot,blau,zug,zugnr) !print *,'T3 ',zug rot = zug(1) brett(zug(2)) = 0 endif zugnr = zugnr + 1 else ! Suchtiefe == 5 call rotzugTiefe1(brett,zug8,rot,blau,zug,zugnr,strategie) !print *,'T1: ',zug rotalt = rot rot = zug(1) brett(zug(2)) = 0 call blaumatt(brett,zug8,rot,blau,blauerg) if (blauerg == 0) then brett(zug(2)) = 1 rot = rotalt suchtiefe = 3 call AlphaBetaHauptprogramm(brett,zug8,rot,blau,zug,zugnr) !print *,'T3: ',zug suchtiefe = 5 rotalt = rot rot = zug(1) brett(zug(2)) = 0 hauptvariante(1) = rot hauptvariante(2) = zug(2) brett(zug(2)) = 1 rot = rotalt suchtiefe = 3 call AlphaBetaHauptprogramm(brett,zug8,rot,blau,zug,zugnr) !print *,'T3: ',zug suchtiefe = 5 rotalt = rot rot = zug(1) brett(zug(2)) = 0 hauptvariante2(1) = rot hauptvariante2(2) = zug(2) brett(zug(2)) = 1 rot = rotalt suchtiefe = 3 call AlphaBetaHauptprogramm(brett,zug8,rot,blau,zug,zugnr) !print *,'T3: ',zug suchtiefe = 5 rotalt = rot rot = zug(1) brett(zug(2)) = 0 hauptvariante3(1) = rot hauptvariante3(2) = zug(2) endif call blaumatt(brett,zug8,rot,blau,blauerg2) if (blauerg2 == 0) then brett(zug(2)) = 1 rot = rotalt call AlphaBetaHauptprogramm(brett,zug8,rot,blau,zug,zugnr) !print *,'T5: ',zug rot = zug(1) brett(zug(2)) = 0 endif zugnr = zugnr + 1 endif end \sourceoff \showoff Viele Grüße Ronald \(\endgroup\)
 

Re: das Spiel Isola Teil 3: der Alpha-Beta Ansatz zur Zugsuche - ein Zwischenstand
von: Delastelle am: Mo. 20. März 2023 21:24:40
\(\begingroup\)Isola und Hashfunktionen hat bei Tiefe 5 ganz gut funktioniert. Siehe hier: https://www.matheplanet.de/matheplanet/nuke/html/viewtopic.php?topic=261760&start=0&lps=1901596#v1901596 \(\endgroup\)
 

 
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2001-2023 by Matroids Matheplanet
This web site was originally made with PHP-Nuke, a former web portal system written in PHP that seems no longer to be maintained nor supported. PHP-Nuke is Free Software released under the GNU/GPL license.
Ich distanziere mich von rechtswidrigen oder anstößigen Inhalten, die sich trotz aufmerksamer Prüfung hinter hier verwendeten Links verbergen mögen.
Lesen Sie die Nutzungsbedingungen, die Distanzierung, die Datenschutzerklärung und das Impressum.
[Seitenanfang]