public void TestSubgroup() { mock(); model.AddPropertyGroup(new PropertyGroup("SIZE", PropertyType.Ordinal)); model.AddPropertyGroup(new PropertyGroup("COLOR", PropertyType.Nominal)); Concept round = new Concept("round", ConceptType.PROPERTY, ConceptMode.L); Concept big = new Concept("big", ConceptType.PROPERTY, ConceptMode.L); big.SubgroupName = "SIZE"; Concept small = new Concept("small", ConceptType.PROPERTY, ConceptMode.L); small.SubgroupName = "SIZE"; Concept blue = new Concept("blue", ConceptType.PROPERTY, ConceptMode.L); blue.SubgroupName = "COLOR"; Concept red = new Concept("red", ConceptType.PROPERTY, ConceptMode.L); red.SubgroupName = "COLOR"; model.AddConcept(round); model.AddConcept(big); model.AddConcept(small); model.AddConcept(blue); model.AddConcept(red); var json = Jsonifier.JsonifyEpistemicStateInitiation(model); Debug.Log(json); model.InitiateEpisim(); }
public void TestInit() { mock(); // for logging var json = Jsonifier.JsonifyEpistemicStateInitiation(model); Debug.Log(json); // this would do the actual http request model.InitiateEpisim(); }
public void TestActualModel() { model = EpistemicModel.initModel(); model.SetEpisimUrl("http://localhost:5000"); // var json = Jsonifier.JsonifyEpistemicState(model); // Debug.Log(json); model.InitiateEpisim(); var moveL = model.GetConcept("PUT", ConceptType.ACTION, ConceptMode.L); var pushL = model.GetConcept("PUSH", ConceptType.ACTION, ConceptMode.L); if ((moveL != null) && (pushL != null)) { moveL.Certainty = -1; pushL.Certainty = -1; var json = Jsonifier.JsonifyEpistemicStateInitiation(model); Debug.Log(json); model.UpdateEpisim(new[] { moveL, pushL }, new Relation[] { }); } }
public void TestUpdate2() { second_mock(); model.InitiateEpisim(); var json = Jsonifier.JsonifyEpistemicStateInitiation(model); Debug.Log(json); var conceptG = model.GetConcept("push", ConceptType.ACTION, ConceptMode.G); Debug.Log(conceptG); var conceptL = model.GetConcept("RIGHT", ConceptType.PROPERTY, ConceptMode.L); Debug.Log(conceptL); if (conceptG.Certainty < 0.5 || conceptL.Certainty < 0.5) { conceptG.Certainty = 0.5; conceptL.Certainty = 0.5; json = Jsonifier.JsonifyUpdates(model, new[] { conceptG, conceptL }, new Relation[] { }); Debug.Log(json); model.UpdateEpisim(new[] { conceptG, conceptL }, new Relation[] { }); } }
public void InitiateEpisim() { Post(EpisimInitRoute, Jsonifier.JsonifyEpistemicStateInitiation(this)); }