Discrete-time partially observed Markov decision processes: ergodic, adaptive, and safety control