public UserPresence() { gFI = new FacialInfo(); gGM = new GroupManager(); gCS = new ContentSelection(); gGD = new GestureDetection(); gElapsedTime = 0; gCVInterval = 0; gKinectInterval = 0; gGestureCooldownInterval = 0; gGestureCooldown = false; }
public void UpdateArtifacts(GroupManager GM) { // first step is adding all the possible Content to an unsorted list // checking for duplicates as well if (GM.ChangeInGroups) { ContentList = new List<InformationArtifact>(); } foreach (Group group in GM.Groups) { String SQL = String.Format("SELECT ArtifactID FROM GroupArtifact WHERE GroupID = {0};", group.GroupID); try { DataTable DT = OcDBLink.getDataTable(SQL); for (int x = 0; x < DT.Rows.Count; x++) { DataRow curRow = DT.Rows[x]; String ArtifactID = curRow.ItemArray[0].ToString(); InformationArtifact temp = new InformationArtifact(int.Parse(ArtifactID)); if (temp.Type.Equals("Message")) { AddToContent(group,temp, InfoBytes); } else { AddToContent(group,temp, ContentList); } } } catch { } } // next step is to get all the variables that are needed ready int totalWeights = 0; foreach (InformationArtifact IA in ContentList) { totalWeights += IA.Prepare(PreviouslyViewed); } foreach (InformationArtifact IA in ContentList) { IA.DetermineProbability(totalWeights); } ContentList.Sort(); totalWeights = 0; foreach (InformationArtifact IA in InfoBytes) { totalWeights += IA.Prepare(); } foreach (InformationArtifact IA in InfoBytes) { IA.DetermineProbability(totalWeights); } InfoBytes.Sort(); Messages = new List<String>(); foreach (InformationArtifact IA in InfoBytes) { Messages.Add(IA.Message); } }