Generic Session. More...
#include <gsession.h>
Public Member Functions | |
GSession (size_t id, const R::RString &name) | |
GSession (size_t id, const R::RString &name, const R::RString &configdir) | |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GSession (void) |
Session General Methods | |
General methods related to the session. | |
size_t | GetId (void) const |
R::RString | GetName (void) const |
int | Compare (const GSession &session) const |
int | Compare (size_t id) const |
int | Compare (const R::RString &name) const |
R::RTextFile & | GetLog (void) |
bool | MustBreak (void) |
void | ResetBreak (void) |
void | SetBreak (void) |
int | GetCurrentRandom (void) const |
size_t | GetCurrentRandomValue (size_t max) |
R::RRandom & | GetRandom (void) |
void | ApplyConfig (void) |
bool | MustSaveResults (void) const |
void | SetCurrentRandom (int rand) |
void | SetSaveResults (bool save=true) |
R::RString | AnalyzeString (const R::RString &str) |
Computing Methods | |
Methods used to launch different computations on the session. | |
GDocAnalyze * | ReserveAnalyzer (void) |
void | ReleaseAnalyzer (GDocAnalyze *analyzer) |
void | AnalyzeDoc (GDoc *doc, GSlot *rec=0, bool force=false, bool download=true) |
void | AnalyzeDocs (GSlot *rec=0) |
void | GroupDocs (GSlot *rec=0) |
void | CalcProfile (GProfile *profile, GProfileCalc *method=0, GLinkCalc *linkcalc=0, GSlot *rec=0) |
void | CalcProfiles (GSlot *rec=0) |
void | GroupProfiles (GSlot *rec=0) |
void | ComputeSugs (GSlot *rec=0) |
void | ComputeTrust (GSlot *rec=0) |
void | RunTool (const R::RString &name, const R::RString &list, GSlot *slot=0, bool need=true) |
void | RequestMetaEngine (const R::RString &query, size_t caller) |
void | ClearMetaEngine (size_t caller) |
Informational Methods | |
Methods that provides some information on the session. | |
size_t | GetNbObjs (tObjType type) const |
size_t | GetMaxObjId (tObjType type) const |
size_t | GetMaxObjPos (tObjType type) const |
GObject * | GetObj (tObjType type, size_t id, bool null=false) |
size_t | GetObjs (tObjType type, GObject **&tab, bool alloc) |
void | VerifyTab (tObjType type, size_t max) |
GSimulator * | GetSimulator (void) const |
Update Methods | |
Methods used to update the session. | |
void | ReInit (const GSubject *obj, bool cleardocs) |
void | ReInit (const GDoc *obj, bool del) |
void | ReInit (const GUser *obj) |
void | ReInit (const GProfile *obj, bool del) |
void | ReInit (const GFdbk *obj) |
void | ReInit (const GTopic *obj) |
void | ReInit (const GClass *obj) |
void | ReInit (const GCommunity *obj) |
bool | InsertFdbk (GProfile *prof, GDoc *doc, tFdbkType fdbk, R::RDate done, bool load=false) |
bool | InsertFdbk (size_t profid, size_t docid, tFdbkType fdbk, R::RDate done, bool load=false) |
void | UpdateCommunity (GProfile *prof) |
void | UpdateCommunity (size_t profid) |
void | SetName (GUser *user, const R::RString &name, const R::RString &fullname=R::RString::Null) |
void | SetName (GProfile *profile, const R::RString &name) |
void | SetSocial (GProfile *profile, bool social) |
void | SetConfidence (GProfile *profile, double score, char level) |
void | UpdateProfiles (size_t docid) |
void | UpdateTopic (GDoc *doc) |
void | UpdateTopic (size_t docid) |
Public Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
virtual RCString | GetClassName (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) |
Public Member Functions inherited from GKB | |
virtual | ~GKB (void)=0 |
tObjState | GetState (void) const |
GStorage * | GetStorage (void) const |
GConceptType * | GetTokenType (void) const |
GConceptType * | GetDCMIType (void) const |
GConceptType * | GetURIType (void) const |
GConceptType * | GetNamedEntityType (void) const |
GConceptType * | GetTaxonomyType (void) const |
GConcept * | GetContent (void) const |
GConcept * | GetUnknown (void) const |
GConcept * | GetURI (void) const |
GConcept * | GetNamedEntity (void) const |
GConcept * | GetIsA (void) const |
GConcept * | GetSynonym (void) const |
GConcept * | GetPartOf (void) const |
size_t | GetNbObjs (const GConceptType *obj) const |
size_t | GetMaxObjId (const GConceptType *obj) const |
GConceptType * | GetObj (const GConceptType *obj, char id, bool null) |
GConceptType * | GetObj (const GConceptType *obj, const R::RString &name, bool null) |
R::RCursor< GConceptType > | GetObjs (const GConceptType *obj) const |
GConceptType * | InsertObj (const GConceptType *obj, tConceptCat cat, size_t id, const R::RString &name, const R::RString &desc, bool &newone) |
GConceptType * | InsertObj (const GConceptType *obj, tConceptCat cat, size_t id, const R::RString &name, const R::RString &desc) |
GConceptType * | InsertObj (const GConceptType *obj, tConceptCat cat, const R::RString &name, const R::RString &desc, bool &newone) |
GConceptType * | InsertObj (const GConceptType *obj, tConceptCat cat, const R::RString &name, const R::RString &desc) |
size_t | GetNbObjs (const GConcept *obj) const |
size_t | GetMaxObjId (const GConcept *obj) const |
R::RCursor< GConcept > | GetObjs (const GConcept *obj) const |
GConcept * | GetObj (const GConcept *obj, size_t id) |
GConcept * | GetObj (const GConcept *obj, GConceptType *type, const R::RString &concept, bool null=false) |
GConcept * | InsertObj (const GConcept *obj, GConceptType *type, const R::RString &concept, bool &newone) |
GConcept * | InsertObj (const GConcept *obj, GConceptType *type, const R::RString &concept) |
GConcept * | InsertObj (const GConcept &concept, bool &newone) |
GConcept * | InsertObj (const GConcept &concept) |
GConcept * | RenameObj (GConcept *concept, const R::RString &name) |
void | DeleteObj (GConcept *concept) |
GStatement * | GetObj (const GStatement *obj, size_t id, bool null=false) |
GStatement * | GetObj (const GStatement *obj, GObject *subject, GObject *predicate, GObject *value, bool null=false) |
GStatement * | InsertObj (const GStatement *obj, size_t id, GObject *subject, GObject *predicate, GObject *value, double weight, bool &newone) |
GStatement * | InsertObj (const GStatement *obj, size_t id, GObject *subject, GObject *predicate, GObject *value, double weight) |
Public Member Functions inherited from RConfig | |
RConfig (void) | |
RConfig (bool dirs, const RString ¶m1, const RString ¶m2=RString::Null) | |
void | SetParams (bool dirs, const RString ¶m1, const RString ¶m2=RString::Null) |
void | Load (lParams *cat, RXMLTag *tag) |
void | Save (lParams *cat, RXMLStruct &config, RXMLTag *parent) |
void | Load (bool global=true, bool exist=false) |
void | Save (void) |
RCursor< RParam > | GetParams (const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | GetCategories (RContainer< RString, true, false > &cats, const RString &cat=RString::Null, const RString &subcat=RString::Null) |
T * | FindParam (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | InsertParam (RParam *param, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | Reset (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
RString | Get (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
int | GetInt (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
unsigned int | GetUInt (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
long | GetLong (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
unsigned long | GetULong (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
double | GetDouble (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
bool | GetBool (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
RCursor< RString > | GetList (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
RCursor< RParam > | GetStruct (const RString &name, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | Set (const RString &name, const RString &v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | SetInt (const RString &name, int v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | SetUInt (const RString &name, size_t v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | SetDouble (const RString &name, double v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | SetBool (const RString &name, bool v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | AddToList (const RString &name, const RString &v, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
void | AddToStruct (const RString &name, RParam *param, const RString &cat=RString::Null, const RString &subcat=RString::Null, const RString &subsubcat=RString::Null) |
virtual | ~RConfig (void) |
Public Member Functions inherited from GClasses | |
GClasses (GSession *session, size_t max) | |
GClasses * | GetClassTree (void) |
GClass * | GetFirst (void) const |
GClass * | GetLast (void) const |
size_t | GetMaxDepth (void) const |
size_t | GetNbNodes (void) const |
size_t | GetNbTopNodes (void) const |
size_t | GetTab (GClass **tab, GClass *node, bool children=false) |
size_t | GetNbObjs (const GClass *obj) const |
size_t | GetMaxObjId (const GClass *obj) const |
size_t | GetMaxObjPos (const GClass *obj) const |
R::RCursor< GClass > | GetObjs (const GClass *obj) const |
size_t | GetObjs (GClass **&tab, bool alloc) |
GClass * | GetObj (const GClass *obj, size_t id, bool load=true, bool null=false) |
GClass * | GetObj (const GClass *obj, const R::RString &name, bool load=true, bool null=false) |
void | LoadIndex (const GClass *obj, GConcept *concept, R::RNumContainer< size_t, true > &refs) |
void | BuildIndex (const GClass *obj) |
virtual void | InsertObj (GClass *parent, GClass *obj) |
virtual void | DeleteObj (GClass *obj) |
double | GetUpOperationsCost (const GClass *u, const GClass *v) const |
Public Member Functions inherited from GSubjects | |
size_t | GetMaxDepth (void) const |
size_t | GetNbObjs (const GSubject *obj) const |
R::RCursor< GSubject > | GetObjs (const GSubject *obj) const |
R::RNodeCursor< GSubjects, GSubject > | GetObjs (const GSubject *obj, const GSubject *parent) const |
size_t | GetObjs (GSubject **subjects) |
GSubject * | GetObj (const GSubject *obj, size_t id) const |
GSubject * | GetObj (const GSubject *obj, const R::RString &name) const |
void | InsertObj (GSubject *to, GSubject *subject) |
size_t | GetNbUsedObjs (tObjType type) const |
size_t | GetNbObjs (const GSubject *obj, GDoc *doc) const |
R::RCursor< GSubject > | GetObjs (const GSubject *obj, const GDoc *doc) const |
const GSubject * | GetObj (const GSubject *obj, const GDoc *doc, bool one=true) const |
void | SetUsed (GSubject *subject, bool select) |
bool | IsUsed (const GDoc *doc) const |
size_t | GetUsedObjs (GDoc **docs) |
R::RCursor< GDoc > | GetUsedObjs (const GDoc *obj) const |
bool | IsFromParentSubject (const GDoc *doc, const GSubject *subject) const |
bool | IsFromSubject (const GDoc *doc, const GSubject *subject) const |
void | InsertObj (GSubject *subject, GDoc *doc) |
void | SetUsed (GDoc *doc, GSubject *subject, bool select) |
const GSubject * | GetObj (const GSubject *obj, const GProfile *profile) const |
void | InsertObj (GSubject *subject, GProfile *profile) |
const GSubject * | GetObj (const GSubject *obj, const GCommunity *com) const |
void | SetDescType (tSubjectDesc type) |
void | Repair (void) |
Public Member Functions inherited from RTree< T, N, bAlloc > | |
RTree (void) | |
void | ClearNode (N *node) |
N * | GetFirst (void) const |
N * | GetLast (void) const |
size_t | GetMaxDepth (void) const |
N * | GetTop (void) |
const N * | GetTop (void) const |
size_t | GetNbNodes (void) const |
size_t | GetNbTopNodes (void) const |
size_t | GetTab (N **tab, N *node, bool children=false) |
void | InsertNode (N *to, N *node) |
void | DeleteNodes (N *node, bool del=bAlloc) |
void | DeleteNode (N *node, bool del=bAlloc) |
void | UpdateDepth (N *node) |
void | MoveNode (N *to, N *node) |
void | Copy (const RTree< T, N, a > &src) |
void | DeepCopy (N *src, N *newparent) |
N * | GetNode (const TUse &tag) const |
double | GetUpOperationsCost (const N *u, const N *v) const |
virtual | ~RTree (void) |
Private Member Functions | |
void | Init (void) |
void | EmitReInit (tObjType type, bool del) |
bool | IsDefined (const R::RContainer< GVector, true, true > &vectors) |
Private Member Functions inherited from GObjects< C, hEvents > | |
GObjects (GSession *session, size_t size, const R::RString &name, tObjType type) | |
size_t | GetNbObjs (const C *obj) const |
size_t | GetMaxObjId (const C *obj) const |
size_t | GetMaxObjPos (const C *obj) const |
R::RCursor< C > | GetObjs (const C *obj) const |
size_t | GetObjs (C **&tab, bool alloc) |
C * | GetObj (const C *obj, size_t id, bool load=true, bool null=false) |
C * | GetObj (const C *obj, const R::RString &name, bool load=true, bool null=false) |
void | LoadIndex (const C *obj, GConcept *concept, R::RNumContainer< size_t, true > &refs) |
void | BuildIndex (const C *obj) |
void | LoadTree (const C *obj, GConceptTree *&tree, size_t blockid, size_t id) |
void | LoadTree (const C *obj, R::RContainer< GConceptRecord, false, true > &records, size_t &nbrecords, size_t &nbtoprecords, size_t &nbrefs) |
bool | FindDepthFirstRecord (const C *obj, GConceptRecord &rec, size_t idx) |
bool | FindRecord (const C *obj, GConceptRecord &rec, size_t synpos) |
bool | FindParentRecord (const C *obj, const GConceptRecord &search, GConceptRecord &rec) |
bool | FindFirstChildRecord (const C *obj, const GConceptRecord &search, GConceptRecord &rec, size_t idx) |
bool | FindNearestRecord (const C *obj, GConceptRecord &rec, size_t synpos) |
bool | FindNearestRecord (const C *obj, GConceptRecord &rec, size_t synpos, bool after) |
bool | FindRootRecord (const C *obj, const GConceptRecord &rec1, const GConceptRecord &rec2, GConceptRecord &rec) |
size_t | GetMinPosRecord (const C *obj, const GConceptRecord &rec, size_t nbbefore) |
size_t | GetMaxPosRecord (const C *obj, const GConceptRecord &rec, size_t nbafter) |
size_t | GetMaxPosRecord (const C *obj) |
size_t | GetMaxSyntacticPosRecord (const C *obj) |
size_t | GetNbTotalChildRecords (const C *obj, const GConceptRecord &rec) |
virtual | ~GObjects (void) |
Private Member Functions inherited from GObjects< GCommunity, hCommunities > | |
GObjects (GSession *session, size_t size, const R::RString &name, tObjType type) | |
virtual void | InsertObj (GCommunity *obj, GCommunity *parent=0) |
virtual void | DeleteObj (GCommunity *obj) |
size_t | GetNbObjs (const GCommunity *obj) const |
size_t | GetMaxObjId (const GCommunity *obj) const |
size_t | GetMaxObjPos (const GCommunity *obj) const |
R::RCursor< GCommunity > | GetObjs (const GCommunity *obj) const |
size_t | GetObjs (GCommunity **&tab, bool alloc) |
GCommunity * | GetObj (const GCommunity *obj, size_t id, bool load=true, bool null=false) |
GCommunity * | GetObj (const GCommunity *obj, const R::RString &name, bool load=true, bool null=false) |
void | LoadIndex (const GCommunity *obj, GConcept *concept, R::RNumContainer< size_t, true > &refs) |
void | BuildIndex (const GCommunity *obj) |
void | LoadTree (const GCommunity *obj, GConceptTree *&tree, size_t blockid, size_t id) |
void | LoadTree (const GCommunity *obj, R::RContainer< GConceptRecord, false, true > &records, size_t &nbrecords, size_t &nbtoprecords, size_t &nbrefs) |
bool | FindDepthFirstRecord (const GCommunity *obj, GConceptRecord &rec, size_t idx) |
bool | FindRecord (const GCommunity *obj, GConceptRecord &rec, size_t synpos) |
bool | FindParentRecord (const GCommunity *obj, const GConceptRecord &search, GConceptRecord &rec) |
bool | FindFirstChildRecord (const GCommunity *obj, const GConceptRecord &search, GConceptRecord &rec, size_t idx) |
bool | FindNearestRecord (const GCommunity *obj, GConceptRecord &rec, size_t synpos) |
bool | FindNearestRecord (const GCommunity *obj, GConceptRecord &rec, size_t synpos, bool after) |
bool | FindRootRecord (const GCommunity *obj, const GConceptRecord &rec1, const GConceptRecord &rec2, GConceptRecord &rec) |
size_t | GetMinPosRecord (const GCommunity *obj, const GConceptRecord &rec, size_t nbbefore) |
size_t | GetMaxPosRecord (const GCommunity *obj, const GConceptRecord &rec, size_t nbafter) |
size_t | GetMaxPosRecord (const GCommunity *obj) |
size_t | GetMaxSyntacticPosRecord (const GCommunity *obj) |
size_t | GetNbTotalChildRecords (const GCommunity *obj, const GConceptRecord &rec) |
virtual | ~GObjects (void) |
Private Attributes | |
size_t | Id |
R::RString | Name |
bool | ValidConfigFile |
R::RTextFile | Log |
int | CurrentRandom |
R::RRandom | Random |
bool | ExternBreak |
GSimulator * | Simulator |
bool | ClusterSelectedDocs |
GDocAnalyze | DocAnalyze |
bool | AnalyzerReserved |
Detailed Description
Generic Session.
The GSession provides a representation for a GALILEI session.
The session generates several notifications, including 'Reset' and 'ResetFile' and 'ForceReCompute'.
Constructor & Destructor Documentation
GSession | ( | size_t | id, |
const R::RString & | name | ||
) |
Constructor.
- Parameters
-
id Identifier. name Name of the session.
GSession | ( | size_t | id, |
const R::RString & | name, | ||
const R::RString & | configdir | ||
) |
Constructor.
- Parameters
-
id Identifier. name Name of the session. configdir Directory where to search for the configuration file of the session.
|
virtual |
Destruct the session.
Member Function Documentation
|
virtual |
This method is call when no handler is founded for a notification send by the session. Actually, it does nothing.
- Parameters
-
notification Notification.
Reimplemented from RObject.
size_t GetId | ( | void | ) | const |
- Returns
- the identifier of the session.
R::RString GetName | ( | void | ) | const |
- Returns
- the name of the session.
int Compare | ( | const GSession & | session | ) | const |
Compare two session regarding their identifiers.
- Parameters
-
session Session to compare with.
- Returns
- a value compatible with R::RContainer.
int Compare | ( | size_t | id | ) | const |
Compare the identifier of the session with a given one.
- Parameters
-
id Identifier to compare with.
- Returns
- a value compatible with R::RContainer.
int Compare | ( | const R::RString & | name | ) | const |
Compare the name of the session with a given one.
- Parameters
-
name Name to compare with.
- Returns
- a value compatible with R::RContainer.
R::RTextFile& GetLog | ( | void | ) |
- Returns
- the log file current used.
bool MustBreak | ( | void | ) |
See if the session must break.
void ResetBreak | ( | void | ) |
Reset the break on a session. This method must be called after a SetBreak to allow the session to do something again.
void SetBreak | ( | void | ) |
Ask to session to break as soon as possible. The method ResetBreak should be called to allow the session to do something again.
int GetCurrentRandom | ( | void | ) | const |
Get The Current RandomSeed.
- Returns
- The current RandomSeed.
size_t GetCurrentRandomValue | ( | size_t | max | ) |
Get a current Random Value.
- Parameters
-
max Max Random Value.
- Returns
- The current Random value * max.
R::RRandom& GetRandom | ( | void | ) |
Get the random number generator.
- Returns
- Pointer to RMath::RRandom;
void ApplyConfig | ( | void | ) |
Apply the internal configuration. This method must be called to take changes in the configuration into account.
bool MustSaveResults | ( | void | ) | const |
Verify if the results of the computations must be saved.
void SetCurrentRandom | ( | int | rand | ) |
Set The Current RandomSeed.
- Parameters
-
rand Current RandomSeed.
void SetSaveResults | ( | bool | save = true | ) |
Set if the results of the computation must be saved or not.
- Parameters
-
save Save the objects after computation?
R::RString AnalyzeString | ( | const R::RString & | str | ) |
Analyze a given string to search for variables of the type '%var%'. These variables are then replaced with the corresponding value. Actually, the known variables are:
- %world% : Name of the session.
- Parameters
-
str String to analyze.
GDocAnalyze* ReserveAnalyzer | ( | void | ) |
Reserve a document analyzer. While it is not released, it cannot be used by the session.
- Returns
- a pointer to a GDocAnalyze.
void ReleaseAnalyzer | ( | GDocAnalyze * | analyzer | ) |
Release an analyzer.
- Parameters
-
analyzer Analyzer to release.
Analyze a document.
If multiple analyzers are managed by the session, one is randomly chosen.
- Parameters
-
doc Pointer to the document to analyze. rec Receiver for the signals. force Force the analysis of the document? download Try to download locally the document?
- Exceptions
-
When no analyzer is available.
void AnalyzeDocs | ( | GSlot * | rec = 0 | ) |
Analyze the documents. At the end, all the enabled post-documents methods are run.
All enabled analyzers managed by the session are used.
- Parameters
-
rec Receiver for the signals.
- Exceptions
-
When no analyzer is available.
void GroupDocs | ( | GSlot * | rec = 0 | ) |
Groups the documents into topics. At the end, all the enabled post-topic computing methods are called.
- Parameters
-
rec Receiver of the signals.
void CalcProfile | ( | GProfile * | profile, |
GProfileCalc * | method = 0 , |
||
GLinkCalc * | linkcalc = 0 , |
||
GSlot * | rec = 0 |
||
) |
Compute a profile.
- Parameters
-
profile Profile to compute. method Profile Computation method. linkcalc Link Computation method. rec Receiver for the signals.
void CalcProfiles | ( | GSlot * | rec = 0 | ) |
Compute the profiles.
- Parameters
-
rec Receiver for the signals.
void GroupProfiles | ( | GSlot * | rec = 0 | ) |
Groups the profiles into communities. At the end, all the enabled post-community computing methods are called.
- Parameters
-
rec Receiver of the signals.
void ComputeSugs | ( | GSlot * | rec = 0 | ) |
Run all the enabled suggestions computing methods.
- Parameters
-
rec Receiver of the signals.
void ComputeTrust | ( | GSlot * | rec = 0 | ) |
Run all the enabled trust computing methods.
- Parameters
-
rec Receiver of the signals.
void RunTool | ( | const R::RString & | name, |
const R::RString & | list, | ||
GSlot * | slot = 0 , |
||
bool | need = true |
||
) |
Run a specific tool.
- Parameters
-
name Name of the tool. list List of the tool. slot Slot. need If set to true and the tool doesn't exist, it generates an exception.
void RequestMetaEngine | ( | const R::RString & | query, |
size_t | caller | ||
) |
Send a query to the meta-engine selected. The documents are researched and ranked.
Each time the meta-engine is called, it is associated with a given data structure which is reserved by GSession. It is used to store the results. To safe resources, it is a good practice that the developer calls the GSession::ClearMetaEngine method to free the used data structure.
- Parameters
-
query String representing the query. caller Identifier of the caller (for example a thread).
void ClearMetaEngine | ( | size_t | caller | ) |
Clear the default meta engine by freeing the data structure reserved for it.
- Parameters
-
caller Identifier of the caller (for example a thread).
size_t GetNbObjs | ( | tObjType | type | ) | const |
Get the number of elements of a given type.
- Parameters
-
type Type of the elements.
- Returns
- Number of elements.
size_t GetMaxObjId | ( | tObjType | type | ) | const |
Get the highest identifier for the elements of a given type.
- Parameters
-
type Type of the elements.
- Returns
- Highest identifier.
size_t GetMaxObjPos | ( | tObjType | type | ) | const |
Get the maximum position of the objects of a given type handled.
- Parameters
-
type Type of the elements.
- Returns
- Maximum position occupied by the elements.
Find an object of a given type and with a particular identifier.
- Parameters
-
type Type. Only the objects managed. id Identifier. null If set to true, if the object does not exist, return 0, else an exception is generated.
- Returns
- Pointer to the object.
Fill an array of pointers with the elements of a given type.
- Parameters
-
type Type of the elements. tab Array that will be filled. alloc Must the array be allocated.
- Returns
- number of elements in the array (including null pointers).
void VerifyTab | ( | tObjType | type, |
size_t | max | ||
) |
Verify that a given set of containers can hold a given size of objects. This method can be useful before a given set of elements is loaded in order to avoid a constant increase of the corresponding containers.
- Parameters
-
type Type of the container. max Maximum number of objects.
GSimulator* GetSimulator | ( | void | ) | const |
- Returns
- Simulator associated with the session.
void ReInit | ( | const GSubject * | obj, |
bool | cleardocs | ||
) |
Re-initialize the subjects for a new validation process. In practice, the methods deselects all the documents, and delete the users, the feedbacks, the profiles, the communities, the topics and the classes. Eventually, the document descriptions are cleared too.
The method sends several hReInit notifications.
- Parameters
-
obj Pseudo-parameter. cleardocs Should the documents descriptions be cleared.
void ReInit | ( | const GDoc * | obj, |
bool | del | ||
) |
Re-initialize the documents. In practice, the method deletes the topics and the classes since they depend directly from the documents descriptions. If the documents must be deleted, the method also deletes the feedbacks.
The method sends several hReInit notifications.
- Parameters
-
obj Pseudo-parameter. del Should the documents be deleted or just their descriptions cleared.
void ReInit | ( | const GUser * | obj | ) |
Re-initialize the users. In practice, the method deletes the users, the profiles, the communities and the feedbacks.
The method sends several hReInit notifications.
- Parameters
-
obj Pseudo-parameter.
void ReInit | ( | const GProfile * | obj, |
bool | del | ||
) |
Re-initialize the profiles. In practice, the method deletes the communities since they depend directly from the profiles descriptions. If the profiles must be deleted, the method also deletes the feedbacks.
The method sends several hReInit notifications.
- Parameters
-
obj Pseudo-parameter. del Should the profiles be deleted or just their descriptions cleared.
void ReInit | ( | const GFdbk * | obj | ) |
Delete the feedbacks.
The method sends a hReInit notification.
- Parameters
-
obj Pseudo-parameter.
void ReInit | ( | const GTopic * | obj | ) |
Delete the topics.
The method sends a hReInit notification.
- Parameters
-
obj Pseudo-parameter.
void ReInit | ( | const GClass * | obj | ) |
Delete the classes.
The method sends a hReInit notification.
- Parameters
-
obj Pseudo-parameter.
void ReInit | ( | const GCommunity * | obj | ) |
Delete the communities.
The method sends a hReInit notification.
- Parameters
-
obj Pseudo-parameter.
Add a new feedback of a given profile on a given document.
- Parameters
-
prof Profile. doc Document. fdbk Feedback type. done Date on the last feedback. load Is the feedback loaded from the storage or not. It should be always true if the method is call from a GStorage child class.
- Returns
- true if it is a new feedback.
Add a new feedback of a given profile on a given document.
- Parameters
-
profid Identifier of the profile. docid Identifier of the document. fdbk Feedback type. done Date on the last feedback. load Is the feedback loaded from the storage or not. It should be always true if the method is call from a GStorage child class.
- Returns
- true if it is a new feedback.
void UpdateCommunity | ( | GProfile * | prof | ) |
A profile was updated and the corresponding community must be updated.
- Parameters
-
prof Profile.
void UpdateCommunity | ( | size_t | profid | ) |
A profile was updated and the corresponding community must be updated.
- Parameters
-
profid Identifier of the profile.
void SetName | ( | GUser * | user, |
const R::RString & | name, | ||
const R::RString & | fullname = R::RString::Null |
||
) |
Set the name of a user.
- Parameters
-
user User. name Name of the user. fullname Full name of the user. If null string, the name is used.
void SetName | ( | GProfile * | profile, |
const R::RString & | name | ||
) |
Set the name of a profile.
- Parameters
-
prof Profile. name Name.
void SetSocial | ( | GProfile * | profile, |
bool | social | ||
) |
Set if a profile is social.
- Parameters
-
prof Profile. social Social value.
void SetConfidence | ( | GProfile * | profile, |
double | score, | ||
char | level | ||
) |
Set the confidence score and level of a profile.
- Parameters
-
prof Profile. score Confidence level. level Confidence score.
void UpdateProfiles | ( | size_t | docid | ) |
A document was updated and the profiles that have made a feedback on it must be updated.
- Parameters
-
docid Identifier of the document.
void UpdateTopic | ( | GDoc * | doc | ) |
A document was updated and the corresponding topic must be updated.
- Parameters
-
doc Document.
void UpdateTopic | ( | size_t | docid | ) |
A document was updated and the corresponding topic must be updated.
- Parameters
-
docid Identifier of the document.
|
private |
Initialize the session.
|
private |
Emit a hReInit notification for a given object type.
- Parameters
-
type Type of the objects. del Were the objects deleted ?
|
private |
Verify if at least one vector is defined in the container.
- Parameters
-
vectors Vectors.
- Returns
- true if the container is defined.
Member Data Documentation
|
private |
Identifier of the session.
|
private |
Name of the session.
|
private |
Specify if the configuration file is a valid one.
|
private |
Log file for the session.
|
private |
Current seek for the session.
|
private |
Random number generator.
|
private |
External break.
|
private |
The simulator (if any).
|
private |
Limit the clustering of the documents to the selected ones.
|
private |
Analyze of the document.
|
private |
Is the analyzer reserved ?