Subjects. More...
#include <gsimulator.h>
Public Member Functions | |
GSimulator (GSession *session) | |
GSession * | GetSession (void) const |
void | ApplyParams (void) |
template<class T > | |
T * | FindParam (const R::RString &name) |
void | StartSimulation (bool create=true) |
bool | AddSubject (void) |
void | ShareDocuments (void) |
void | AddAssessments (void) |
size_t | AddProfiles (void) |
void | PerformDegradation (char what, int nb) |
void | BuildIdealCommunities (void) |
void | BuildIdealTopics (void) |
void | BuildIdealLeafTopics (void) |
void | BuildIdealClasses (void) |
void | BuildIdealDocsClasses (void) |
~GSimulator (void) | |
Static Public Member Functions | |
static void | CreateConfig (R::RConfig *config) |
Private Member Functions | |
void | InitSubject (GSubject *subject, bool selectdocs) |
void | SelectSubjects (void) |
void | CreateAssessments (void) |
void | ProfileAssess (GProfile *prof, GSubject *sub, size_t max, size_t maxDocsOK, size_t maxDocsKO, size_t maxDocsH) |
template<class cGroup , class cObj , class cCalc > | |
void | CopyIdealGroups (tObjType objtype, tObjType grouptype, cCalc *calc) |
void | BuildClass (GSubject *subject, GClass *parent) |
Private Attributes | |
GSession * | Session |
bool | ManualSubjects |
double | NbSubjects |
bool | RelSubjects |
size_t | MaxDepth |
size_t | NbMinDocsSubject |
double | NbDocsPerSubject |
bool | PercNbDocsPerSubject |
bool | MultipleSubjects |
size_t | NbProfMax |
size_t | NbProfMin |
double | PercSocial |
double | NbOK |
bool | RelOK |
double | NbKO |
bool | RelKO |
double | NbH |
bool | RelH |
size_t | NbDocsAssess |
double | PercErr |
double | SwitchPerc |
bool | CreateProfiles |
GTopic ** | TmpTopics |
GDoc ** | TmpDocs |
size_t | NbTmpDocs |
R::RContainer< GFdbk, false, false > | NewDocs |
R::RRandom * | SwitchRandom |
size_t | SwitchPos |
R::RContainer< GProfile, false, false > | NewProfiles |
Detailed Description
Subjects.
The GSimulator class provides a simulator that can be used for validation purposes.
Constructor & Destructor Documentation
GSimulator | ( | GSession * | session | ) |
Constructor of the simulator.
- Parameters
-
session Session.
~GSimulator | ( | void | ) |
Destruct the simulator.
Member Function Documentation
GSession* GetSession | ( | void | ) | const |
- Returns
- The session corresponding to the simulator.
|
static |
Create the configuration parameter related to the simulator.
- Parameters
-
config Configuration file.
void ApplyParams | ( | void | ) |
Assign the values of the parameters to the corresponding variables.
T* FindParam | ( | const R::RString & | name | ) |
Find a given parameter (template version).
- Template Parameters
-
T Type of the parameter.
- Parameters
-
name Name of the parameter.
- Returns
- Pointer or null if not found.
void StartSimulation | ( | bool | create = true | ) |
Start a simulation. A given set of subjects is chosen, then the users are created and the assessments for all the users are randomly created. The results are saved if the corresponding parameter is set in the session.
- Parameters
-
create Must topics be selected (and profiles created).
bool AddSubject | ( | void | ) |
Add a new not used topic.
- Returns
- true if a not used topic was found.
void ShareDocuments | ( | void | ) |
Simulate that documents are shared inside the different communities and that the first NbDocsAssess documents are assessed.
void AddAssessments | ( | void | ) |
Simulate that all existing profiles that already have assess some documents, assess randomly NbDocsAssess documents.
size_t AddProfiles | ( | void | ) |
Add a given set of new profiles for an existing subject randomly chosen.
- Returns
- Number of profiles created.
void PerformDegradation | ( | char | what, |
int | nb | ||
) |
Perform a degradation. The ideal clustering is used as the current one, and a list of objects to assign to another group is determined.
- Parameters
-
what Describe what to do: - Initialize the degradation (what=0).
- Make the ideal clustering the current one (what=1). Eventually, randomly selected topics are merged or split.
- Take a given percentage of objects and assign them to a "wrong" group (what=2).
nb Number of clusters to merge (nb<0) or to split (nb>0) (only if what==1).
The J measure and the adjusted Rand index are then computed (except for what=0).
|
private |
Initialize a given subject by creating some profiles and eventually selecting a set of documents.
- Parameters
-
subject Subject to select. selectdocs Must documents be created ?
|
private |
Choose the subjects that will be used.
|
private |
Create a set of assessments for the profiles of the used subjects.
|
private |
Simulation of assessments for a profile on a given subject.
- Parameters
-
prof Profile that assesses the documents. sub Subject. max Maximal documents to assess. maxDocsOK Maximal relevant documents to assess. maxDocsKO Maximal fuzzy relevant documents to assess. maxDocsH Maximal irrelevant documents to assess.
Copy the ideal groups into the current clustering.
- Parameters
-
objtype Type of the clustering (otProfile or otDoc). grouptype Type of the groups (otCommunity or otTopic). calc Method used to compute the groups descriptions.
Build a new class corresponding to a given subject.
- Parameters
-
subject Corresponding subject. parent Parent class.
void BuildIdealCommunities | ( | void | ) |
Build the ideal communities, each community corresponds to a subject having documents. The descriptions of the communities are computed using the current plug-in.
void BuildIdealTopics | ( | void | ) |
Build the ideal topics, each topic corresponds to a subject having documents. The descriptions of the topics are computing using the current plug-in.
void BuildIdealLeafTopics | ( | void | ) |
Build the ideal topics, each topic correspond to a "leaf" subject. The descriptions of the topics are formed using the labels of the subject and its parents (each label correspond to one information entity, i.e. "genetic algorithms" is considered as one 'term').
void BuildIdealClasses | ( | void | ) |
Build the ideal classes, each class correspond to a subject. The descriptions of the classes are formed using the labels of the subject and its parents (each label correspond to one information entity, i.e. "genetic algorithms" is considered as one 'term').
void BuildIdealDocsClasses | ( | void | ) |
Build the ideal classes, each class correspond to a subject. The descriptions of the classes are formed using the description of the documents (for a "leaf" subject) or the children (for a "non-leaf" subject).
Member Data Documentation
|
private |
The Session.
|
private |
Are the subject manually selected or automatically.
|
private |
Number of subjects to randomly select.
|
private |
Number of subjects is relative or absolute.
|
private |
Maximal depth of the subjects to be treated.
|
private |
Minimal number of documents in a subject to use it.
|
private |
Number of documents to select for each used subject.
|
private |
Number of documents per subject is relative or absolute.
|
private |
A same document is selected multiple times.
|
private |
Maximal number of profiles to create in each used subject.
|
private |
Minimal number of profiles to create in each used subject.
|
private |
Percentage of profiles that are social, i.e. not alone in a community.
|
private |
Number of relevant documents for which an assessment of a profile from the same subject is simulated.
|
private |
Number of relevant documents is relative or absolute.
|
private |
Number of fuzzy relevant documents for which an assessment of a profile from the same subject is simulated.
|
private |
Number of fuzzy relevant documents is relative or absolute.
|
private |
Number of irrelevant documents for which an assessment of a profile from the same subject is simulated.
|
private |
Is the number of irrelevant documents relative or absolute. If relative, it is computed as a percentage of the relevant documents created) or absolute.
|
private |
Number of documents to be assessed during a feedback process.
|
private |
Percentage of documents assessed with an error.
|
private |
Percentage of documents to switch from one subject to another at each step of the degradation.
|
private |
Create profiles.
|
private |
Temporary array of topics.
|
private |
Temporary array of documents.
|
private |
Number of temporary documents.
|
private |
New documents to assess.
|
private |
Random generator of switching documents.
|
private |
Position of next document to switch.
|
private |
New profiles created during an action of the simulator.