#include <tvu_sr.h>
Inheritance diagram for CTSRModel::
Public Methods | |
CTSRModel () | |
Constructor/destructor. More... | |
~CTSRModel () | |
DEFINE_ID_FUNCTIONS (CTSRModel, CTObject, CLASSNAME_SR_SRMODEL_ID, CLASSNAME_SR_SRMODEL) public | |
virtual CTAlarm* | GenerateAlarm (CTObject *ScenarioInstance) |
Generate an alarm: this fnction generates a new alarm when a behavior of this model is just recognised. More... | |
virtual TBOOL | IsPrimaryModel () |
To verify if it's a primary model: normally, it's state model This function run correctly is Build was called. More... | |
virtual TINT | ActorOfTypeCount (TINT Type) |
Get the number of actor variable of a type (zone, equipement, wall, ...). More... | |
virtual CTSRModel* | GenerateUncertainModel (TLPCSTR SubscenarioName) |
=============================================================== FOR UNCERTAIN PROCESSING: these functions will be called before all processings Generate a scenrio model by removing a sub-scenario. More... | |
virtual CTList | FindEntityPrivateActorVariables (CTSREntityHolder *pEntity, TBOOL bExpectedEntity=TTRUE) |
Find the actor variables the appear in a given entity but do not appear in the others. More... | |
virtual TBOOL | RemoveAnEntity (TLPCSTR SubscenarioName) |
Remove an entity by it name. More... | |
virtual TBOOL | RemoveConstraints (TLPCSTR VariableName) |
Remove all constraints containing a variable. More... | |
virtual TBOOL | Build () |
Build the constraints Objects: list of environment objects. More... | |
virtual TBOOL | VerifyActorVariable (CTSRVar *pVar) |
For the composed scenarios, we need to verify that all actor variables present in entities. More... | |
virtual TBOOL | VerifyActorVariables () |
virtual TBOOL | CreateNegativeActorVariables () |
Create negative actor variables for the model. More... | |
virtual TBOOL | OrderSubScenarios () |
To order in time the sub-scenarios of the scenario model To do this, we use the method of C. Dousson and M. Ghallab to build a graph of temporal relations of sub-scenarios. More... | |
virtual TBOOL | CreateEntityVars () |
Create entity variables from EntityHolders: Create variable and category them in POSITIVE and NEGATIVE After OrderSubScenarios(). More... | |
virtual TBOOL | AttachVarConstraints () |
Attach variable for the constraints: attach object for the variable presenting in the constraints and create temporal variables if neccessary This fnction must be called after set context for the motor and after CreateEntityVars(); and before ClassifyConstraints();. More... | |
TBOOL | ClassifyConstraints () |
Classify the constraints into 2 categories: Positive constraints and Negative constraints. More... | |
TBOOL | IsPositiveConstraints (CTList Expression) |
TBOOL | CreateNeededNegativeVars () |
Create the list of all needed negative variables for all negative constraints. More... | |
CTList | GetConstraintNeededNegativeVars (CTList Expression, CTList pResult=TNULL) |
Create the list of negative variable needed to evalue a negative constraint Expression: expression to calculate pResult: the list to stock all variables, NULL: create a new list. More... | |
virtual TBOOL | BuildActorVarConstraints () |
Build the constraints for the actor variables: gather the constraints for the actor variables Must be called after AttachVarConstraints(). More... | |
virtual TBOOL | BuildEntityVarConstraints () |
Build the constraints for the entity variables: gather the constraints for the entity variables Must be called after CreateEntityVars(), ClassifyConstraints(), AttachVarConstraints(). More... | |
virtual TBOOL | ModifyTemporalConstraints () |
Replace a temporal variable by an expression to acces to the variable in an intermediate model. More... | |
virtual TBOOL | ModifyTemporalConstraint (CTList pConstraint, CTList pVars, TINT iOrder=-1) |
virtual CTList | GetDependenceModelNames () |
Return the list of dependence model (sub-scenario model) names Before delete tehh list, must call Delete(TFALSE) for remove the list without remove the holded elements. More... | |
virtual CTList | BuildIntermediateModels () |
Generate the list of intermediate models: The list of sub-scenarios must be ordered in time before calling this function S = (S1, S2, S3, S4) => (((S1, S2), S3), S4). More... | |
virtual CTSREntityHolder* | BuildFromOrigin (CTSRModel *pOriginModel, CTSREntityHolder *Start, CTSREntityHolder *Termination) |
An intermediate model build the lists of actors, constraints,... from an original model. More... | |
virtual TLPSTR | GenerateItermediateModelName (TLPSTR pBuff, TINT nModel) |
Generate name for an intermediate model. More... | |
virtual TBOOL | BuildEntities () |
Build entities: link to the variables/actors/objects of enviremet. More... | |
virtual TBOOL | BuildExpectedModels (CTList pModels) |
Build the expected models: create the trigger models. More... | |
virtual TBOOL | IsSatisfied (CTSRTriggerInstance *pTrigger, TBOOL FirstSolution) |
When the actor variables are well attached a value. We call this function to verify if it exists a sequences of entities matching the model. This process will assign for each temporal variable a value. pTrigger: the trigger to verify. NULL -> nothing to verify (primary model). Normally: a complex scenario contains 2 sub-scenarios (start & termination). The termination is contained in the trigger. So we must search only a value for the start. More... | |
virtual TBOOL | VerifyNegativeConstraints () |
If the scenario model contains a negative entity, we need verifying it. Do to this, we need find a recognized scenario sf corresponding the forbidden entity. If it exists a sf satisfying all constraints => the scenario is not recognized. This function is only called in the recgnition of a composed scenario. More... | |
virtual TBOOL | Exists (CTList pEntities, CTList pValues=TNULL) |
virtual CTList | CreateTriggers (CTList pTriggerInstances, CTSRBehaviourInstance *pTermination, TLPCSTR lpCreatedTriggers=TNULL) |
Create the list of trigger instances if the model is satisfied lpCreatedTriggers([0, 1, 1,....]): marks the triggers are used. NULL => create all. More... | |
CTSRObject* | Produce () |
Create and fill in every fields of the produced object. More... | |
virtual TBOOL | IsAutoProlongable () |
Determine if the behaviour may be prolonged automatically without reverification of its constraints This will be called by the initial module. More... | |
CTSRModel& | operator= (CTSRModel &Object) |
Operations. More... | |
Data Fields | |
CTList | m_ActorVars |
The actor variables of the model. More... | |
CTList | m_ExpectedEntities |
For loading the model: This is the definition of experts. More... | |
CTList | m_ForbiddenEntities |
The expected sub behaviors. More... | |
CTList | m_Constraints |
The behaviors are forbidden. More... | |
CTList | m_ProductionFormulas |
All the constraints defined by experts. More... | |
CTSRAlarmModel* | m_AlarmModel |
Object containing every formulas to be used to product a new entity. More... | |
CTList | m_EnVars |
Model of the alarm model Optional. More... | |
CTSREntityHolder* | m_Start |
For model environment variables For compiled model: This is for recognizing the model. More... | |
CTSREntityHolder* | m_Termination |
The start of a behavior. More... | |
CTList | m_PositiveConstraints |
The termination of a behavior. More... | |
CTList | m_NegativeConstraints |
The constraints have not any negative variable. More... | |
CTSRModel* | m_pOriginalModel |
The constraints have atleast one negative variable. More... | |
CTList | m_MissedVariables |
This is used for the intermediate models to indicate its original model. More... | |
CTList | m_Triggers |
This is used to store the temporal variables will be generated by the intermediate models Trigger models: automatically generated by the compiler. More... | |
TBOOL | m_IsBaseClass |
If the model is needed to construct another model. More... | |
TBOOL | m_IsAutoProlongable |
If the behaviour is automatically prolonged: not necessary to reverify the constraints Default: TTRUE. More... | |
TBOOL | m_OneSolutionForPerson |
If the scenario accepts only one solution for a person: e.x. Inside_Zone Default: TFALSE. More... | |
CTList | m_PositiveEntityVars |
Temporal variables: automatically generated by the scenario model compiler. More... | |
CTList | m_NegativeEntityVars |
Temporal variables corresponding to the expected entities. More... | |
CTList | m_NegativeActorsVars |
Temporal variables corresponding to the forbidden entities. More... | |
CTList | m_NeededNegativeVars |
Temporal variables corresponding to the forbidden actors. More... | |
CTList | m_TempVars |
List of list of needed negative variables for each negative constraint. More... | |
CTList | m_ProductionVars |
Temporal variables for the model. More... | |
CTTree | m_OldItemConstructors |
Tree of default constructors. More... | |
Static Public Attributes | |
CTList | m_BuiltExpectedModels |
To stock the models to be built the expected models. More... |
|
Constructor/destructor.
|
|
Get the number of actor variable of a type (zone, equipement, wall, ...).
|
|
Attach variable for the constraints: attach object for the variable presenting in the constraints and create temporal variables if neccessary This fnction must be called after set context for the motor and after CreateEntityVars(); and before ClassifyConstraints();.
|
|
Build the constraints Objects: list of environment objects.
|
|
Build the constraints for the actor variables: gather the constraints for the actor variables Must be called after AttachVarConstraints().
|
|
Build entities: link to the variables/actors/objects of enviremet.
|
|
Build the constraints for the entity variables: gather the constraints for the entity variables Must be called after CreateEntityVars(), ClassifyConstraints(), AttachVarConstraints().
|
|
Build the expected models: create the trigger models.
|
|
An intermediate model build the lists of actors, constraints,... from an original model.
|
|
Generate the list of intermediate models: The list of sub-scenarios must be ordered in time before calling this function S = (S1, S2, S3, S4) => (((S1, S2), S3), S4).
|
|
Classify the constraints into 2 categories: Positive constraints and Negative constraints.
|
|
Create entity variables from EntityHolders: Create variable and category them in POSITIVE and NEGATIVE After OrderSubScenarios().
|
|
Create the list of all needed negative variables for all negative constraints.
|
|
Create negative actor variables for the model.
|
|
Create the list of trigger instances if the model is satisfied lpCreatedTriggers([0, 1, 1,....]): marks the triggers are used. NULL => create all.
|
|
Find the actor variables the appear in a given entity but do not appear in the others.
|
|
Generate an alarm: this fnction generates a new alarm when a behavior of this model is just recognised.
|
|
Generate name for an intermediate model.
00619 { sprintf((char*)pBuff, "%s_%02d", GetName(), nModel); return pBuff; }; |
|
=============================================================== FOR UNCERTAIN PROCESSING: these functions will be called before all processings Generate a scenrio model by removing a sub-scenario.
|
|
Create the list of negative variable needed to evalue a negative constraint Expression: expression to calculate pResult: the list to stock all variables, NULL: create a new list.
|
|
Return the list of dependence model (sub-scenario model) names Before delete tehh list, must call Delete(TFALSE) for remove the list without remove the holded elements.
|
|
Determine if the behaviour may be prolonged automatically without reverification of its constraints This will be called by the initial module.
|
|
To verify if it's a primary model: normally, it's state model This function run correctly is Build was called.
00535 { return m_Termination == TNULL; }; |
|
When the actor variables are well attached a value. We call this function to verify if it exists a sequences of entities matching the model. This process will assign for each temporal variable a value. pTrigger: the trigger to verify. NULL -> nothing to verify (primary model). Normally: a complex scenario contains 2 sub-scenarios (start & termination). The termination is contained in the trigger. So we must search only a value for the start.
|
|
Replace a temporal variable by an expression to acces to the variable in an intermediate model.
|
|
To order in time the sub-scenarios of the scenario model To do this, we use the method of C. Dousson and M. Ghallab to build a graph of temporal relations of sub-scenarios.
|
|
Create and fill in every fields of the produced object.
|
|
Remove an entity by it name.
|
|
Remove all constraints containing a variable.
|
|
For the composed scenarios, we need to verify that all actor variables present in entities.
|
|
If the scenario model contains a negative entity, we need verifying it. Do to this, we need find a recognized scenario sf corresponding the forbidden entity. If it exists a sf satisfying all constraints => the scenario is not recognized. This function is only called in the recgnition of a composed scenario.
|
|
Operations.
|
|
The actor variables of the model.
|
|
Object containing every formulas to be used to product a new entity.
|
|
To stock the models to be built the expected models.
|
|
The behaviors are forbidden.
|
|
Model of the alarm model Optional.
|
|
For loading the model: This is the definition of experts.
|
|
The expected sub behaviors.
|
|
If the behaviour is automatically prolonged: not necessary to reverify the constraints Default: TTRUE.
|
|
If the model is needed to construct another model.
|
|
This is used for the intermediate models to indicate its original model.
|
|
Temporal variables corresponding to the forbidden actors.
|
|
Temporal variables corresponding to the forbidden entities.
|
|
The constraints have not any negative variable.
|
|
Temporal variables corresponding to the expected entities.
|
|
Tree of default constructors.
|
|
If the scenario accepts only one solution for a person: e.x. Inside_Zone Default: TFALSE.
|
|
The termination of a behavior.
|
|
Temporal variables: automatically generated by the scenario model compiler.
|
|
All the constraints defined by experts.
|
|
Temporal variables for the model.
|
|
For model environment variables For compiled model: This is for recognizing the model.
|
|
List of list of needed negative variables for each negative constraint.
|
|
The start of a behavior.
|
|
This is used to store the temporal variables will be generated by the intermediate models Trigger models: automatically generated by the compiler.
|
|
The constraints have atleast one negative variable.
|