<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_controller(self, controller, timeout=None):
 # type: (Controller, float) -> None """Add a controller to be hosted by this process Args: controller (Controller):
 Its controller timeout (float):
 Maximum amount of time to wait for each spawned object. None means forever """

        assert controller.mri not in self._controllers, \
            "Controller already exists for %s" % controller.mri
        self._controllers[controller.mri] = controller
        controller.setup(self)
        if self.state:
            should_publish = self._start_controllers([controller], timeout)
            if self.state == STARTED and should_publish:
                self._publish_controllers(timeout)