internal SimpleAIv5(AIRandomControl aiRandomControl) : base(aiRandomControl) { specificUpdateKey = new RequestedInfoKey(); specificUpdateKey.SetInfoTypeRequired(InfoProviders.InfoType.WR_ModelAction); specificUpdateKey.SetInfoTypeRequired(InfoProviders.InfoType.WR_ModelActionAmount); }
public SimpleAIV1(AIRandomControl aiRandomControl) : base(aiRandomControl) { aiType = AIGeneration.SimpleV1; specificUpdateKey = new RequestedInfoKey(false); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinPercentage); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinRatio); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_TotalPotAmount_Decimal); }
public SimpleAIV3(AIRandomControl aiRandomControl) : base(aiRandomControl) { aiType = AIGeneration.SimpleV3; specificUpdateKey = new RequestedInfoKey(false); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_MinimumPlayAmount_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_PlayerBetAmountCurrentRound_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinPercentage); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinRatio); specificUpdateKey.SetInfoTypeRequired(InfoType.PAP_RaiseToCallAmount_Amount); }
public AIBase(AIRandomControl aiRandomControl) { //this.disableStochasticChoice = disableStochasticChoice; this.aiRandomControl = aiRandomControl; defaultInfoTypeUpdateConfigs = new Dictionary <InfoType, string>(); if (aiRandomControl.DecisionRandomPerHandSeedEnabled) { randomGen = new CMWCRandom(aiRandomControl.DecisionRandomPerHandSeed); } else { randomGen = new CMWCRandom(); } //This set's all info types required to true and disables the few which are never used defaultUpdateKey = new RequestedInfoKey(true); defaultUpdateKey.SetInfoTypeRequired(InfoType.IO_ImpliedPotOdds_Double, false); defaultUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWeightedPercentage, false); defaultUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWeightedOpponentWinPercentage, false); defaultUpdateKey.SetInfoTypeRequired(InfoType.PAP_RaiseToBotRaise_Prob, false); defaultUpdateKey.SetInfoTypeRequired(InfoType.WR_AveragePercievedProbBotHasBetterHand, false); }
public SimpleAIV4AggTrack(AIRandomControl aiRandomControl) : base(aiRandomControl) { aiType = AIGeneration.SimpleV4AggressionTrack; specificUpdateKey = new RequestedInfoKey(false); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_MinimumPlayAmount_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_PlayerBetAmountCurrentRound_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinPercentage); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_CardsOnlyWinRatio); specificUpdateKey.SetInfoTypeRequired(InfoType.PAP_RaiseToCallAmount_Amount); //specificUpdateKey.SetInfoTypeRequired(InfoType.PAP_RaiseToStealAmount_Amount); specificUpdateKey.SetInfoTypeRequired(InfoType.AP_AvgScaledOppPreFlopPlayFreq_Double); }
internal SimpleAIv6(AIRandomControl aiRandomControl) : base(aiRandomControl) { specificUpdateKey = new RequestedInfoKey(); specificUpdateKey.SetInfoTypeRequired(InfoProviders.InfoType.WR_ProbOpponentHasBetterWR); }
internal SimpleAIv7(AIRandomControl aiRandomControl) : base(aiRandomControl) { aiType = AIGeneration.SimpleV7; //Setup this AI's specific update key specificUpdateKey = new RequestedInfoKey(false); specificUpdateKey.SetInfoTypeRequired(InfoType.CP_HoleCardsMatchedPlayability); specificUpdateKey.SetInfoTypeRequired(InfoType.GP_DealerDistance_Byte); specificUpdateKey.SetInfoTypeRequired(InfoType.GP_NumActivePlayers_Byte); specificUpdateKey.SetInfoTypeRequired(InfoType.GP_NumUnactedPlayers_Byte); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_PlayerMoneyInPot_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_PlayerHandStartingStackAmount_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_PlayerBetAmountCurrentRound_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_TotalPotAmount_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_MinimumPlayAmount_Decimal); specificUpdateKey.SetInfoTypeRequired(InfoType.BP_TotalNumCalls_Byte); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_ProbOpponentHasBetterWRFIXED); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_RaiseToCallStealSuccessProb); specificUpdateKey.SetInfoTypeRequired(InfoType.WR_RaiseToStealSuccessProb); specificUpdateKey.SetInfoTypeRequired(InfoType.AP_AvgLiveOppCurrentRoundAggr_Double); }
public InfoProviderTaskTree(RequestedInfoKey keyToCreate, Dictionary <InfoProviderType, InfoProviderBase> allAvailableProviders) { keyToMatch = keyToCreate; actualKey = keyToMatch; allProviders = new Dictionary <InfoProviderType, InfoProviderBase>(); dependents = new Dictionary <InfoProviderType, List <InfoProviderBase> >(); numberPrerequisites = new Dictionary <InfoProviderType, int>(); //First we need to make sure all types that are required to compute types that we want are going to be computed for (int i = 0; i < 256; i++) { OuterLoopBegin: //Marker so we can restart loop easily //Make sure info type is actually defined if (Enum.IsDefined(typeof(InfoType), i)) { InfoType type = (InfoType)i; //if the key says we need this value if (actualKey.IsInfoTypeRequired(type)) { //Go through all providers looking for the one that provides this type foreach (var outerProvider in allAvailableProviders.Values) { //does provider set this type if ((from types in outerProvider.GetProvidedInformationTypes() where types == type select types).Count() == 1) { //if provider is not currently being used we better make it so if (!allProviders.ContainsKey(outerProvider.ProviderType)) { allProviders.Add(outerProvider.ProviderType, outerProvider); numberPrerequisites.Add(outerProvider.ProviderType, 0); } List <InfoType> requiredTypes = outerProvider.RequiredInfoTypesByInfoType(type); //does provider require any other types to provide this type if (requiredTypes != null && requiredTypes.Count != 0) { //if types are required by this provider we to loop through finding who provides them foreach (var innerProvider in allAvailableProviders.Values) { //checks if inner provider provides a type that is required by outer provider if ((from provided in innerProvider.GetProvidedInformationTypes() where requiredTypes.Contains(provided) select provided).Count() != 0) { //if inner provider currently has no dependents add it to list so it can if (!dependents.ContainsKey(innerProvider.ProviderType)) { dependents.Add(innerProvider.ProviderType, new List <InfoProviderBase>()); } //if inner provider alrerady doesn't have outer provider as a dependent make it so if (!dependents[innerProvider.ProviderType].Contains(outerProvider)) { dependents[innerProvider.ProviderType].Add(outerProvider); numberPrerequisites[outerProvider.ProviderType]++; } } } //initiate bool to mark if we add any new types through dependencies bool addedNewType = false; //go through required types foreach (var element in requiredTypes) { //if type isn't required already make it so and mark that we've added new types if (!actualKey.IsInfoTypeRequired(element)) { actualKey.SetInfoTypeRequired(element); addedNewType = true; } } //if we added new types need to reset loop if (addedNewType) { i = 0; goto OuterLoopBegin; } } i++; goto OuterLoopBegin; } } throw new Exception("Required type does not seem to be provided by any known provider"); } } } }