Profile. More...
#include <gprofile.h>
Public Member Functions | |
GProfile (GSession *session, GUser *usr, tProfileType type, const R::RString name, bool s) | |
GProfile (GSession *session, GUser *usr, tProfileType type, size_t id, size_t blockid, const R::RString name, size_t grpid, R::RDate a, R::RDate u, R::RDate c, bool s, double score, char level, size_t nbf) | |
virtual R::RCString | GetClassName (void) const |
int | Compare (const GProfile &profile) const |
tProfileType | GetProfileType (void) const |
GUser * | GetUser (void) const |
bool | IsSocial (void) const |
R::RDate | GetUpdated (void) const |
R::RDate | GetComputed (void) const |
bool | MustCompute (void) const |
size_t | GetGroupId (void) const |
void | SetGroup (size_t groupid) |
R::RDate | GetAttached (void) const |
double | GetConfidenceScore (void) const |
char | GetConfidenceLevel (void) const |
double | GetAgreementRatio (const GProfile *prof, size_t nbmin) const |
double | GetDisagreementRatio (const GProfile *prof, size_t nbmin) const |
size_t | GetNbAssessedDocs (void) const |
R::RCursor< GFdbk > | GetFdbks (void) const |
GFdbk * | GetFdbk (size_t docid) const |
~GProfile (void) | |
Public Member Functions inherited from GDescriptionObject< GProfile > | |
GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name) | |
void | ReleaseVectors (void) |
const GDescription & | operator() (void) const |
R::RConstCursor< GVector > | GetVectors (void) const |
const GVector * | GetVector (GConcept *metaconcept) const |
bool | IsIn (const GConcept *concept) const |
bool | IsDefined (void) const |
tObjState | GetState (void) const |
size_t | GetId (void) const |
size_t | GetBlockId (void) const |
virtual | ~GDescriptionObject (void) |
Public Member Functions inherited from GObject | |
GObject (GSession *session, size_t id, const R::RString &name, tObjType type) | |
GObject (const GObject &obj) | |
void | VerifyStatements (tStatementElement what, size_t size) |
int | Compare (const GObject &obj) const |
int | Compare (size_t id) const |
int | Search (const GObject &obj) const |
int | Search (const R::RString &name) const |
GSession * | GetSession (void) const |
size_t | GetId (void) const |
void | SetId (size_t id) |
tObjType | GetObjType (void) const |
R::RCursor< GStatement > | GetObjs (const GStatement *obj, tStatementElement what) |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GObject (void) |
Public Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
void | PostNotification (const hNotification handle) |
void | PostNotification (const RCString &name) |
void | PostNotification (const hNotification handle, T data) |
void | PostNotification (const RCString &name, T data) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle) |
void | InsertObserver (tNotificationHandler handler, const RCString &name) |
void | InsertObserver (tNotificationHandler handler, RObject *object) |
void | InsertObserver (tNotificationHandler handler) |
void | DeleteObserver (void) |
void | DeleteObserver (const hNotification handle, RObject *object) |
void | DeleteObserver (const RCString &name, RObject *object) |
hNotification | GetNotificationHandle (const RCString &name) const |
RCString | GetNotificationName (const hNotification handle) const |
virtual | ~RObject (void) |
Static Public Member Functions | |
static tObjType | GetType (void) |
Static Public Member Functions inherited from GDescriptionObject< GProfile > | |
static bool | HasDesc (void) |
Static Public Member Functions inherited from GObject | |
static bool | HasDesc (void) |
static bool | HasTree (void) |
Private Member Functions | |
bool | InsertFdbk (size_t docid, tFdbkType fdbk, const R::RDate &done) |
void | DeleteFdbk (size_t docid) |
void | Update (GDescription &desc) |
void | Clear (bool disk) |
void | ClearFdbks (void) |
void | WasUpdated (size_t docid) |
Private Attributes | |
GUser * | User |
tProfileType | Type |
R::RContainer< GFdbk, true, true > | Fdbks |
bool | Social |
R::RDate | Updated |
R::RDate | Computed |
size_t | GroupId |
R::RDate | Attached |
double | Score |
char | Level |
Additional Inherited Members | |
Protected Member Functions inherited from GDescriptionObject< GProfile > | |
virtual bool | LoadVectors (void) |
Protected Attributes inherited from GDescriptionObject< GProfile > | |
tObjState | State |
Protected Attributes inherited from GObject | |
GSession * | Session |
size_t | Id |
tObjType | ObjType |
R::RContainer< GStatement, false, true > * | Subjects |
R::RContainer< GStatement, false, false > * | Predicates |
R::RContainer< GStatement, false, false > * | Values |
Protected Attributes inherited from RObject | |
RString | Name |
Detailed Description
Profile.
The GProfile class provides a representation of a profile, i.e. a description of some knowledge attached to people. This can be an interest, an expertise, etc.
Each profile is associated to a set feedbacks on documents.
Constructor & Destructor Documentation
GProfile | ( | GSession * | session, |
GUser * | usr, | ||
tProfileType | type, | ||
const R::RString | name, | ||
bool | s | ||
) |
Construct a new profile.
- Parameters
-
session Session. usr User of the profile. type Type of the profile. name Name of the profile. s Social?
GProfile | ( | GSession * | session, |
GUser * | usr, | ||
tProfileType | type, | ||
size_t | id, | ||
size_t | blockid, | ||
const R::RString | name, | ||
size_t | grpid, | ||
R::RDate | a, | ||
R::RDate | u, | ||
R::RDate | c, | ||
bool | s, | ||
double | score, | ||
char | level, | ||
size_t | nbf | ||
) |
Construct a profile.
- Parameters
-
session Session. usr User of the profile. type Type of the profile. id Identifier of the profile. blockid Identifier of the block. name Name of the profile. grpid Community identifier. a Date where it was attached. u Date of the last updated. c Date of the last computation. s Social? score Score of the profile. level Level of the profile. nbf Number of Feedbacks.
~GProfile | ( | void | ) |
Destructor of the profile. It is removed from its user and community.
Member Function Documentation
|
virtual |
- Returns
- the class name.
Reimplemented from GObject.
|
static |
Give the type of the object.
- Returns
- otProfile
int Compare | ( | const GProfile & | profile | ) | const |
Compare two profiles by comparing their identifier.
- See also
- R::RContainer
- Parameters
-
profile Profile.
- Returns
- int
tProfileType GetProfileType | ( | void | ) | const |
- Returns
- the type of the profile.
GUser* GetUser | ( | void | ) | const |
Get the user of the profile.
- Returns
- Pointer to the user.
bool IsSocial | ( | void | ) | const |
Look if the profile is social.
- Returns
- boolean value.
R::RDate GetUpdated | ( | void | ) | const |
Get the date of the last update of the profile. It may be the date of the latest document feedback or an update of one of the documents on which some feedback exists.
- Returns
- R::RDate.
R::RDate GetComputed | ( | void | ) | const |
Get the date of the last analysis of the profile.
- Returns
- R::RDate.
bool MustCompute | ( | void | ) | const |
Verify if the profile must be (re-)computed.
size_t GetGroupId | ( | void | ) | const |
Get the community holding the profile.
void SetGroup | ( | size_t | groupid | ) |
Set the community holding the profile.
- Parameters
-
groupid Identifier of the group.
double GetConfidenceScore | ( | void | ) | const |
The confidence score represent an absolute measure of the confidence of a given profile.
- Returns
- the confidence score of the profile.
char GetConfidenceLevel | ( | void | ) | const |
The confidence level represent a relative measure of the confidence of a given profile in comparison to all other profiles.
- Returns
- the confidence level of the profile.
double GetAgreementRatio | ( | const GProfile * | prof, |
size_t | nbmin | ||
) | const |
Compute the agreement ratio between two profiles, i.e. the ratio between the number of documents assessed as relevant by both profiles, and the total number of documents assessed by both profiles.
- Parameters
-
prof Second profile. nbmin Minimum number of common documents for a non null ratio.
double GetDisagreementRatio | ( | const GProfile * | prof, |
size_t | nbmin | ||
) | const |
Compute the disagreement ratio between two profiles, i.e. the ratio between the number of documents assessed as relevant by one of the profiles and differently by the other one, and the total number of documents assessed by both profiles.
- Parameters
-
prof Second profile. nbmin Minimum number of common documents for a non null ratio.
size_t GetNbAssessedDocs | ( | void | ) | const |
Get the number of assessed documents.
R::RCursor<GFdbk> GetFdbks | ( | void | ) | const |
Get a Cursor on the feedback for the profile.
GFdbk* GetFdbk | ( | size_t | docid | ) | const |
Get the feedback of the profile on a specific document.
- Parameters
-
docid Identifier of the document.
Add a feedback to the list of the profile.
- Parameters
-
docid Identifier of the document. fdbk Feedback type. done Date of the assessment.
- Returns
- true if it is a new feedback.
|
private |
Delete a feedback from the list of the profile.
- Parameters
-
docid Identifier of the document.
|
private |
Update the representation of the profile once a computation was done. The computed date and the status are updated.
If the profile is an internal one, the following steps are done:
- An 'hProfiles[oeAboutToBeUpdated]' notification is send.
- The references are updated.
- Existing in memory description is replaced.
- If necessary, the profile and its description are saved.
- An 'hProfiles[oeUpdated]' notification is send.
If the profile is an external one, its description is replaced.
- Parameters
-
desc Description to assign.
- Warning
- The description is cleared by this method.
|
private |
Clear the information associated with the profile.
- Parameters
-
disk Clear the reference to the corresponding block on disk.
|
private |
Clear the assessment of the profile.
|
private |
This method is call by a document when it was modified.
- Parameters
-
docid Identifier of the document.
Member Data Documentation
|
private |
The owner of the profile.
|
private |
Type of the profile.
|
private |
Documents assessed by profile.
|
private |
Determine if the profile is social, i.e. prefer to be grouped with someone also if the similarity is not evident rather to stay alone.
|
private |
Date of the update of the profile (new assessments).
|
private |
Date of last profile computing.
|
private |
Identifier of the corresponding community.
|
private |
Date of the attachment of the profile into the community.
|
private |
Confidence score (to maximize).
|
private |
Confidence Level (to maximize).