public void GetBeliefFromKnowledgeIdTest() { Assert.IsNull(_beliefsModel.GetBeliefFromKnowledgeId(_knowledge.EntityId)); var belief = new Belief(Network, _knowledge, _knowledge.Length, RandomGenerator.RandomUniform, BeliefWeightLevel.RandomWeight); _beliefsModel.AddBeliefFromKnowledgeId(_knowledge.EntityId); Assert.AreEqual(belief, _beliefsModel.GetBeliefFromKnowledgeId(_knowledge.EntityId)); }
/// <summary> /// Customize the models of the agent /// After setting the Agent basics models /// </summary> public override void SetModels() { base.SetModels(); foreach (var knowledgeId in Environment.MainOrganization.ArtifactNetwork.Knowledge.GetEntityIds()) { KnowledgeModel.AddKnowledge(knowledgeId, KnowledgeLevel.FullKnowledge, Cognitive.InternalCharacteristics); BeliefsModel.AddBeliefFromKnowledgeId(knowledgeId, Cognitive.KnowledgeAndBeliefs.DefaultBeliefLevel); } }
/// <summary> /// Finalize all the agent's cognitive models /// </summary> protected override void FinalizeModels() { base.FinalizeModels(); if (KnowledgeModel.On) { KnowledgeModel.InitializeExpertise(Schedule.Step); foreach (var knowledgeId in KnowledgeModel.Expertise.Select(x => x.Target)) { BeliefsModel.AddBeliefFromKnowledgeId(knowledgeId); } } if (BeliefsModel.On) { BeliefsModel.InitializeBeliefs(); } }