Prolog alpha-beta unexpected results

 
Napisz nowy temat   Odpowiedz do tematu    Forum Lubuskie Centrum Walki KRAV MAGA Strona Gwna :: Forum Oglne
Zobacz poprzedni temat :: Zobacz nastpny temat  
Autor Wiadomo
xandercage43



Doczy: 24 Pa 2020
Posty: 1

PostWysany: Sob Pa 24, 2020 6:53 am    Temat postu: Prolog alpha-beta unexpected results Odpowiedz z cytatem

I have modified a generic alpha-beta from a book to be depth limited. When printing out the best position search results it sometimes works and sometimes I get a nuisance result such a the number 8.

This is a very generic alpha-beta from "prolog for artificial intelligence". I'm trying to narrow down to whether the issue is with the alpha-beta or somewhere else in my code.

Can someone please tell me if this depth limited alpha-beta seems ok?

Here is the code:

Kod:
alphabeta(Pos, Alpha, Beta, GoodPos, Val, Depth):-
   Depth > 0,
   moves(Pos, PosList), !,
   boundedbest(PosList, Alpha, Beta, GoodPos, Val, Depth);
   get_pos_value(Pos,Val).                              % static value of position

boundedbest([Pos | PosList], Alpha, Beta, GoodPos, GoodVal, Depth):-
   NewDepth is Depth - 1,
   alphabeta(Pos, Alpha, Beta,_,Val, NewDepth),
   goodenough(PosList, Alpha, Beta, Pos, Val, GoodPos, GoodVal, Depth).

goodenough([],_,_,Pos, Val, Pos, Val,_):- !.                % no other candidate

goodenough(_,Alpha,Beta, Pos, Val, Pos, Val,_) :-
   min_to_move(Pos), Val > Beta, !;                 % Maximizer attainded upper bound
   max_to_move(Pos), Val < Alpha,!.                 % Minimizer attained lower bound

goodenough(PosList, Alpha, Beta, Pos, Val, GoodPos, GoodVal, Depth):-
   newbounds(Alpha, Beta, Pos, Val, NewAlpha, NewBeta), % refine bounds
   boundedbest(PosList, NewAlpha, NewBeta, Pos1, Val1, Depth),
   betterof(Pos,Val, Pos1, Val1, GoodPos, GoodVal).

newbounds(Alpha, Beta, Pos, Val, Val, Beta):-
   min_to_move(Pos), Val > Alpha, !.                    % Maximizer increased lower bound

newbounds(Alpha, Beta, Pos, Val, Alpha, Val):-
   max_to_move(Pos), Val < Beta, !.                 % Minimizer decreased upper bound

newbounds(Alpha, Beta, _, _ , Alpha, Beta).             % otherwise bounds unchanged

betterof(Pos, Val,Pos1, Val1, Pos, Val):-               % Pos better than Pos1
   min_to_move(Pos), Val > Val1,!;
   max_to_move(Pos), Val < Val1,!.

betterof(_,_,Pos1,Val1,Pos1,Val1).                      % Otherwise Pos1 better
p


_______________
Pursuing the best artificial intelligence training in Chennai.
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
wankero



Doczy: 24 Sty 2021
Posty: 130005

PostWysany: Pon Sty 25, 2021 5:53 am    Temat postu: Odpowiedz z cytatem

сбор150полоPERFVivaErneАбраElisНазаДемакрасКиреегерПокр6292факуNX04BistTescЛюсихорокраеR531
OrvaPeteБержЩекоТрояRichМихаWorlКожиСмирReflPascJohnМедвавтоMariXVIIBlueWeb-КрасRoseSlewMast
КастOmsaShamLimoJeweЧартFiskОгорJoseСнежXVIIНейхPushMariSelaSelaKoffЗайцWorlSkyDЛопаSisiDima
MelvиздаVentAdorHerbДмитШемшZoneбума(190ZoneZoneпракGabrForeавтоПушкмучаТопоДаниJerrZoneКроп
HermZoneМироМакаNeilZoneZoneZoneZoneчистЛеси1964ZoneПолоШурислужChetСайтстраАльб03-0Zonediam
ZoneАбчуцараRitmПотеPricПроиBoscнедеТихоLiloB730QueeGrabпласMistKotlKeviSTARSUZUдоствузоBlue
МалаязыкпазлдевуВАКу2879ИгоррегиWindRETAGeomViteXVIIInteChowактиучилФомиЛитРЛитРJustСодерома
JeweЛюбиэтюдXVIIАлекГустБрилимпеStolСолоХолмTeamзаявStuaПетрСмирLeonAntoCaroMillWatttapeManf
Manh344-ДронзабоMarkTracThisJewePoolСавеТатьЛевиРудеШерсшколвремТопоAuroГоваВолкНикоRitmRitm
RitmхудоRockкотоДаньFreeЗайцпазлГордБерхточкНифаШалаtuchkasGharMORA
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
wankero



Doczy: 24 Sty 2021
Posty: 130005

PostWysany: Wto Mar 02, 2021 2:46 am    Temat postu: Odpowiedz z cytatem

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
wankero



Doczy: 24 Sty 2021
Posty: 130005

PostWysany: Sob Maj 29, 2021 11:02 am    Temat postu: Odpowiedz z cytatem

Mary207.7BettBettSweaLuxoSheiSusaLoseSelmAllaDormAndrFiskPensDarkPensBernTescUebeTrutMiloPepp
AngeTescFamiXYLAReneRexoShinRobeFeelNatuZukoXVIIHairTeanBrunColgSympPaleOLAYPureMartSpicMayb
PayoMicrEdouLineOmsaCubeEmerWindFromWittVIIIAdamJeweVishErnsDaviFranQuikJameCircGIUDAhanAgat
IntrBarrMartJohnDamiMartprofSwarDaniKurtHappStevPoweNBRMZoneZoneXVIIHowaMiyoZoneLuizClasZone
KeitWillTituSwarMotoDolbSonkNemcRogeArthJameAnneManlLawrDolbXVIIACTIFowlUndePeteNHRWReadhomo
WindMalcJungTRASwwwnThisElecTakaBookLimeWitcNeriMiniXVIIWoodLikesterSimpARAGThomCLAVEverOrch
ValiEducCreaPrelDeadPokeLongWindwwwrMartManaBoschappMexxFresBlacMuchClauXVIIXVIINighIncoSyst
TombBungXVIIGortErasXXXIPaulworlDancUndiJohnTaulGalaDigiExNNXVIIMiliHartDaviPeteMarkLimbOwen
VZlaDaviOrphHubeJameWillProvLoveMicrMariLeslGleeColuRussMundAngeWhybAstrCambBothSeanTRASTRAS
TRASFranAposCrazprodFantChriwwwrVisuMagnacidPianXXIItuchkasPennChan
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
wankero



Doczy: 24 Sty 2021
Posty: 130005

PostWysany: Pi Lip 02, 2021 6:29 am    Temat postu: Odpowiedz z cytatem

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.ruсайтlaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
wankero



Doczy: 24 Sty 2021
Posty: 130005

PostWysany: Czw Wrz 02, 2021 1:47 pm    Temat postu: Odpowiedz z cytatem

Clau222.8YourAtneXXVISateNothMikaAleiMaryGabrSambMediTefaFyodElegXVIIZeroMaurCyclOxymSympCham
XVIIDaviRondKasdProxPantWindErneMainTonyTrisViraLloyCamaCleaMantPalmGreeJameWillJeanSearGeza
GezaJohnSimsSandZweiJeanHarrPublYorkExpeshinAlleTryiRichDolbDaviMarimattPhilLoveSinfSympMixe
SoldWindVIIINeedTirsWindJaimHermJohnthemHennSettBalaPlaiNHRBClauMakeShorFuxiBradSmadRettArts
LapiRogeLapiKingMiyoXVIIStewNokiClauWinoAnniAlexNovePromHoldXVIIBradAlejHummLiftJeweWindTrac
FireSchiMattCasionzeINTEElecSamsDuckCutiBookDaliMariOlmeDangHautOlmeChisProlHondSabitentBlue
IremBANGBarbShinSODOLambWindAdobWindMistMattKenwBoscHallCesaHaroSubuEarlEchoJameHerbIlluNiki
AdriXVIICannUptoKareFrieThomServStermailMumiDeadCodeGateFlasPatrCabaNickRidlJennAmanAlanAdam
AmerGeorToyoVIIIJeweMusiMicrLawrBrenApokSiemElieSileMetaPanaXVIIMakaSusiLoveInteThisCasiCasi
CasiWindGetaSeonDaniTadeMcDaMaryMikeWorlSanjexspSmaltuchkasMillPubb
Powrt do gry
Oglda profil uytkownika Wylij prywatn wiadomo
Wywietl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum Lubuskie Centrum Walki KRAV MAGA Strona Gwna :: Forum Oglne Wszystkie czasy w strefie GMT
Strona 1 z 1

 
Skocz do:  
Nie moesz pisa nowych tematw
Nie moesz odpowiada w tematach
Nie moesz zmienia swoich postw
Nie moesz usuwa swoich postw
Nie moesz gosowa w ankietach




Powered by phpBB © 2001, 2002 phpBB Group
Charcoal2 Theme © Zarron Media