public void TestUpdate() { mock(); // retrieve a concept var yesL = model.GetConcept("posack", ConceptType.ACTION, ConceptMode.L); // set certainty value yesL.Certainty = 1.0; // retrive a relation var yesG = model.GetConcept("POSACK", ConceptType.ACTION, ConceptMode.G); var r = model.GetRelation(yesL, yesG); // set certainty value if (r != null) { r.Certainty = 1.0; } // for logging var json = Jsonifier.JsonifyUpdates(model, new[] { yesL }, new[] { r }); Debug.Log(json); // this would do the actual http request: need to pass two arrays for each model.UpdateEpisim(new[] { yesL }, new[] { r }); }
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[] { }); } }