public void RemoveBeliefs(IEnumerable <BeliefDTO> beliefs) { foreach (var beliefDto in beliefs) { _rpcAsset.RemoveBelief(beliefDto.Name, beliefDto.Perspective); Beliefs.DataSource.Remove(beliefDto); } Beliefs.Refresh(); }
private void CleanBeliefs(RolePlayCharacterAsset rpc) { /* * Find every InSight, InInventory, and IsEquipped belief and delete them * */ var subset = new List <SubstitutionSet> { new SubstitutionSet() }; var beliefs = rpc.m_kb.AskPossibleProperties((Name)"InSight([x])", (Name)"SELF", subset); foreach (var b in beliefs) { foreach (var s in b.Item2) { rpc.RemoveBelief("InSight(" + s[(Name)"[x]"] + ")", "SELF"); } } beliefs = rpc.m_kb.AskPossibleProperties((Name)"InInventory([x])", (Name)"SELF", subset); foreach (var b in beliefs) { foreach (var s in b.Item2) { rpc.RemoveBelief("InInventory(" + s[(Name)"[x]"] + ")", "SELF"); } } beliefs = rpc.m_kb.AskPossibleProperties((Name)"IsEquipped([x], [y])", (Name)"SELF", subset); foreach (var b in beliefs) { foreach (var s in b.Item2) { rpc.RemoveBelief("IsEquipped(" + s[(Name)"[x]"] + ")", "SELF"); } } }
private void DeleteEntity(RolePlayCharacterAsset rpc) { /* * This entity has been destroy by the agent, delete it from the KB * */ rpc.RemoveBelief("Entity(" + Value + ")", "SELF"); rpc.RemoveBelief("Quantity(" + Value + ")", "SELF"); rpc.RemoveBelief("IsCollectable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsCooker(" + Value + ")", "SELF"); rpc.RemoveBelief("IsCookable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsEdible(" + Value + ")", "SELF"); rpc.RemoveBelief("IsEquippable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsFuel(" + Value + ")", "SELF"); rpc.RemoveBelief("IsFueled(" + Value + ")", "SELF"); rpc.RemoveBelief("IsGrower(" + Value + ")", "SELF"); rpc.RemoveBelief("IsHarvestable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsPickable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsStewer(" + Value + ")", "SELF"); rpc.RemoveBelief("IsChoppable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsHammerable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsDiggable(" + Value + ")", "SELF"); rpc.RemoveBelief("IsMineable(" + Value + ")", "SELF"); rpc.RemoveBelief("PosX(" + Value + ")", "SELF"); rpc.RemoveBelief("PosZ(" + Value + ")", "SELF"); }