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[] { }); } }
// Use this for initialization void Start() { engaged = false; if (reuseModel) { idUser = true; userNameModalWindow = gameObject.AddComponent <UserNameModalWindow>(); userNameModalWindow.windowRect = new Rect(Screen.width / 2 - 185 / 2, Screen.height / 2 - 60 / 2, 185, 60); userNameModalWindow.Render = true; userNameModalWindow.AllowDrag = false; userNameModalWindow.AllowResize = false; userNameModalWindow.AllowForceClose = false; userNameModalWindow.UserNameEvent += IdentifyUser; } if (state == null) { state = initModel(); Debug.Log(state); } if (PlayerPrefs.HasKey("URLs")) { string epiSimUrlString = string.Empty; foreach (string url in PlayerPrefs.GetString("URLs").Split(';')) { if (url.Split('=')[0] == "EpiSim URL") { epiSimUrlString = url.Split('=')[1]; string epiSimUrl = !epiSimUrlString.StartsWith("http://") ? "http://" + epiSimUrlString : epiSimUrlString; state.SetEpisimUrl(epiSimUrl); state.InitiateEpisim(); break; } } } }