Automatic programming, scheduling, and control of planned activities at “worker nodes” in a distributed environment are provided by a “real-time self tuner” (RTST). The RTST provides self-tuning of controlled interoperation among an interconnected set of distributed components (i.e., worker nodes) including, for example, home appliances, security systems, lighting, sensor networks, medical electronic devices, wearable computers, robotics, industrial controls, wireless communication systems, audio nets, distributed computers, toys, games, etc. The RTST acts as a centralized “planner” that is either one of the nodes or a dedicated computing device. A set of protocols allow applications to communicate with the nodes, and allow one or more nodes to communicate with each other. Self-tuning of the interoperation and scheduling of tasks to be performed at each node uses an on-line sampling driven statistical model and predefined node “behavior patterns” to predict and manage resource requirements needed by each node for completing assigned tasks.