Action and planning in embedded agents