10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

{Message m = new Message(GetId(), proxy,Message.Natures.Request,Subjects.TerminationRequest);Conversation termConv = new Conversation();termConv.AsyncSend(m, this);return termConv;}private void SaveData(){// Useless for the moment since all User Profile data isstatic/*AgentId dbManager =DirectoryFacilitator.GetDF().FindProvi<strong>de</strong>rOf(DBManagerAg.SERVICE);Message m = new Message(GetId(), dbManager,Message.Natures.Request,Subjects.SaveUP, userProfile);// Wait until operation is finishedConversation c = new Conversation();c.SendWaitForReply(m, this);*/}private bool ThresholdTimeExpired(DateTime idleStart){return DateTime.Now.Subtract(idleStart) > STOP_THRESHOLD;}private void UpdateProfile(NavigationActContent navig){ResourceId newResource = navig.resourceId;if (lastResource == null)// No previous resource navigateduserProfile.AddNo<strong>de</strong>On(newResource);else{// User comes from another resourceif (prevLink != null){// User comes from another Link// Update read time on previous LinkTimeSpan elapsed =navig.timestamp.Subtract(prevArrival);prevLink.AddReadTime((long)elapsed.TotalMilliseconds);}// Add/get new LinkprevLink = userProfile.AddLinkBetween(lastResource,newResource)as UPLink;}userProfile.LastTimestamp = navig.timestamp;prevArrival = navig.timestamp;lastResource = newResource;Console.WriteLine(userProfile);}}}MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!