Embedding Agents within Ambient Intelligent Applications