vsTASKER 7 User Manual
×
Menu
Index

Context

 
A Context is a Knowledge object that contains several user defined Rules.
It processes Rules in sequence and trigger them if their conditions succeed. 
A Context expresses one semantic. For example, in a Crossing Knowledge, you might decide to give three Contexts: Pedestrians, Traffic Lights, Stop Sign. Each of these Contexts will harbor Rules relative to their own semantic. Each of them will them populate a Knowledge Fact database that could be used by a Logic to decide whether or not to cross the intersection.
 
 
Rules of a Context are processed from first to last.
When a Rule is triggered (then part or else part if valid), predefined conditions resets the Rule or not.
A Rule can only be triggered (fired) once until it is reset. 
 
When a whole Context is reset, all embedded Rules are also reset and are ready to be fired again.
 
 

Edit Knowledge: Call the Knowledge property window.
Add Context: To add contexts into the Knowledge. You can also use on the toolbar, then, click anywhere on the Drawing Area (Diagram).
 
Add Text: Add a Text for comment.
 
 
Select All: select all Contexts of the Knowledge (useful for moving symbols or deleting them).
 
Entry Point (EPoint, green head) and Exit Point (XPoint, red head) cannot be added alone. They must be attached to a Context. If a Context is already selected, clicking the EPoint or XPoint button will immediately create and attach the point to it. Otherwise, cursor will change until a Context is designated into the diagram for dropping the point.
For EPoint or XPoint property windows, see here.
 
Add a Text on the diagram for comment.
 
A Context must have an Entry Point in order to be evaluated. Without an EPoint, the Context stays idle (but can be started from the code by a Logic or a Rule).
 
 
scen() or S: is a macro that returns a pointer to the Scenario instance that holds the Entity instance that holds the Knowledge instance that holds the current Context.
ent() or E: is a macro that returns a pointer to the Entity instance that holds the Knowledge instance that holds the current Context.
know() or K: is a macro that returns a pointer to the Knowledge instance that holds the current Context.