{'fraction_non_alphanumeric': 0.02324294410625346, 'fraction_numerical': 0.005534034311012728, 'mean_word_length': 4.830645161290323, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Resource allocation for a limited real-time agent

Introduction A real-time agent with limited perceptual, computational and actuator resources must carefully allocate these resources at execution time to do the best job it can in monitoring for aspects of the world state and responding quickly to emerging hazards in its complex and dynamic environment. If the resource-limited agent allocates more of its resources (or some of its resources more frequently) to monitoring for some states (or state features), then it will be less capable of tracking others successfully. Similarly, it cannot be assumed to execute all the resource-demanding actions equally well. Designing an effective schedule of monitoring for and responding to the most important situations at the right times with the available resources is thus a complex optimization problem. Consider this exceedingly simplified driving example: Suppose a driver driving at a high speed has to do three recognition-reaction tasks periodically. (1) Look ahead for up to 3 seconds every 5 seconds to gather information about the road conditions and reduce speed if appropriate; (2) check the side mirrors for up to 2 seconds every 10 seconds and switch lanes if necessary; (3) check the rear-view mirror every 10 seconds for up to 3 seconds, and accelerate if being tailgated. Although the driver could perform each of these tasks separately, he is not able to guarantee hard real-time performance to all these tasks combined. He may miss a deadline because it would require a total of 11 seconds to complete all operations every 10 seconds if each were to take its worst-case time. The utilization of his resources (here attention), is greater than 1! The driver has no choice but to find a resource-satisfying subset of tasks such that his safety is maximized, or equivalently, the failure probability is minimized. For instance, if being hit by a car approaching from behind is sufficiently unlikely, then he may drop the desire to reliably check the rear-view mirror. He can hold this task on an “if-time” queue (Musliner and et. al., 1993), and do it only when the guaranteed tasks of looking ahead and checking the sides take less than their worst-case times. Essentially, he has purposely chosen to make hard real-time guarantees for the reactions that are more probably going to be needed, and to do only “best effort” on other tasks as slack resources permit. However, determining the likelihood of a real-time agent encountering a particular situation or a state can be challenging because the likelihood is dependent not only on the actions the agent should perform (what to do if the driver is being tailgated), but also on its choices of how frequently it checks whether to perform them (how often the driver looks in the mirrors). By definition, a dynamic environment is one in which the state can change via events outside the agent's control. In general, the sooner a real-time agent detects and responds to a situation, the less opportunity there is for the environmental dynamics to intervene, and the higher the chance that the agent is going to meet its deadlines. The probability of encountering a state thus depends on a complex temporal convolution between the agent’s plan and the exogenous events. One contribution of our work is that we have developed a probabilistic action and event model to efficiently approximate the transition probabilities for a real-time agent. A second contribution is our strategy for using these probabilities to prioritize resource expenditures when the agent cannot be prepared for all eventualities.