def __run(params, single_run, fixed_votes, token):
    print(f"Running {token}")
    start_time = time.time()
    estimator = Estimator(params)
    output = estimator.run(single_run, fixed_votes)
    r.set(token, output.to_json(orient='records'))
    r.set(f"{token}_status", 'DONE')
    total_time = time.time() - start_time
    print(f"{token} DONE. Time: {total_time} seconds")
class StaticEstimator(Estimator):
    """docstring for ClassName"""
    def __init__(self):
        super(StaticEstimator, self).__init__()

    def update(self):
        obArray = obstacleArray()
        obArray.names.append("quad_x")
        ellipsoidMsg = Ellipsoid()
        # fill fake ellipsoid
        ellipsoidMsg.center = [1, -1, 2] + rand.random(3) * .1
        ellipsoidMsg.shape = np.eye(3).flatten().tolist()
        # push back
        obArray.ellipsoids.append(ellipsoidMsg)

        obArray.names.append("quad_y")
        ellipsoidMsg = Ellipsoid()
        # fill fake ellipsoid
        ellipsoidMsg.center = [1.5, 0, .7] + rand.random(3) * .1
        ellipsoidMsg.shape = np.eye(3).flatten().tolist()
        # push back
        obArray.ellipsoids.append(ellipsoidMsg)
        return obArray


if __name__ == '__main__':
    Estimator = StaticEstimator()
    rospy.loginfo("Estimator: Initalization complete")
    while not rospy.is_shutdown():
        Estimator.run()
Exemple #3
0
theta - overall proportion of positive items
filters_num - number of filters
filters_select - selectivity of filters (probability of applying a filter)
filters_dif - difficulty of filters
iter_num - number of iterations for averaging results
---------------------
FP == False Exclusion
FN == False Inclusion
'''

if __name__ == '__main__':
    params = {
        'filters_num': 4,
        'items_num': 1000,
        'baseround_items': 20,
        'items_per_worker': 10,
        'votes_per_item': 3,
        'filters_select': [0.14, 0.14, 0.28, 0.42],
        'filters_dif': [1., 1., 1.1, 0.9],
        'worker_tests': 5,
        'lr': 5,
        'stop_score': 100,
        'iter_num': 50,
        'z': 0.3,
        'theta': 0.3
    }

    estimator = Estimator(params)
    output = estimator.run(True)
    output.to_csv('output.csv', index=False)