A framework for efficient implementation of context-based reasoning in intelligent simulation