In this paper, we consider using actors to maintain the quality of sensing in the wireless sensor networks. Due to factors such as battery drainage or physical malfunctions, the number of available sensors normally decreases over time after initial deployment, resulting in performance degradation. To maintain the quality of sensing in the network, actors can be used to allocate spare sensors to sensor-deficient regions (sensor allocation) or to relocate sensors from sensor-abundant regions to sensor-deficient regions (sensor relocation). We first focus on the sensor allocation problem. We introduce a baseline centralized greedy algorithm (GA) for sensor allocation, where global sensor information is communicated to obtain the optimal solution. As GA is only efficient for small networks, we proceed to design a distributed patrolling algorithm for achieving global optimization (DPAG) by using only local information. We then extend our work to the application scenario of sensor relocation by proposing a modified GA and DPAG (M-GA and M-DPAG), respectively. Extensive simulation results are provided to demonstrate the performance of the proposed algorithms.