However, it's simplicity and speed is also convenient for computer games. Suppose we want the creature to have a set of simulated sensors that report when it is near an object, when it is within firing range, when it is facing the object, etc. At run time, the game would keep a table mapping roles to the internal game objects to which they are bound. The procedure allows the game to efficiently determine the set of objects for which the agent knows the truth of the predicate and also its truth for those objects for which it's known. A role-passing system represents the agent's task and environment in terms of a set of situations and bindings of external objects to roles.
Situations classify the current task and environment.
For example, the agent might have a search situation, which would mean the agent was engaged in searching, and a intruder containment situation, which would mean the agent was attempting to prevent an intruder from moving outside some specified perimeter. Either, both, or none of those situations might be active at any given time. When the search situation is active, the agent will use the inference rules associated with it to solve the search task, and similarly with intruder containment . If both are active, it will run both rules and try to achieve both goals. The specifics of what intruder is being kept within what perimeter, and of what object is being searched for, are specified by role bindings.