/// <summary> /// loads a collection pf ProcessData from DB, generates the Envelopes based on precision and/or links and saves results to DB /// </summary> /// <param name="processids">given list of process ids</param> /// <param name="precision">level of precision (compared to normalized View - [0,1]!)</param> /// <param name="links">number of links('Glieder') we want our Envelope to have</param> /// <returns></returns> public ActionResult SaveEnvelopes(int[] processids = null, decimal precision = 0m, int links = 5) { if (processids == null) { processids = WSConnection.GetProcessesWhere(new List <Tuple <string, string, string, string> >()); } PredictiveProcessCollection coll = new PredictiveProcessCollection(processids, precision, links); PredictiveProcessCollection.SaveEnvelopes(coll); return(Content("collection was saved", "text/html")); }
/// <summary> /// given a json object (generated by Chart.js) of a fromat like {someParameterName:["fromValue", "toValue"], someOtherName:...}, /// this method redirects to the page resulting from processes matching the intersection of the given parameter scopes -> all processes which match the given parameters /// </summary> /// <param name="json">the parameter scope object</param> /// <param name="options">additional view options</param> /// <returns></returns> public ActionResult FindProcessesFromParams(string json, string options = null) { int[] treffer = WSConnection.GetProcessesWhere(json); if (treffer.Length == 0) { return(null); } string url = HttpContext.Request.Url.Scheme + "://" + HttpContext.Request.Url.Authority + HttpContext.Request.UrlReferrer.AbsolutePath + "?"; for (int id = 0; id < Math.Min(20, treffer.Length); id++) { url += "processids=" + treffer[id] + "&"; } return(Redirect(url + "graphsep=0&sepiterations=5" + (options == null ? "" : "&options=" + options))); }
/// <summary> /// loads precalculated param evaluations of a dataset from DB /// </summary> public static void LoadParams() { string json = WSConnection.GetParamStatistics(); string [][] ret = Newtonsoft.Json.JsonConvert.DeserializeObject <string[][]>(json); if (ret.Length == 0) { var processids = WSConnection.GetProcessesWhere(new List <Tuple <string, string, string, string> >()); DataContainers = new PredictiveProcessCollection(processids); foreach (ParamEvaluation eva in DataContainers.ParamEvaluations.Values) { WSConnection.InsertParamStatistic(eva.ParamName, eva.ParamType.ToString(), eva.ValueCount, eva.DistinctValues.Select(x => x.Item1)); } } else { DataContainers = new PredictiveProcessCollection(new List <PredictiveProcessData>()); for (int i = 0; i < ret.Length; i++) { DataContainers.ParamEvaluations.Add(ret[i][0], new ParamEvaluation(ret[i][0], ret[i][1], ret[i][2].Split(';').ToList(), int.Parse(ret[i][3]))); } } loadedAll = true; }