def generate_task_request(self):
        """
        Generate task request from Bernoulli Distribution.

        :return: a numpy array denoted task request, presented in [0, 1, ..., 1]
        """
        return ToolFunction.sample_from_bernoulli(self.__user_num,
                                                  self.__task_request_prob)
示例#2
0
    def generate_task_request(self, parameter):
        """
        Generate task request from Bernoulli Distribution.

        :param parameter: the instance of class Parameter
        :return: a numpy array denoted task request, presented in [0, 1, ..., 1]
        """
        return ToolFunction.sample_from_bernoulli(self.get_user_num(),
                                                  parameter)