1. A system for dynamic task selection (executive control) suitable for mapping external inputs and internal goals toward actions that solve problems or elicit external rewards, the system comprising a processor, an input coupled with the processor for receiving a plurality of inputs to be processed into a motor-schema, and a memory coupled with the processor, wherein the memory includes instruction means that are executable by the processor for causing the processor to perform operations of: receiving sensory inputs; transforming the sensory inputs into clusters of spatial patterns; transforming the clusters of spatial patterns into a spatial schema; encoding transitions between the spatial schema; clustering the spatial schema and encoded spatial schema transitions into a spatio-temporal schema; combining the spatial schema with the spatio-temporal schema to create a bimodal spatio-temporal schema; receiving a reward input and a punishment input, wherein the reward input and the punishment input reflect a current state of an external environment; computing an emotional state and a motivational state from the sensory inputs, the reward input, and the punishment input; combining the bimodal spatio-temporal schema with the reward input, the punishment input, the emotional state, and the motivational state to create an external/internal schema (EXIN schema), wherein the EXIN schema provides a compressed representation assessing emotions, motivations, and rewards; combining the EXIN schema with the bimodal spatio-temporal schema to create a multimodal spatio-temporal schema, wherein the multimodal spatio-temporal schema serves as an episodic memory that can be replayed by the system; receiving structures representing a plurality of elements of a motor system; and combining the multimodal spatio-temporal schema with the motor system structures and the EXIN schema to create a motor schema.